jorxe33 10 Posted February 25, 2012 I want to activate a trigger when any vehicle is damaged (not destroyed). I have several tanks, helicopters and cars. I put in the trigger: getDammaged obj1>= 0.01 or getDammaged obj2 >= 0.01 or etc, etc But is there any way to make this simpler? because too many vehicles. Share this post Link to post Share on other sites
max power 21 Posted February 25, 2012 http://community.bistudio.com/wiki/forEach Will this help? Share this post Link to post Share on other sites
demonized 20 Posted February 26, 2012 condition: ({getDammage _x > 0} [url="http://community.bistudio.com/wiki/count"]count[/url] [url="http://community.bistudio.com/wiki/vehicles"]vehicles[/url]) != 0 on act: hint "one or more vehicles is damaged"; Share this post Link to post Share on other sites
jorxe33 10 Posted February 26, 2012 It works good! Its a very simple way to do this. Thanks Demonized!:) ---------- Post added at 01:31 AM ---------- Previous post was at 01:01 AM ---------- By the way, how do I activate it only when a vehicle damaged is BLUFOR? Share this post Link to post Share on other sites
kylania 568 Posted February 26, 2012 ({side _x == west && getDammage _x > 0} count vehicles) != 0 Share this post Link to post Share on other sites
jorxe33 10 Posted February 26, 2012 Fantastic! Thanks kylania. Share this post Link to post Share on other sites
demonized 20 Posted February 26, 2012 a sidenote to the side question, empty vehicles will count as civilian side, use cfgs to check original side of vehicle no matter crew. ({getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side") == 1 AND getDammage _x > 0} count vehicles) != 0 0 = east 1 = west 2 = resistance 3 = civilian Share this post Link to post Share on other sites
jorxe33 10 Posted February 26, 2012 This code is more accurate. I only have a problem, I want the trigger activates when any blufor vehicule is damaged OR three or more soldiers (blufor) die. I created a game logic an put in the init: easttotal = east countSide allUnits; and in the trigger: ({getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side") == 1 AND getDammage _x > 0} count vehicles) != 0 or east countSide allUnits <= easttotal - 3; and when any vehicule is damaged the trigger activates but if 3 or more soldiers are killed is not activated:confused: Share this post Link to post Share on other sites
demonized 20 Posted February 27, 2012 it works for me just as you posted. Share this post Link to post Share on other sites
kylania 568 Posted February 27, 2012 Just spawn a Russian tank and blow it right up and kick things off right from the start! :) Share this post Link to post Share on other sites
Tankbuster 1744 Posted February 27, 2012 a sidenote to the side question, empty vehicles will count as civilian side, use cfgs to check original side of vehicle no matter crew. ({getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side") == 1 AND getDammage _x > 0} count vehicles) != 0 0 = east 1 = west 2 = resistance 3 = civilian Or get the vehicle's faction. http://community.bistudio.com/wiki/faction Share this post Link to post Share on other sites
jorxe33 10 Posted February 27, 2012 Ok sorry, I did not notice that is "west" instead of "east", actually works great, thank you all for this great forum.:cool: Share this post Link to post Share on other sites