• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Making a flying unit land only in adecuate terrain.

Status
Not open for further replies.
Level 4
Joined
Dec 12, 2018
Messages
35
So, I made a unit that can transform into a flying mode and a land mode (kinda the terran vikings from Starcraft 2). No problem with it, except, when it tries to land over water or other impassable terrain, it gets stuck in mid air and can't move anymore until I force it to use the ability again a get into fliying mode.

Is there a way to make the ability only usable over passable terrain?
 
Does Druid of the Talon have this issue when morphing between Crow and Druid form? If not then maybe using that transform ability would help. If you already are then check the unit properties in case it is unit related field that has to be turned on so it performs placement checks.

If this ability has to be triggered, then you can perform some pathing checks on the ground below the unit before transforming the unit type. The pathing check function only considers the static pathing map (generated by World Editor from terrain and doodads) and not the result of destructables or building units. A more expensive custom pathing check function that does factor in destructables and building units can be made by using dummy units with the desired pathing properties and seeing if they are placed correctly.
 
A more expensive custom pathing check function that does factor in destructables and building units can be made by using dummy units with the desired pathing properties and seeing if they are placed correctly.

one easy way to do this that I have used is with items. just create an item on that location and then check the distance between the item and the unit. if the unit is too far from the item - the ability doesn't go through and the player gets an error message.

obviously using raven form is way cleaner if you can though like DSG wrote...
 
Oh, bless my stupidity, I didn't think of druid of the talon when I created the ability. Since this is for a hero unit, I by went using the Robo-gobling ability and, of course, it doesn't check terrain. Thanks.
 
Status
Not open for further replies.
Back
Top