Straxedix
Senior Member
Posts: 426
Threads: 52
Joined: Mar 2014
Reputation:
5
RE: I need a help please
(This post was last modified: 05-14-2014, 06:53 PM by Statyk .)
05-14-2014, 06:50 PM
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
RE: I need a help please
So how does the whole script look at the moment?
05-14-2014, 06:54 PM
Straxedix
Senior Member
Posts: 426
Threads: 52
Joined: Mar 2014
Reputation:
5
RE: I need a help please
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "CloseDoor", "CollideLockDoor", true, 1);
AddEntityCollideCallback("Player", "Area01", "LookBack01", true, 1);
SetEntityPlayerInteractCallback("Key01", "PickKey", true);
}
void LookBack01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door01", 2, 25, "CallbackName");
AddTimer("", 3, "StopLookingAtDoor");
AddTimer("DoorDown", 3, "LockDoor");
}
void StopLookingAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}
void LockDoor(string &in asTimer)
{
SetSwingDoorLocked("Door01", true, true);
PlaySoundAtEntity("bang", "scare_slam_door", "castle_1", 0.0f, false);
StartScreenShake(0.02f, 1.0f, 0.5f, 1.0f);
}
void PickKey(string &in asEntity, string &in asType)
{
GiveSanityBoostSmall(); //Just a nice little sanity boost
SetSwingDoorLocked("Door01", false, true);
}
Forgot in last post NOT WORKING:Key and Sounds i don't know what is wrong whith sounds but it's okay
Fix the sound
(This post was last modified: 05-14-2014, 07:10 PM by Straxedix .)
05-14-2014, 06:56 PM
Neelke
Senior Member
Posts: 668
Threads: 82
Joined: Apr 2013
Reputation:
26
RE: I need a help please
I told you that the sound is played on the wrong object. Try with this:
PlaySoundAtEntity("bang", "scare_slam_door", "Door01", 0.0f, false);
I might sound rude, but please pay attention to what I say.
Derp.
(This post was last modified: 05-14-2014, 08:49 PM by Neelke .)
05-14-2014, 08:49 PM
Straxedix
Senior Member
Posts: 426
Threads: 52
Joined: Mar 2014
Reputation:
5
RE: I need a help please
Yeah i saw that two x) but what is wrong with key
05-15-2014, 09:35 AM
Red
Posting Freak
Posts: 1,757
Threads: 49
Joined: Feb 2012
Reputation:
54
RE: I need a help please
Key is not working? You have to use "AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy)", for it to work.
And for the syntax: "void YourFunction(string &in asItemA, string &in asItemB)"
asName - internal name for the callback
asItemA - internal name of first item
asItemB - internal name of second item
asFunction - the function to call
abAutoRemove - determines whether the callback should be removed when the items are combined
I would recommend to put the "AddUseItemCallback" script under OnStart() or OnEnter() section.
(This post was last modified: 05-15-2014, 02:56 PM by Red .)
05-15-2014, 02:46 PM
Straxedix
Senior Member
Posts: 426
Threads: 52
Joined: Mar 2014
Reputation:
5
RE: I need a help please
I need to make that when pick up just pick up key doors unlock WITHOUT USING IT!
05-15-2014, 03:22 PM
Neelke
Senior Member
Posts: 668
Threads: 82
Joined: Apr 2013
Reputation:
26
RE: I need a help please
Just remove SetSwingDoorLocked then. Simple as that. (if I understand you)
Derp.
(This post was last modified: 05-15-2014, 03:50 PM by Neelke .)
05-15-2014, 03:50 PM
Traggey
is mildly amused
Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation:
185
RE: I need a help please
In the future, please name your threads according what your problem is, instead of ''I need help''
Makes it easier for everyone to see if it's something they can actually help with without checking the thread.
05-15-2014, 04:41 PM
Straxedix
Senior Member
Posts: 426
Threads: 52
Joined: Mar 2014
Reputation:
5
RE: I need a help please
Traggey ok i will
Neelke you gived me script SetSwingDoorLocked so guess to leave that like that to delete it ok to understand me clean look
(This post was last modified: 05-15-2014, 07:53 PM by Straxedix .)
05-15-2014, 07:00 PM