Jump to content
Sign in to follow this  
gruukh

Trigger activated when one or more of buildings of certain type are destroyed

Recommended Posts

I'm trying to get a trigger to activate when the number of wind turbines in an area drops below a specified number because they have been destroyed. I'm getting what seems to be a weird response. The settings I have in the trigger (for testing) are:

 

Type: None

Activation: None

 

Condition: count (nearestObjects [[4258.56,20665.285],["Land_wpp_Turbine_V1_F"],200]) < 7

 

On Act: hint "Joe Hockey Smiles" (Joe Hockey was an Aus politician with a partisan hatred of wind turbines, FYI).

 

I get no response at all if I destroy one or more wind turbines within 200m of the specified position. However, if I set the condition to count (nearestObjects [[4258.56,20665.285],["Land_wpp_Turbine_V1_F"],200]) < 8 it DOES get activated.

 

Can anybody explain why this is and/or advise me as to how I can get this trigger to activate if the number of alive turbines falls below 7?

Share this post


Link to post
Share on other sites

In the interim, I worked out a clunkier solution. I took the game logic approach from this thread:

 

https://forums.bistudio.com/topic/188273-lack-of-map-object-interactionids-in-eden/

 

Set a game logic near each turbine (turbine1, turbine2, etc) which would assign a virtual name (t1, t2, etc) to each turbine. Then a trigger with this condition:

 

({alive _x} count [t1,t2,t3,t4,t5,t6,t7]) < 7;

 

And now there's a big smile on Joe Hockey's dial.

 

Seriously, if anyone comes up with a better way of doing this I would love to know.

 

And mods, I put this thread in the wrong section. Sorry about that.

Share this post


Link to post
Share on other sites

In the interim, I worked out a clunkier solution. I took the game logic approach from this thread:

 

https://forums.bistudio.com/topic/188273-lack-of-map-object-interactionids-in-eden/

 

Set a game logic near each turbine (turbine1, turbine2, etc) which would assign a virtual name (t1, t2, etc) to each turbine. Then a trigger with this condition:

 

({alive _x} count [t1,t2,t3,t4,t5,t6,t7]) < 7;

 

And now there's a big smile on Joe Hockey's dial.

 

Seriously, if anyone comes up with a better way of doing this I would love to know.

 

And mods, I put this thread in the wrong section. Sorry about that.

Nice solution, I've never seen multiple units included in a condition.

Seems like you've got it all figured out now. 

Share this post


Link to post
Share on other sites

({alive _x} count [t1,t2,t3,t4,t5,t6,t7]) < 7;

 

Take the same approach to your original condition:

{alive _x} count (nearestObjects [[4258.56,20665.285],["Land_wpp_Turbine_V1_F"],200]) < 7

Share this post


Link to post
Share on other sites

 

Take the same approach to your original condition:

{alive _x} count (nearestObjects [[4258.56,20665.285],["Land_wpp_Turbine_V1_F"],200]) < 7

 

Seems obvious when I think about it now! Will give it a shot and see if it works.

Share this post


Link to post
Share on other sites

 

Take the same approach to your original condition:

{alive _x} count (nearestObjects [[4258.56,20665.285],["Land_wpp_Turbine_V1_F"],200]) < 7

 

h - this worked - thanks very much! Far more efficient than dropping down a bunch of game logics!

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  

×