So I wanted my script to run a function that will activate and launch a corpse out of a cabinet once the player gets killed by a patrolling grunt. Once I die and enter my script area infront of the cabinet nothing happens.
/////////////////////////////////////////////////////////////////////////////////////////
// On map start //
void OnStart()
{
AddUseItemCallback("", "Storage_Room_Key", "Storage_Room_Door", "Open_Storage_Room", true);
// Storage Room Key //
AddEntityCollideCallback("Player", "poofer_spawn_01", "poofer_spawn_script_01", true, 1);
}
void poofer_spawn_script_01(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("*C1", "*C1_spawn", "*FunctionToCall*", "DeathHints", "Hide");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_1", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_3", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_5", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_6", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_7", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_8", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_9", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_10", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_11", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_12", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_13", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_14", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_15", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_16", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_17", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_18", 1.000, "");
SetEntityActive("poofer_grunt_01", true);
}
void FunctionToCall(string &in asName, int alCount)
{
AddEntityCollideCallback("Player", "Teleport_Script", "Nail_That_Sucker01", true, 1);
}
void Open_Storage_Room(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Storage_Room_Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("Storage_Room_Key");
}
void Nail_That_Sucker01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Naked_Guy01", true);
AddPropForce("Naked_Guy01", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Naked_Guy01", 0, false);
}
// On Entering map //
void OnEnter()
{
}
// On Leaving map //
void OnLeave()
{
}