BRUTAL
I'm working
- Reaction score
- 118
for the example slide trigger in TT theres this part
what are tx, and ty? i dont see them anywhere except in the function agruments same with whichUnit
JASS:
static method create takes unit whichUnit, real tx, real ty returns Data
local Data data = Data.allocate()
local real Dx
local real Dy
local real distance
local real angle
set data.whichUnit = whichUnit
set data.x = GetUnitX(whichUnit)
set data.y = GetUnitY(whichUnit)
set Dx = tx - data.x
set Dy = ty - data.y
set distance = RMinBJ(SLIDE_MAX_DISTANCE, SquareRoot(Dx * Dx + Dy * Dy))
set data.ticks = R2I(distance / (SLIDE_SPEED*TT_PERIOD)) // <-------<< remember this formula
set angle = Atan2(Dy, Dx)
set data.dx = (SLIDE_SPEED*TT_PERIOD) * Cos(angle)
set data.dy = (SLIDE_SPEED*TT_PERIOD) * Sin(angle)
call SetUnitPathing( data.whichUnit, false )
return data
endmethod
what are tx, and ty? i dont see them anywhere except in the function agruments same with whichUnit