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
Need help with a script (again)
Akasu Offline
Member

Posts: 62
Threads: 6
Joined: Aug 2010
Reputation: 2
#11
RE: Need help with a script (again)

That did it. Thanks for bothering Smile Always nice to learn stuff.

E: Yep. Definately works.
Final product
Spoiler below!
void OnStart ()
{
AddEntityCollideCallback("box1","area_red","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box1","area_green","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box1","area_blue","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box2","area_red","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box2","area_green","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box2","area_blue","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box3","area_red","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box3","area_green","BOX1LIGHT", false, 0);
AddEntityCollideCallback("box3","area_blue","BOX1LIGHT", false, 0);
SetLocalVarInt("RedLightOn", 1);
SetLocalVarInt("GreenLightOn", 1);
SetLocalVarInt("BlueLightOn", 1);
SetLightVisible("redy", false);
SetLightVisible("greeny", false);
SetLightVisible("bluey", false);
}

void BOX1LIGHT(string &in asParent, string &in asChild, int alState)
{
if(asChild == "area_red") {
if(GetLocalVarInt("RedLightOn") == 1) SetLocalVarInt("RedLightOn", 0);
else SetLocalVarInt("RedLightOn", 1);

if(GetLocalVarInt("RedLightOn") == 1) SetLightVisible("redy", false);
else SetLightVisible("redy", true);
}

if(asChild == "area_green") {
if(GetLocalVarInt("GreenLightOn") == 1) SetLocalVarInt("GreenLightOn", 0);
else SetLocalVarInt("GreenLightOn", 1);

if(GetLocalVarInt("GreenLightOn") == 1) SetLightVisible("greeny", false);
else SetLightVisible("greeny", true);

}

if(asChild == "area_blue") {
if(GetLocalVarInt("BlueLightOn") == 1) SetLocalVarInt("BlueLightOn", 0);
else SetLocalVarInt("BlueLightOn", 1);

if(GetLocalVarInt("BlueLightOn") == 1) SetLightVisible("bluey", false);
else SetLightVisible("bluey", true);
}
}
09-22-2010, 09:25 PM
Find


Messages In This Thread
Need help with a script (again) - by Akasu - 09-22-2010, 08:03 PM
RE: Need help with a script (again) - by gosseyn - 09-22-2010, 08:11 PM
RE: Need help with a script (again) - by Akasu - 09-22-2010, 08:17 PM
RE: Need help with a script (again) - by gosseyn - 09-22-2010, 08:23 PM
RE: Need help with a script (again) - by Akasu - 09-22-2010, 08:32 PM
RE: Need help with a script (again) - by gosseyn - 09-22-2010, 08:35 PM
RE: Need help with a script (again) - by Akasu - 09-22-2010, 08:38 PM
RE: Need help with a script (again) - by gosseyn - 09-22-2010, 08:47 PM
RE: Need help with a script (again) - by Akasu - 09-22-2010, 09:05 PM
RE: Need help with a script (again) - by Akasu - 09-22-2010, 09:25 PM
RE: Need help with a script (again) - by jens - 09-23-2010, 06:34 AM
RE: Need help with a script (again) - by Akasu - 09-23-2010, 10:44 AM



Users browsing this thread: 1 Guest(s)