mylemonblue
You can change this now in User CP.
- Reaction score
- 7
Title says it all. Using the search function, I found several knockback systems/abilities, but most of them were designed for a single unit. I found this:
http://www.thehelper.net/forums/showthread.php?t=123389&highlight=knockback
And downloaded it. Testing it, the War Stomp triggered spell works like I was hoping it would, but after 3 or 4 casts, the game slows to an unplayable crawl. While testing it, NewGen throws up tons of lines saying
"Attempt to destroy struct of type Knockback_Knock"
I did not want to post this in the original thread(s) because they were over a year old so I'm asking it here. What would I have to change to keep it from slowing down so badly?
(This is not including the four library triggers needed to have it work, which were included in the demo map)
http://www.thehelper.net/forums/showthread.php?t=123389&highlight=knockback
And downloaded it. Testing it, the War Stomp triggered spell works like I was hoping it would, but after 3 or 4 casts, the game slows to an unplayable crawl. While testing it, NewGen throws up tons of lines saying
"Attempt to destroy struct of type Knockback_Knock"
I did not want to post this in the original thread(s) because they were over a year old so I'm asking it here. What would I have to change to keep it from slowing down so badly?
JASS:
scope Warstomp initializer Init
globals
private constant integer SPELL = 039;Awrg039;
private boolexpr b
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELL
endfunction
private function Check takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)
endfunction
private function Actions takes nothing returns nothing
local unit t
local real ux
local real uy
local real angle
local unit source = GetTriggerUnit()
local group g = CreateGroup()
local real x = GetUnitX(source)
local real y = GetUnitY(source)
call GroupEnumUnitsInRange(g,x,y,600,b)
loop
set t = FirstOfGroup(g)
exitwhen t == null
set ux = GetUnitX(t)
set uy = GetUnitY(t)
set angle = Atan2(uy-y,ux-x)
call KnockbackTargetEx(source,t,angle,600,20,0,0,0,true,false,false,true,false,false)
call GroupRemoveUnit(g,t)
endloop
set source = null
set t = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Conditions ) )
call TriggerAddAction( t, function Actions )
set b = Condition(function Check)
endfunction
endscope
(This is not including the four library triggers needed to have it work, which were included in the demo map)