• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[System] [Needs work] Unit Movement

Level 7
Joined
Dec 3, 2006
Messages
339
Couldn't this just work 100% of the time if you had a boolean that set for units that told if they were natively moving or not? Like in triggers you set that boolean to false for a second when that unit is being moved by triggers for an knockback etc. and then when ur done moving the unit set it to true? I mean that seems like the more sane approach at least. 1 boolean per unit would eliminate the point of some of these timers.
 
Level 7
Joined
Dec 3, 2006
Messages
339
Adding 2 lines to a spell or wtever for whenever a triggered movement takes place isn't actually that much to ask for a user of the system. It's just an alternative way of doing all of this-- I mean it's really not asking that much considering there are other systems out there that require a whole lot more lines of code added on like damage systems etc.

Also I kinda consider this kind of useless if it isn't even true 100% of the time. Most people don't pause units during movement and use SetUnitX() and SetUnitY() so anything like this would have issues detecting movement based on unit movement speed versus small periodic SetUnitX() and SetUnitY().
 
Level 7
Joined
Dec 3, 2006
Messages
339
Yeah, I guess thats true. Thinking about it theres even ways that booleans in periodic type triggers for natively moving units will mess up. The only way to get 100% true native movement would be to have all triggered native movement which seems like a mess for lots and lots of units, so this seems like the most reasonable approach at least.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
* function IsUnitStationaryById takes integer whichUnit returns boolean
* function IsUnitMovingById takes integer whichUnit returns boolean
* function IsUnitNativelyMovingById takes integer whichUnit returns boolean
* function CanUnitMoveById takes integer whichUnit returns boolean
* function GetMovingUnitById takes nothing returns integer

-> Add wrappers for each of these - also GetMovingUnitById doesn't make sense it should be just GetMovingUnitId.
 
Top