It doesn't work again, but thanks for your try DRedshot!
At this point I show you my script :
------------------------------------------------------------------------------------------------------
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player" , "Enemy02_appear" , "Enemy02_appear" , true , 1);
AddEntityCollideCallback("LeverExit" , "ExitOpen" , "OpentheExit" , true , 1);
SetEntityPlayerInteractCallback("Library_Key", "Enemy03_appear", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
SetPlayerLampOil(0);
PlayMusic("10_amb.ogg", true, 1.0f, 0, 0, true);
AddUseItemCallback("", "PrisonDoor_Key", "PrisonDoor", "KeyOnDoor1", true);
AddUseItemCallback("", "Ceiling_Key", "Ceiling", "KeyOnDoor2", true);
AddUseItemCallback("", "Library_Key", "Library", "KeyOnDoor3", true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
////////////////////////////
// Actual functions
void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("PrisonDoor", false, true);
RemoveItem("PrisonDoor_Key");
PlaySoundAtEntity("", "unlock_door.snt", "PrisonDoor", 0.0f, true);
SetEntityActive("Enemy01" , true);
}
void Enemy02_appear(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Enemy02" , true);
}
void Enemy03_appear(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Enemy03" , true);
AddEnemyPatrolNode("Enemy03", "Path0", 1000000.0f, "true");
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Ceiling", false, true);
RemoveItem("Ceiling_Key");
PlaySoundAtEntity("", "unlock_door.snt", "Ceiling", 0.0f, true);
}
void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Library", false, true);
RemoveItem("Library_Key");
PlaySoundAtEntity("", "unlock_door.snt", "Library", 0.0f, true);
}
void OpentheExit(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Basement", false, true);
SetEntityActive("Guard01" , true);
PlaySoundAtEntity("LeverExit", "levelexitopen.ogg", "Player", 0.5f, false);
SetEntityActive("Guard02" , true);
SetEntityActive("Guard03" , true);
}
------------------------------------------------------------------------------------------------------
(I have removed the PatrolNodes, because they would explode my post)
The Lever has the settings:
Name: LeverExit
The ScriptArea has the setting:
Name: ExitOpen
So what is wrong? Any ideas?