tracy_t 0 Posted November 10, 2003 Hi all, For a given island (Skye in my case) I would like to turn off all the lights (houses & streetlamps in particular) to simulate a "power-cut" effect. I tried: _x = 100 #offloop ? _x < 9000: Object _x SwitchLight "OFF" ? _x==9000: goto "finished" _x = _x+1 ~.5 goto "offloop" #finished exit But this code actually causes the operation flashpoint process to terminate!!!! I realise my code may be referencing a non-existent object, but how the hell else can you do it? Cheers Tracy Share this post Link to post Share on other sites
TeRp 1 Posted November 10, 2003 Common problem. You have to switch off every light one by one, that means collect all IDs refering to StreetLamps and create a script that switches of every lamp.. Next time you should use the search function, i'm sure you would have find a thread or two with this problem already discussed. Share this post Link to post Share on other sites
bn880 5 Posted November 10, 2003 Your problem is the object command which causes a CTD on non exisiting object. There is no way around it, you must manually collect the object ID's of the lamps. Else you have to do map wide scans with nearestObject, and I'm not even sure that would pick up all lamps. (not that it's easier than manually gettting lamp ID's) Share this post Link to post Share on other sites
Guest Posted November 10, 2003 Yes, but once you have all the ID no.s, there are some very cool things you can do with them Share this post Link to post Share on other sites
tracy_t 0 Posted November 10, 2003 Bit poor that. Can't get SwitchLight to work on houses, so turning the lamps off is pointless anyway. BIS, please fix this ASAP!!! lol Share this post Link to post Share on other sites
freddern 0 Posted November 10, 2003 Just in case if u don't know how to turn a light of: object 173876 switchlight "on" object-id or off Share this post Link to post Share on other sites
Guest Posted November 11, 2003 Like I said....manual ID numbers is actually much better. Even if SwitchLight worked, it would create more lag....and you don't have as much control. I've seen a very nice script made for BAS' Tonal island which has the lights turning on randomly over a 40 second period, with some of them flickering a little....looks exactly like a city lighting up at night. There's no easy way to do that with SwitchLight even if it did work in the way you want to. Share this post Link to post Share on other sites
tracy_t 0 Posted November 11, 2003 Hmm, First: Thanks for the lesson in object syntax freddern. Second: Already searched mission editing for switchlight function and got zilch. Third: thanks to all that replied. Tried Object <lamp id> switchlight "OFF" on Skye island and nothing happened. So I guess the lights are either hard-wired to stay on Share this post Link to post Share on other sites
TheMcDeth 0 Posted November 12, 2003 I've seen a very nice script made for BAS' Tonal island which has the lights turning on randomly over a 40 second period, with some of them flickering a little....looks exactly like a city lighting up at night. There's no easy way to do that with SwitchLight even if it did work in the way you want to. Â I would guess they have made it with a scrÃpt. example: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_n=random(15) _i=0 ~random(10) #loop ~random(50)/100 _i=_i+1 object XXXXX switchlight "on" ~random(50)/100 object XXXXX switchlight "off" ? _i==_n : exit goto "loop" The problem with switchlight is that if you switch them off, you need to switch them back on. Otherwise when you do not do this, you will have the lights switched off when you try the mission next time or even when you run another mission on the same island. Does anyone know if this feature has been removed? Share this post Link to post Share on other sites