Frictional Games Forum (read-only)
[SCRIPT] I need a help please - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] I need a help please (/thread-25288.html)

Pages: 1 2 3


RE: I need a help please - Straxedix - 05-14-2014

It is like this Neelke

Spoiler below!
void PickKey(string &in asEntity, string &in asType)
{
GiveSanityBoostSmall(); //Just a nice little sanity boost
SetSwingDoorLocked("Door01", false, true);
}

SetEntityPlayerInteractCallback("Key01", "PickKey", true);




RE: I need a help please - Statyk - 05-14-2014

So how does the whole script look at the moment?


RE: I need a help please - Straxedix - 05-14-2014

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 Smile


RE: I need a help please - Neelke - 05-14-2014

I told you that the sound is played on the wrong object. Try with this:

Code:
PlaySoundAtEntity("bang", "scare_slam_door", "Door01", 0.0f, false);

I might sound rude, but please pay attention to what I say.


RE: I need a help please - Straxedix - 05-15-2014

Yeah i saw that two x) but what is wrong with key


RE: I need a help please - Red - 05-15-2014

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.


RE: I need a help please - Straxedix - 05-15-2014

I need to make that when pick up just pick up key doors unlock WITHOUT USING IT!


RE: I need a help please - Neelke - 05-15-2014

Just remove SetSwingDoorLocked then. Simple as that. (if I understand you)


RE: I need a help please - Traggey - 05-15-2014

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.


RE: I need a help please - Straxedix - 05-15-2014

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

Spoiler below!
I need after script we make (doors close by it self turning around blah blah blah) to just pick the... yes PICK KEY and WITHOUT USING KEY on door Door01 Unlock