- Joined
- Nov 18, 2007
- Messages
- 816
GetLocationZ has the ability to desync.
JASS:function Test takes nothing returns nothing local unit c = GetTriggerUnit() local unit t = GetSpellTargetUnit() local real x1 = GetUnitX(c) local real y1 = GetUnitY(c) local real x2 = GetUnitX(t) local real y2 = GetUnitY(t) local real dist = 500 local real angle = Atan2(y2 - y1, x2, x1) local real dur = 2 call Knockback(t, dist, angle, dur) set c = null set t = null endfunction
local real angle = Atan2(y2 - y1, x2, x1)
local real angle = Atan2(y2 - y1, x2 - x1)
Shouldn't the line
JASS:local real angle = Atan2(y2 - y1, x2, x1)
Be
JASS:local real angle = Atan2(y2 - y1, x2 - x1)
?
And yes, I have the latest ver of NewGen
library Knockback initializer Init
set dat.u = u
set dat.u = u
Silvenon said:JASS:if (x < MAX_X and y < MAX_Y and x > MIN_X and y > MIN_Y) and not BoolAr[1] then call SetUnitX(dat.u, x) call SetUnitY(dat.u, y) endif set dat.d1 = dat.d1 - dat.d2 if dat.d1 <= 0 or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] then set Ar[i] = Ar[Total - 1] set Total = Total - 1 call dat.destroy() endif
if dat.d1 <= 0 or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] then
set Ar[i] = Ar[Total - 1]
set Total = Total - 1
call dat.destroy()
else
call SetUnitX(dat.u, x)
call SetUnitY(dat.u, y)
endif
if dat.d1 <= 0 or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] or IsTerrainPathable( x, y, PATHING_TYPE_WALKABILITY ) == false then
if dat.d1 <= 0 or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] or IsTerrainPathable( x, y, PATHING_TYPE_WALKABILITY ) == false then
set Ar[i] = Ar[Total - 1]
set Total = Total - 1
call dat.destroy()
else
call SetUnitX(dat.u, x)
call SetUnitY(dat.u, y)
endif
How do i import JASS file as i keeping getting errors saying that there is missing value.
yar , but i dont know how to do it.
I can only use (u, d, a, w) if I try to use the others input it says: "Too many arguments"* unit u = the unit being knockbacked
* real d = the distance the unit is knockbacked to
* real a = the angle (direction of the knockback) in RADIANS
* real w = the duration of the knockback
* real r = the radius of tree destroying, but there's a new trick: if you put a negative number as the radius, the unit will stop knockbacking when it gets in that range of a tree and if you put a positive value, the unit will destroy trees when it gets in that range of a tree (if you don't want any of those, just put 0)
* integer t = type 0 means no effect (both s and p should be ""), type 1 means periodic effect (meaning you should put "" as the attachment point, parameter p), type 2 means a special effect attached on the unit and destroyed when the knockback is finished (this is where you use parameter p)
* string s = the path to the special effect you want to use (periodic), that effect will be destroyed immediatelly (you can put "" if you don't want a special effect)
* string p = used for type 2, it's the attachment point of the effect, "chest" is default (so if you put "", it will be "chest")
function PushUp_Structs takes integer fromwhere returns nothing
local integer i = fromwhere
loop
set i = i + 1
exitwhen i > Total
set Knockbackdata[i-1] = Knockbackdata[i]
endloop
set Total = Total - 1
endfunction
if dat.d1 <= 0 or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] then
set Ar[i] = Ar[Total - 1]
set Total = Total - 1
call dat.destroy()
endif
if ((dat.d1<=(dat.d2/2) and dat.d2>=0) or (dat.d1>=(dat.d2/2) and dat.d2<0)) or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] then
set Total = Total - 1 // if im already changing his code, i might as well do some optimization
set Ar[i] = Ar[Total]
call dat.destroy()
endif