david-grylls 12 Posted July 1, 2015 So I'm attempting at re-creating Battlefield 3's Campaign Mission Night Shift which is a stealth ops mission. At the start of the mission they ask you to shoot out the lights to remove visibility so the insertion team can make for a landing. My question is, is it possible to shoot out 2 street lamps and have that trigger a HELO insertion is is it not possible to test for a blown out light? Thanks! -D.G Share this post Link to post Share on other sites
Greenfist 1863 Posted July 1, 2015 (edited) I'm pretty sure it's possible. You can check the lamp's status with: lightIsOn. edit. I haven't actually tried it though. So it might only return on/off, but not broken. Try getting the object's damage perhaps? Edited July 1, 2015 by Greenfist Share this post Link to post Share on other sites
david-grylls 12 Posted July 1, 2015 I'm pretty sure it's possible. You can check the lamp's status with: lightIsOn.edit. I haven't actually tried it though. So it might only return on/off, but not broken. Try getting the object's damage perhaps? I haven't considered the LightIsOn and I don't think I can check for the damage of the object because it is a pre-placed terrain object so I don't know it's object name, it's just Street Lamp (ON) like all the other lights. Thank you though! Share this post Link to post Share on other sites
Greenfist 1863 Posted July 1, 2015 (edited) Place a game logic (for example) right on the lamp and put in the init: lamp1 = nearestObject [this, "StreetLamp"]; Apparently this works too: lamp1 = [0,0,0] nearestObject 123456; where 1234656 is the object ID you see in the editor. edit. You can also get the ID with the Splendid camera. Just point it at the lamp and find the 6 digit ID in the bottom of the screen. Now place a game logic and put this to init: lamp1 = [0,0,0] nearestObject 602811; lamp2 = [0,0,0] nearestObject 602618; (If you want a large group of lamps in a certain radius, you could find them with nearestobjects and using "StreetLamp" class. But then you need to change the following trigger condition) Then create a trigger, and on the condition field: ({(_x getHit "Light_1_hitpoint") >= 0.9 } count [lamp1,lamp2]) == 2 2 is the number of your lamps and 0.9 is the hitpoint damage level where the light goes out. Some lamps may have a different name for the hitpoint selection than "Light_1_hitpoint". Or the damage level might not be 0.9. Edited July 1, 2015 by Greenfist Share this post Link to post Share on other sites
david-grylls 12 Posted July 2, 2015 (edited) It worked for one lamp but when added the second lamp to the trigger it failed to work. Any idea why? Edited July 2, 2015 by David-Grylls Share this post Link to post Share on other sites
Greenfist 1863 Posted July 2, 2015 Are the lamps of the same kind? They might have different name/damage for the hitpoint. And you're absolutely sure you got the correct IDs? You could try only with the second one and see if it triggers. Other than that, I have no idea what could be wrong. By the way, I noticed the hitpoint damage is still 0 if you run over the post with a tank for example. So to make the trigger more foolproof, you'd need to check the post's damage too. Share this post Link to post Share on other sites
david-grylls 12 Posted July 3, 2015 So I did them both separately and they worked fine but when I get to the trigger something is bugging out. They both use same hitpoint damage names and are both the same lamp type. When running this code: ({(_x getHit "Light_1_hitpoint") >= 0.9 } count [lamp1,lamp2]) == 2 It runs nothing however when the '2' value is changed back to 1 it works. I don't know what it is but the trigger just cant check for lamp1 and lamp2 been destroyed. Edit: By switching it back to '1', it only checks for the first lamp (lamp1) been destroyed, regardless of lamp2 been destroyed prior or after lamp1. Im also shooting out the light so I have no idea what damage hitpoints are like in relation to that. Share this post Link to post Share on other sites
Greenfist 1863 Posted July 3, 2015 That's strange. We're clearly missing something really obvious, because it works fine on my end. Even with more than 2 lamps. Share this post Link to post Share on other sites
david-grylls 12 Posted July 3, 2015 Never mind, I seem to have resolved the issue. When using lamp1 = nearestObject [this, "StreetLamp"]; I think the Game Logic was assigning a near by building lamp as lamp1 and not the selected lamp. I solved it using the lamp1 = [0,0,0] nearestObject 123456; Thank you for your help Greenfist. Everything is working now and it is thanks to your much appreciated work! Share this post Link to post Share on other sites