Jump to content
Blitzen88

How to Disable all damage for all buildings within a trigger area?

Recommended Posts

Essentially title...

 

Looking for a way to disable damage for buildings that are within a trigger's area.  I can find examples of how to do this for target a specific building but not for all buildings within a trigger.  Is this even possible?

 

Thanks for the help

Share this post


Link to post
Share on other sites

Sure it's possible but I am not entirely sure which building get command to use.

 

Here's one option:
 

_houses = nearestObjects [player, ["house"], 200];
{


_x allowDamage false;


} foreach _houses;

 

modify the center (player) and radius to your needs

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, gc8 said:

Sure it's possible but I am not entirely sure which building get command to use.

 

Here's one option:
 


_houses = nearestObjects [player, ["house"], 200];
{


_x allowDamage false;


} foreach _houses;

 

modify the center (player) and radius to your needs

How could you change that so the trigger's location is used instead of the player?  Also, can you automatically get the diameter from the trigger instead of a manual input?

Share this post


Link to post
Share on other sites
12 hours ago, Blitzen88 said:

How could you change that so the trigger's location is used instead of the player?  Also, can you automatically get the diameter from the trigger instead of a manual input?

 

I think it's like this (Not tested):

 

_area = triggerArea theTrigger;


_houses = nearestObjects [getpos theTrigger, ["house"],  _area  # 0 ];

 

 

where "theTrigger" is the trigger name set in editor

 

 

 

  • Like 2

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

×