Frictional Games Forum (read-only)

Full Version: Little unkown spike in script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
}
The only thing I noticed was you have a space in between the "" , for AddUseItemCallback("" ,

maybe that'll fix it?

-Grey Fox
(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
Looks like your script says to call the function if the door is used on the key. Switch them around.
(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.
(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
(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.
(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 (: