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 Lights ON and OFF
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Lights ON and OFF

A few things:

First, players cannot interact with lights in-game. You can script interactions through buttons or levers (like I'm guessing you're trying to do), but scripting a direct player interaction with a light (e.g. the player walks up and literally clicks on the light source) won't work. Second, the only thing your current script would do, even if it worked, is turn the lights on. Third, lights don't turn on/off based on being 'active' or not. They aren't treated as entities, so you'll need to use the scripts to control them.

In your OnStart function, put this line. It is a for-loop which will turn off all of the lights.

for(int i=1;i<=6;i++) SetLightVisible("light_"+i, false);

Now you can work out the function to turn the lights on and off, and use that same line of script (changing the value of false as needed).

(This post was last modified: 03-21-2012, 04:09 PM by palistov.)
03-21-2012, 04:08 PM
Find


Messages In This Thread
Lights ON and OFF - by asghdrew - 03-21-2012, 03:57 PM
RE: Lights ON and OFF - by palistov - 03-21-2012, 04:08 PM
RE: Lights ON and OFF - by asghdrew - 03-21-2012, 04:27 PM
RE: Lights ON and OFF - by Your Computer - 03-21-2012, 09:44 PM
RE: Lights ON and OFF - by asghdrew - 03-22-2012, 11:34 AM
RE: Lights ON and OFF - by Your Computer - 03-22-2012, 08:09 PM
RE: Lights ON and OFF - by asghdrew - 03-22-2012, 08:40 PM
RE: Lights ON and OFF - by Your Computer - 03-22-2012, 08:57 PM
RE: Lights ON and OFF - by asghdrew - 03-22-2012, 09:02 PM
RE: Lights ON and OFF - by Your Computer - 03-22-2012, 09:41 PM



Users browsing this thread: 7 Guest(s)