Frictional Games Forum (read-only)
[SCRIPT] Easy Cuestion - 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] Easy Cuestion (/thread-24812.html)

Pages: 1 2


RE: Easy Cuestion - Mudbill - 03-11-2014

It's literally only 1 symbol different.

Code:
void OnStart()
{
    AddUseItemCallback("", "Key123", "Door123", "UseKeyOnDoor", true);
    AddUseItemCallback("", "Study123", "Doors122", "UseKeyOnDoor2", true);
    AddEntityCollideCallback("Player", "Area1", "LookBack, true, 1);  //<- This ';' symbol.
}



RE: Easy Cuestion - Straxedix - 03-12-2014

.hps

AddEntityCollideCallback("Player", "Area1", "LookBack", true, 1);

void FunctionName(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door123", 20, 25, "CallbackName");
}

void CallbackName()
{
StopPlayerLookAt();
}


and no error showed just not working...


RE: Easy Cuestion - Neelke - 03-12-2014

Code:
AddEntityCollideCallback("Player", "Area1", "LookBack", true, 1);

void LookBack(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door123", 20, 25, "CallbackName");
}

void CallbackName()
{
StopPlayerLookAt();
}

The function was supposed to be named LookBack, not FunctionName.


RE: Easy Cuestion - Romulator - 03-12-2014

Aand the AddEntityCollideCallback should be in OnStart() like Mudbill pointed out.


RE: Easy Cuestion - Straxedix - 03-12-2014

Like this ??? if not PLEASE set .hps how need to be to finish this Thread...


void OnStart()

{
AddUseItemCallback("", "Key123", "Door123", "UseKeyOnDoor", true);
AddUseItemCallback("", "Study123", "Doors122", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "Area1", "LookBack", true, 1);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door123", false, true);
PlaySoundAtEntity("", "unlock_door", "Door123", 0, false);
RemoveItem("Key123");
}

void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Doors122", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Doors122", 0, false);
RemoveItem("Study123");
}

void FunctionName(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door123", 20, 25, "CallbackName");
}

void CallbackName()
{
StopPlayerLookAt();
}


RE: Easy Cuestion - Neelke - 03-12-2014

Can you look at my post please and see what I changed? The function is supposed to be called LookBack, NOT FunctionName.


RE: Easy Cuestion - Straxedix - 03-12-2014

Yeah sorry today it's not my lucky day but at least it worked THANKS Big Grin