Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Checking for every unit in a zone?

A topic by Vertebray created 12 days ago Views: 62 Replies: 4
Viewing posts 1 to 4

I'm making a custom sitrep for a map i made, where part of the mission involves a zone getting flooded, damaging all units inside. Is there a way to check the entire zone and apply an effect to every unit inside?

Developer

Yes, though it’s a bit convoluted. If you use an “emit trigger signal” effect, you can put a list of units (in this case the one that gets all units in a zone) in its “array” field. If you have another trigger set up to catch signals, it will trigger once for each unit in the former’s list with each unit in its context.unit field.

I can try and break that down into more detailed steps if needed, but hopefully that’ll point you in the right direction.

Thanks for the pointer, but would it also be possible to exclude flying mechs from this list? Doesn't make sense for a mech in the air to be affected by something on the ground.

Developer

The best way to do that would be to add a condition on the trigger that receives the signal to check that the context.unit isn’t flying. There is a “Unit boolean” option with flying as a category to check the current flying status.

Thanks a ton!