Frictional Games Forum (read-only)

Full Version: Can't get Areas active
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Alright so the idea is to make the "player" walk through 3 areas.
1. makes the door active and blockes him off --done.
2. The first area set's the 2nd area active aswell as the door "no fatal erros , so i guess it works"
3. When he goes back and touches the 2nd area the player is suppose to make the 2nd door active and confuse the player so he thinks he's stuck. The 2nd script also activate the 3rd script "havn't scripted this part yet since the 2nd area dosen't get active.
4. When touching the 3rd area the 1st door dissapear and the player can contiune with the mod.

But for some reason the 1st script area don't activate the 2nd scripting area and that's my problem.
While i'm writing this helping requiest i also wonder how do i make the 1st door dissapear is it like making it active but the opposite so instead of : SetEntityActive("Door_1", true);
I change it to : SetEntityActive("Door_1", false); would that do it? I really need help i'm so confused.

Here's the full script if you need to read it :


void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Door", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Script", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Door2", true, 1);
}

void Door(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_1", true);
}

void Door2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_2", true);
}

void Script(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScriptArea_2", true);
}














////////////////////////////
// Run when entering map
void OnEnter()
{
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Why so complicated, make it like this instead:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Door", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Script", true, 1);
}

void Door(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_1", true);
}

void Door2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_2", true);
}

void Script(string &in asParent, string &in asChild, int alState)
{
AddEntityCollideCallback("Player", "ScriptArea_2", "Door2", true, 1);
}

And make sure all script areas are activated (enabled)

But that dosen't tell me how to remove the door.
SetEntityActive("DoorName", false); ? -> just put it into correct spot Smile

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Door", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Script", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Door2", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "Door1", true, 1);
}

void Door(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_1", true);
SetEntityActive("ScriptArea_2", true);
SetEntityActive("ScriptArea_3", true);
}

void Door1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_1", false);
}

void Door2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_2", true);
}

void Script(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScriptArea_2", true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}