06-19-2012, 08:02 PM
So, straight to the point. I would like to go about setting up a trigger - this would be once "NOTETWO" is picked up, it causes a door ("room102") to be unlocked, a monster ("brute1") to spawn in "brute1area", and the player to turn to look at it. I have one trigger already setup, but I'm not sure about how to setup a second one. Any help would be greatly appreciated.
Here is my current script:
Thanks
Here is my current script:
PHP Code:
void OnStart()
{
}
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "room101key", "room101", "UsedKeyOnDoor", true);
AddUseItemCallback("", "room100key", "room100", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("room100key", "OnPickup");
SetEntityCallbackFunc("NOTETWO", "OnPickup");
AddUseItemCallback("", "hatch101key", "hatch101", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", asEntity, "room101", 0, false);
PlaySoundAtEntity("", asEntity, "room100", 0, false);
PlaySoundAtEntity("", asEntity, "hatch101", 0, false);
RemoveItem(asItem);
}
void OnPickup(string &in asEntity, string &in type)
{
if(asEntity == "room100key")
{
SetEntityActive("poofer1", true);
ShowEnemyPlayerPosition("poofer1");
PlaySoundAtEntity("", "04_break.snt", "poofer1", 0, false);
StartPlayerLookAt("poofer1",2,2,"");
StopPlayerLookAt();
}
else if(asEntity == "NOTETWO")
{
SetSwingDoorLocked("room102",false,false);
SetEntityActive("brute1",true);
ShowEnemyPlayerPosition("brute1");
StartPlayerLookAt("brute1",2,2,"");
StopPlayerLookAt();
}
}
Thanks