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)
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#12
RE: Need help with a script (again)

To simplify it, skip the LocalVars all together and use a better naming on your areas and light that way you can make this really simple.

void BOX1LIGHT(string &in asParent, string &in asChild, int alState)
{
    if(alState == 1)
    {
        SetLightVisible(asChild+"_light", true);
    }
    else if(alState == -1)
    {
        SetLightVisible(asChild+"_light", false);
    }
}

So you check the variable that tells you if something enters or leaves the area, that is alState.

Then if you name you lights the same as the area but suffix them with _light, you can use the variable with the name of the area to not write everything specific.

Example: Area is named "MyArea", you name the light "MyArea_Light", in the script you then use asChild+"_Light" which is the same as "MyArea_Light" because asChild is the variable containing what area it is that something entered into.
(This post was last modified: 09-23-2010, 06:36 AM by jens.)
09-23-2010, 06:34 AM
Website 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)