Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Can't get Areas active
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#1
Can't get Areas active

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()
{
}
(This post was last modified: 02-04-2012, 05:59 PM by trollox.)
02-04-2012, 05:24 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#2
RE: Can't get Areas active

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)


The Interrogation
Chapter 1

My tutorials
02-04-2012, 09:49 PM
Find
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#3
RE: Can't get Areas active

But that dosen't tell me how to remove the door.
02-04-2012, 10:13 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#4
RE: Can't get Areas active

SetEntityActive("DoorName", false); ? -> just put it into correct spot Smile

The Interrogation
Chapter 1

My tutorials
02-04-2012, 10:14 PM
Find
vcplz Offline
Member

Posts: 115
Threads: 3
Joined: Apr 2011
Reputation: 1
#5
RE: Can't get Areas active


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()
{
}
02-04-2012, 10:26 PM
Find




Users browsing this thread: 2 Guest(s)