Jump to content
Sign in to follow this  
jorxe33

Any damage

Recommended Posts

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

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

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

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

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

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
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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×