so i'm trying to do a simple MUI knockback trigger in JASS using an old fashion GUI method.
I don't want extreme precision like sin, cos, x, y etc i just want to get it done so i came up with this code
i'm aware that this loop does the actions in a crazy short amount of time and looks like the unit just instantly moves to the endpoint without sliding ><, so is there a way to make this work as a good sliding trigger without any crazy coding which i am not aware since this is my very first code in jass?
or is it MUI at all?
I don't want extreme precision like sin, cos, x, y etc i just want to get it done so i came up with this code
JASS:
function slide_Actions takes nothing returns nothing
local unit caster=GetSpellAbilityUnit()
local location point1
local location point2
local integer time=40
local real speed = 5
loop
set point1=GetUnitLoc(caster)
set point2=PolarProjectionBJ(point1, speed, GetUnitFacing(caster))
call SetUnitPositionLoc(caster, point2)
set time=time-1
call RemoveLocation(point1)
call RemoveLocation(point2)
exitwhen time==0
endloop
set caster=null
set point1=null
set point2=null
endfunction
//===========================================================================
function InitTrig_slide takes nothing returns nothing
set gg_trg_slide = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_slide, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_slide, function slide_Actions )
endfunction
i'm aware that this loop does the actions in a crazy short amount of time and looks like the unit just instantly moves to the endpoint without sliding ><, so is there a way to make this work as a good sliding trigger without any crazy coding which i am not aware since this is my very first code in jass?
or is it MUI at all?