(02-14-2013, 01:01 AM)serbusfish Wrote: I have it sorted, thanks again
One more thing though, rather than make a new thread can someone tell me how I can activate a script box within the game? I tried the SetEntityActive command but it seems to activate when the map is loaded.
SetEntityActive will work to set a script area active/inactive. If you put SetEntityActive in OnStart or OnEnter, the script area will activate when the map is loaded. If you want it to happen after a certain event, then it would go in a different function. In this example, the script area (
ScriptArea_1) gets activated when the player steps into a different script area (
ScriptArea_2) :
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_2", "ActivateArea", true, 1);
}
void ActivateArea(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScriptArea_1", true);
}
Make sure that ScriptArea_1 is set inactive in the level editor.