egwal 0 Posted December 13, 2003 So Im making this mp mission where a Russian naval squad defends a bridge on the East Border-map(FDFMOD). There are two streetlights near the bridge. One in each end. And now i want to be able to switch them on and off when a player gets near(addaction?). But the problem is that i havent placed them in the editor, they came with them map, so I guess I gotta fool around with the IDs. Thanks in advance. Share this post Link to post Share on other sites
tracy_t 0 Posted December 13, 2003 Some lampost type objects respond to object <id of object> SwitchLight "OFF" And others respond to object <id of object> inflame false Share this post Link to post Share on other sites
egwal 0 Posted December 13, 2003 Some lampost type objects respond to object <id of object> SwitchLight "OFF" And others respond to object <id of object> inflame false Thanks tracy, it worked fine, but its not finished yet. I want to have it so that when someone gets near the streetlight in mp, a new action appers in action menu, eg. "switch the northern light off". How do I do this? Share this post Link to post Share on other sites
tracy_t 0 Posted December 13, 2003 Well, you could use object <id of lampost> addaction ["Switch Lightpost off", "switchlightoff.sqs"] If that doesn't work, then you're gonna have to use a trigger, or use: ? Player distance NearestObject [Player, "streetlamp"] < 5: addaction etc etc. Share this post Link to post Share on other sites
TheMcDeth 0 Posted December 16, 2003 I would recommend against switching streetlights off. When you switch them off, they will remain off, even in the next mission you play. So one way to go around this to damage the lammpost. object <id of object> setdammage 0.5 That will damage the lamp and "switch" it off. Downside of this method is that there will be a delay when the lights are switched off... Share this post Link to post Share on other sites
tracy_t 0 Posted December 16, 2003 Hmm, tried that with Skye map McDeth, and it didn't work. SwitchLight did though ;) Share this post Link to post Share on other sites
TheMcDeth 0 Posted December 17, 2003 Hmm, tried that with Skye map McDeth, and it didn't work. SwitchLight did though ;) Well tried it yesterday with FDF East Border Island and it worked fine. It does have an annoying delay though... Share this post Link to post Share on other sites
djukel 0 Posted November 20, 2004 Hmm, tried that with Skye map McDeth, and it didn't work. SwitchLight did though ;) Well tried it yesterday with FDF East Border Island and it worked fine. It does have an annoying delay though... Somebody has all streetlamp object ID of FDF East Border Island? Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 20, 2004 the mapfact barracks addon has a power station unit, and you can use it to turn street lights on and off based on the fact that the street light either has a name or an object id. the instructions are in the mapfact barracks zip file. Please read it, its very easy to understand, and can even apply to other things if you wish. Share this post Link to post Share on other sites
djukel 0 Posted November 20, 2004 the mapfact barracks addon has a power station unit, and you can use it to turn street lights on and off based on the fact that the street light either has a name or an object id. the instructions are in the mapfact barracks zip file. Please read it, its very easy to understand, and can even apply to other things if you wish. Thanks I know that, my intention to use it to cut power off. But determine all object id of streetlamp is very dull and long work. That is why I hope somebody already done this before. Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 20, 2004 Then by all means use me as your inspiration, motivation, whatever. Â You can not only cut power off, but using your knowledge of id's you can have destroyed buildings set off objectives if you research hard enough into it. That is exactly what i need to figure out, and once done write up a tutorial for it into ofpec. Share this post Link to post Share on other sites
Drill Sergeant 0 Posted November 20, 2004 Hi, Pic showing how to fix the lights First off I know the BIS editor comes with a neat little button. You hit the button and it pops up the landscapes ID. Then you can use this script 3 to turn off the lights. Just follow the steps in the pic. (BTW this is near the Nogavan bridge.) Share this post Link to post Share on other sites
djukel 0 Posted November 20, 2004 Thanks! I start working on it. I rewrote script found in MAPFACT baracken addon. [nameofcurrenthouse,arrayofIDs] exec "script.sqs" like [this,[221126,221133]] exec "powercut.sqs" ------------------------------------------ _Currenthouse = _this select 0 _IDs = _this select 1 #Cycle @(_Currenthouse animationPhase "Component02" >= 0.5 or not alive _Currenthouse) "object _x switchlight ""off""" foreach _IDs ?(not alive _Currenthouse):exit @(_Currenthouse animationPhase "Component02" < 0.5 or not alive _Currenthouse) ?(not alive _Currenthouse):exit "object _x switchlight ""on""" foreach _IDs Goto "Cycle" ------------------------------------------ Share this post Link to post Share on other sites
BoweryBaker 0 Posted November 21, 2004 Sounds like something out of blade. The lights come off, the spets natz come out, then everyone fights. Share this post Link to post Share on other sites
-=BT=- Matty R 0 Posted November 21, 2004 this is the script this addaction ["Power Off", "lightsout.sqs"] Quote[/b] ]; *****************************************************; ** Operation Flashpoint Script File ; ***************************************************** ;"lightsout.sqs" _flicks=random(10)+10 _flick=0 #loop _flick=_flick+1 (object 5436) switchlight "off" (object 5802) switchlight "off" (object 6540) switchlight "off" (object 6062) switchlight "off" ~random(40)/100 (object 5436) switchlight "on" (object 5802) switchlight "on" (object 6540) switchlight "on" (object 6062) switchlight "on" ~random(70)/100 ?_flick<_flicks: goto "loop" (object 5436) switchlight "off" (object 5802) switchlight "off" (object 6540) switchlight "off" (object 6062) switchlight "off" exit this makes the lights flicker in the town before going off.. then to get them back on at the end because they will stay off for each mission. this addaction ["Power On", "lightsout2.sqs"] Quote[/b] ]; *****************************************************; ** Operation Flashpoint Script File ; ***************************************************** ;"lightsout2.sqs" _flicks=random(10)+10 _flick=0 #loop _flick=_flick+1 (object 5436) switchlight "off" (object 5802) switchlight "off" (object 6540) switchlight "off" (object 6062) switchlight "off" ~random(40)/100 (object 5436) switchlight "on" (object 5802) switchlight "on" (object 6540) switchlight "on" (object 6062) switchlight "on" ~random(70)/100 ?_flick<_flicks: goto "loop" (object 5436) switchlight "on" (object 6062) switchlight "on" exit note i have made it so only a few lights come back on in the town making it look like some of them blew fuses.. Â PM me if you want an example mission Share this post Link to post Share on other sites
Drill Sergeant 0 Posted November 21, 2004 Maaaaaaaan that is so freaken cool. Nice script. Share this post Link to post Share on other sites