• 🏆 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!

How to make unit move faster than 522?

Status
Not open for further replies.
Level 5
Joined
Apr 16, 2005
Messages
153
There might be a few things you have to change in the unit editor as well, im not sure. The only time ive had a unit move faster than 522 is when i put a uber endurance aura on him
 
Level 3
Joined
Jun 18, 2007
Messages
72
After setting it to 1000 or w/e in the gameplay constants did you make sure to change the "Movement - Speed Base" to 1000? Thats what i did for a unit of mine and he's definitely moving MUCH faster. If you want the animation also to look more normal to the speed, change the "Art - Run Speed" to the same as the speed base. Just changing the speed max in gameplay constants wont actually increase the unit speed.
 
JASS:
function SlideUnit_Action takes nothing returns nothing
local trigger t = GetTriggeringTrigger()
local unit u = GetHandleUnit(t,"u")
local real a = GetHandleReal(t,"a")
local real d = GetHandleReal(t,"d")
local real l = GetHandleReal(t,"l")
local real r = GetHandleReal(t,"r")
local real s = GetHandleReal(t,"s")
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local rect e = bj_mapInitialPlayableArea


set s = s + l

if s >= r then
call DestroyTrigger(t)
call FlushHandleLocals(t)
set t = null
else
if (GetRectMinX(e) <= x) and (x <= GetRectMaxY(e)) and (GetRectMinY(e) <= y) and (y <= GetRectMaxY(e)) == true then
call SetUnitX(u,x + (d/r*l) * Cos(a * 0.017))
call SetUnitY(u,y + (d/r*l) * Sin(a * 0.017))
endif
call SetHandleReal(t,"s",s)
endif



set t = null
set u = null
set a = 0
set d = 0
set l = 0
set s = 0
set x = 0
set y = 0

endfunction


function SlideUnit takes unit u,real a,real d,real r,real l returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t,l,true)
call TriggerAddAction(t,function SlideUnit_Action)
call SetHandleHandle(t,"u",u)
call SetHandleReal(t,"a",a)
call SetHandleReal(t,"d",d) 
call SetHandleReal(t,"l",l)
call SetHandleReal(t,"r",r)

set u = null
set a = 0
set d = 0
set l = 0

endfunction

This is efficient.
 
Status
Not open for further replies.
Top