Will it be with dynamic height? because otherwise pathing can be enough, you have several types of pathing i believe and each of them can be used to check for collision at different heights. Theres is Ground, Air, Building, then i don't remember if theres water and/or impassable.
If you do have dynamic height control then is better just to use a mix of pathing and doodads (invisible or not) as markers, then just check if your units are closer than the radius of your markers and move/damage them away.
The behavior way is pretty simple and elegant, but if you want to use triggers there's a couple ways to do it. The methodology is the same behind both.
Pretty much you need a way to detect collisions in the X Y region. You'll want to base your events on what collides. If you're going to have static (non-respawning and on the map since the beginning, like buildings) you can use the event which detects if a unit is in a certain range of a specific unit. I'm not too sure on this event because I didn't use it for my map, but it looked like a possibility.
The other event you can use is a periodic timer that every 0.XX seconds checks for XY collision within a unit group and then checks to see if their Z's (height) are within collision radius. This works well if you have multiple units that die/respawn/get created and want to check their collisions. This is also very similar to the data method Funky mentioned.
As for declaring unit heights you could always use custom values. Each unit pretty much has an array of custom values they can store. So you can make every unit you want to check use the Custom Value [0] = Height of unit.
I brushed over the basics of this and don't have my map editor open, but hopefully this helped.
I'm working on an airplane map and I need to be able to collide with things at certain heights.
Is this possible?
Are you talking about cliffs, units, or doodads?
Because cliffs and units are definitely possible, if you want to put some work into it.
Units and cliffs will work, doodads would be nice but not essential.
I'm willing to do whatever it takes as this is a primary component of the game.
What response are you looking for in the collision? Like, the flying unit takes damage, bounces off, etc.
Will it be with dynamic height? because otherwise pathing can be enough, you have several types of pathing i believe and each of them can be used to check for collision at different heights. Theres is Ground, Air, Building, then i don't remember if theres water and/or impassable.
If you do have dynamic height control then is better just to use a mix of pathing and doodads (invisible or not) as markers, then just check if your units are closer than the radius of your markers and move/damage them away.
I want the flying unit to explode, but it needs to be able to fly over certain buildings.
Even only having 3 different heights of buildings will be enough.
you can always work with behaviours and add those to the collision validator.
The behavior way is pretty simple and elegant, but if you want to use triggers there's a couple ways to do it. The methodology is the same behind both.
Pretty much you need a way to detect collisions in the X Y region. You'll want to base your events on what collides. If you're going to have static (non-respawning and on the map since the beginning, like buildings) you can use the event which detects if a unit is in a certain range of a specific unit. I'm not too sure on this event because I didn't use it for my map, but it looked like a possibility.
The other event you can use is a periodic timer that every 0.XX seconds checks for XY collision within a unit group and then checks to see if their Z's (height) are within collision radius. This works well if you have multiple units that die/respawn/get created and want to check their collisions. This is also very similar to the data method Funky mentioned.
As for declaring unit heights you could always use custom values. Each unit pretty much has an array of custom values they can store. So you can make every unit you want to check use the Custom Value [0] = Height of unit.
I brushed over the basics of this and don't have my map editor open, but hopefully this helped.
Indeed the map will be static, I'll try the enters region approach and replace it later as needed.
Thanks guys