• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Level 10 trigger challenge!

Status
Not open for further replies.
I mean like the unit will turn to the point
Turning is no problem.
I want it the unit to go to the point like a dumb guy.
Walking is impossible with normal movement as it's only logical that the unit avoids unpassbale points.

If you disable collision for the unit, then it should ignore all obstacles and should be able to walk through.
But then it also can walk through cliffs for example.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,264
How can I disable the auto movement of a unit when I select a point for it to go. I want the unit to go straight to the point and does not try to avoid obstacles like the ordinary war3 does.
Program another, older game. I believe StarCraft I had that behaviour. All modern games have sophisticated path finders built in to find short routes to the target point. Even Diablo III will try to route your hero around doors and other obstacles if encountered.

StarCraft II can achieve this behaviour using Air movement. Air movement lacks path finder logic (straight line movement) so will not route around air pathing blockers. That said air pathing blockers are different from ground pathing (they use spheres) so it has other limiations.

As far as I know WC3 does not allow for this since Air, Ground and Water pathing all works the same and will route around obstacles as best as possible.

If all you want is for a unit to face a point then use highschool mathematics to determine the angle towards the point and order the unit to rotate that direction. You could then use a movement system (eg those used for projectiles) to move the unit straight in that direction at an average speed of the unit's current speed. This would completely bypass the normal movement system, ignore pathing and consume more resources. The system point of entry would be when a move order is issued to the unit, at which time it gets discarded and the unit is then handled by the system.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Another method would be this, when you click somewhere start checking from unit's position to target location until you find an obstacle or destination.Then order unit to move final point.
 
Level 16
Joined
Aug 20, 2009
Messages
1,554
Program another, older game. I believe StarCraft I had that behaviour. All modern games have sophisticated path finders built in to find short routes to the target point. Even Diablo III will try to route your hero around doors and other obstacles if encountered.

StarCraft II can achieve this behaviour using Air movement. Air movement lacks path finder logic (straight line movement) so will not route around air pathing blockers. That said air pathing blockers are different from ground pathing (they use spheres) so it has other limiations.

As far as I know WC3 does not allow for this since Air, Ground and Water pathing all works the same and will route around obstacles as best as possible.

If all you want is for a unit to face a point then use highschool mathematics to determine the angle towards the point and order the unit to rotate that direction. You could then use a movement system (eg those used for projectiles) to move the unit straight in that direction at an average speed of the unit's current speed. This would completely bypass the normal movement system, ignore pathing and consume more resources. The system point of entry would be when a move order is issued to the unit, at which time it gets discarded and the unit is then handled by the system.

This behavior can be achieved.

I believe disabling unit pathing collision removes path-finding in the unit's movement. (I forgot what it's called, barely touched WE anymore, but I've used them in GUI.)

A good example is Mercurial's dagger (Spectre from Dota 1), on where her first ability enables you to walk through any pathing. (She literally ignores any obstacles/cliffs and walk straight to the point).

From here on, after disabling pathing collision, you can just write down your own collision system that stops the unit before colliding to any obstacles.
 
Status
Not open for further replies.

Similar threads

D
Replies
4
Views
673
Deleted member 177737
D
D
  • Locked
Replies
2
Views
1K
Top