Frictional Games Forum (read-only)
Little unkown spike in script - 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: Little unkown spike in script (/thread-9978.html)



Little unkown spike in script - ObsidianLegion - 08-25-2011

Right, so I'm trying to get this key to open a door and all the Scripting names are right. But I have my suspicions about the script. It doesn't crash. It loads the level up, but the callback doesn't work.

Code:
void OnStart()
{
SetEntityPlayerInteractCallback("ScareDoor_1", "ScareDoorScript", true);
AddUseItemCallback("" , "Door_1", "Key_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Door_1",  0, false);
}



RE: Little unkown spike in script - GreyFox - 08-25-2011

The only thing I noticed was you have a space in between the "" , for AddUseItemCallback("" ,

maybe that'll fix it?

-Grey Fox


RE: Little unkown spike in script - ObsidianLegion - 08-25-2011

(08-25-2011, 09:26 PM)GreyFox Wrote: The only thing I noticed was you have a space in between the "" , for AddUseItemCallback("" ,

maybe that'll fix it?

-Grey Fox

Maybe. I'll try. Thanks


RE: Little unkown spike in script - palistov - 08-25-2011

Looks like your script says to call the function if the door is used on the key. Switch them around.


RE: Little unkown spike in script - Patacorow - 08-25-2011

(08-25-2011, 10:10 PM)palistov Wrote: Looks like your script says to call the function if the door is used on the key. Switch them around.

Nah, that's cool. The grunt'll just pick up the door for Daniel and ram it up the key.


RE: Little unkown spike in script - palistov - 08-26-2011

(08-25-2011, 10:35 PM)Patacorow Wrote:
(08-25-2011, 10:10 PM)palistov Wrote: Looks like your script says to call the function if the door is used on the key. Switch them around.

Nah, that's cool. The grunt'll just pick up the door for Daniel and ram it up the key.

^ lol


RE: Little unkown spike in script - GraphicsKid - 08-26-2011

(08-26-2011, 03:57 AM)palistov Wrote:
(08-25-2011, 10:35 PM)Patacorow Wrote:
(08-25-2011, 10:10 PM)palistov Wrote: Looks like your script says to call the function if the door is used on the key. Switch them around.

Nah, that's cool. The grunt'll just pick up the door for Daniel and ram it up the key.

^ lol

thought you weren't going to say key there for a sec.


RE: Little unkown spike in script - ObsidianLegion - 08-26-2011

(08-25-2011, 10:35 PM)Patacorow Wrote:
(08-25-2011, 10:10 PM)palistov Wrote: Looks like your script says to call the function if the door is used on the key. Switch them around.

Nah, that's cool. The grunt'll just pick up the door for Daniel and ram it up the key.

XD This made me lol (: