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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Scripting/Variables problem.
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Scripting/Variables problem.

void OnStart()
{
AddEntityCollideCallback("Player", "Area_3", "CheckAreas", false, 0);
AddEntityCollideCallback("Player", "Area_4", "CheckAreas", false, 0);
AddEntityCollideCallback("Player", "Area_5", "CheckAreas", false, 0);
AddEntityCollideCallback("Player", "Area_6", "CheckAreas", false, 0);
}

void CheckAreas(string &in asParent, string &in asChild, int alState)
{

if(alState == 1)
{

if(asChild == "Area_3")
{
SetLocalVarInt("Area_3", 1);
}

if(asChild == "Area_4")
{
SetLocalVarInt("Area_4", 1);
}

if(asChild == "Area_5")
{
SetLocalVarInt("Area_5", 1);
}

if(asChild == "Area_6")
{
SetLocalVarInt("Area_6", 1);
}

SetLocalVarInt("InsideArea", 1);

}

if(alState == -1)
{

SetLocalVarInt("InsideArea", 0);

if(asChild == "Area_3")
{

SetLocalVarInt("Area_3", 0);
}

if(asChild == "Area_4")
{
SetLocalVarInt("Area_4", 0);
}

if(asChild == "Area_5")
{
SetLocalVarInt("Area_5", 0);
}

if(asChild == "Area_6")
{
SetLocalVarInt("Area_6", 0);
}
}
}


void Callback2(string &in asEntity, int alState)
{

if(GetLocalVarInt("InsideArea") == 1)
{

if(alState == 1)
{

}

if(alState == 0)
{
if(GetLocalVarInt("Area_3") == 1)
{
//DO STUFF IF INSIDE AREA 3
}


if(GetLocalVarInt("Area_4") == 1)
{
//DO STUFF IF INSIDE AREA 4
}


if(GetLocalVarInt("Area_5") == 5)
{
//DO STUFF IF INSIDE AREA 3
}


if(GetLocalVarInt("Area_6") == 6)
{
//DO STUFF IF INSIDE AREA 3
}
}
}
}


This is how i understood it.

Trying is the first step to success.
(This post was last modified: 02-05-2013, 07:47 PM by FlawlessHappiness.)
02-05-2013, 11:04 AM
Find


Messages In This Thread



Users browsing this thread: 1 Guest(s)