K6 0 Posted December 12, 2001 Does someone know how I can a turn off a streetlamp in a city. No addon streetlamp! Thanks K6 Share this post Link to post Share on other sites
PlaneShifter 0 Posted December 12, 2001 Very possible. You can even add lightswitches to every single lamp, if you want to. Create a trigger, condition TRUE, activation: nearestObject [this, "StreetLamp"] switchLight "OFF" There ya go! You don't even need a radius to be set for the trigger. Keep in mind that O:FP's handling of streetlights is VERY slow. It might take a few seconds for the thing to actually appear to be off, but this DOES work. To make a lightswitch feature, I did this: Place a flag or other static object inside the light (using an invisible game logic unit will only work in single player), give it a name, and put this in the init field: this addAction ["Turn streetlight on/off","lightswitch.sqs"] Then, make a script called "lightswitch.sqs" with the following code: *** _lightname = _this select 0 ? lightIsOn nearestObject [_lightname, "StreetLamp"] == "OFF" : goto "setOn" ? lightIsOn nearestObject [_lightname, "StreetLamp"] == "AUTO" : goto "setOff" #setOff nearestObject [this, "StreetLamp"] switchLight "OFF" exit #setOn nearestObject [_lightname, "StreetLamp"] switchLight "AUTO" exit *** NOTE: "AUTO" is used, because "ON" doesn't show the light during daytime anyways, and "AUTO" is the default value. You can change it if you want to, with no ill effects, AFAIK. Have fun! - PlaneShifter - Share this post Link to post Share on other sites
K6 0 Posted December 13, 2001 Thanks dude, great answer...more the I expected. Will try this out. Thanks again Share this post Link to post Share on other sites
K6 0 Posted December 13, 2001 I did it exactly as you said. Not the switch part! It wrote "invalid number in expression" Share this post Link to post Share on other sites
K6 0 Posted December 15, 2001 Can someone warchover the first light off sentence its not working. Thanks Share this post Link to post Share on other sites
PlaneShifter 0 Posted December 17, 2001 Try naming the trigger and replacing "this" with the trigger name. Might be referencing the trigger list or something, I dunno. Also, make sure your quotes and brackets are all in the right places. I'll try this myself and see if I get the same problem. - PlaneShifter - Share this post Link to post Share on other sites