I made a script so when you pass a ceratin area a new entity appears behind you and when you reach another area a new entity appears and the other one disapears but when I enter the map and unlock the door to that room the first entity is already activated :O. I unchecked the "active" box and made a script for the activate/deactivate part.
this is how I setup the areas and entities.
void OnStart()
{
AddEntityCollideCallback("Player" , "activate_wall1" , "func_activate_wall1" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall2" , "func_activate_wall2" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall3" , "func_activate_wall3" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall4" , "func_activate_wall4" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall5" , "func_activate_wall5" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall6" , "func_activate_wall6" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall7" , "func_activate_wall7" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall8" , "func_activate_wall8" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall9" , "func_activate_wall9" , true , 1);
AddEntityCollideCallback("Player" , "activate_wal0" , "func_activate_wal0" , true , 1);
AddEntityCollideCallback("Player" , "activate_wall" , "func_activate_wal1" , true , 1);
}
void func_activate_wall1(string &in asEntity)
{
SetEntityActive("wall1", true);
PlaySoundAtEntity("activate_wall1", "scrape_wood_heavy", "wall1", 0, false);
}
void func_activate_wall2(string &in asEntity)
{
SetEntityActive("wall2", true);
SetEntityActive("wall1", false);
PlaySoundAtEntity("activate_wall2", "scrape_wood_heavy", "wall2", 0, false);
}
void func_activate_wall3(string &in asEntity)
{
SetEntityActive("wall3", true);
SetEntityActive("wall2", false);
PlaySoundAtEntity("activate_wall3", "scrape_wood_heavy", "wall3", 0, false);
}
void func_activate_wall4(string &in asEntity)
{
SetEntityActive("wall4", true);
SetEntityActive("wall3", false);
PlaySoundAtEntity("activate_wall4", "scrape_wood_heavy", "wall4", 0, false);
}
void func_activate_wall5(string &in asEntity)
{
SetEntityActive("wall5", true);
SetEntityActive("wall4", false);
PlaySoundAtEntity("activate_wall5", "scrape_wood_heavy", "wall5", 0, false);
}
void func_activate_wall6(string &in asEntity)
{
SetEntityActive("wall6", true);
SetEntityActive("wall5", false);
PlaySoundAtEntity("activate_wall6", "scrape_wood_heavy", "wall6", 0, false);
}
void func_activate_wall7(string &in asEntity)
{
SetEntityActive("wall7", true);
SetEntityActive("wall6", false);
PlaySoundAtEntity("activate_wall7", "scrape_wood_heavy", "wall7", 0, false);
}
void func_activate_wall8(string &in asEntity)
{
SetEntityActive("wall8", true);
SetEntityActive("wall7", false);
PlaySoundAtEntity("activate_wall8", "scrape_wood_heavy", "wall8", 0, false);
}
void func_activate_wall9(string &in asEntity)
{
SetEntityActive("wall9", true);
SetEntityActive("wall8", false);
PlaySoundAtEntity("activate_wall9", "scrape_wood_heavy", "wall9", 0, false);
}
void func_activate_wall10(string &in asEntity)
{
SetEntityActive("wall10", true);
SetEntityActive("wall9", false);
PlaySoundAtEntity("activate_wall10", "scrape_wood_heavy", "wall10", 0, false);
}
void func_activate_wall11(string &in asEntity)
{
SetEntityActive("wall11", true);
SetEntityActive("wall10", false);
PlaySoundAtEntity("activate_wall11", "scrape_wood_heavy", "wall11", 0, false);
}