1 second slow down is massive.
but would never happen, as my post tells
1 second slow down is massive.
function guardian_unitcode takes nothing returns integer
return 'n003' //Rawcode of the 'Guardian Sheep' unit.
endfunction
function guardian_rawcode takes nothing returns integer
return 'A001' //Rawcode of the 'Guardian Sheep' spell
endfunction
function Trig_Rounding_Sheep_Modified_Conditions takes nothing returns boolean
return (GetLearnedSkill() == guardian_rawcode()) And [B]( GetUnitAbilityLevel(GetTriggerUnit(), guardian_rawcode()) == 1 )[/B]
endfunction
function guardian_unitcode takes nothing returns integer
return 'n003' //Rawcode of the 'Guardian Sheep' unit.
endfunction
function guardian_rawcode takes nothing returns integer
return 'A001' //Rawcode of the 'Guardian Sheep' spell
endfunction
function guardian_radius takes nothing returns real
return 100.00 //Radius, which the 'Guardian Sheep' revolves around.
endfunction
function guardian_move takes nothing returns nothing
local timer t = GetExpiredTimer( )
local unit a = GetHandleUnit( t,"a" )
local unit b = GetHandleUnit( t,"b" )
local integer h = GetUnitAbilityLevel( a, guardian_rawcode( ) )
local real x = GetUnitX( a )
local real y = GetUnitY( a )
local real c = I2R( GetUnitUserData(b) )
local real x2 = ( x + guardian_radius( ) * Cos(c * bj_DEGTORAD) )
local real y2 = ( y + guardian_radius( ) * Sin(c * bj_DEGTORAD) )
call SetUnitPosition( b, x2, y2 )
call SetUnitFacingToFaceUnitTimed( b, a, 0 )
call SetUnitUserData( b, (GetUnitUserData(b) + 2) )
call UnitAddAbility( b, udg_SheepAbility[h] )
[B] call DestroyTimer ( t )[/B]
set a = null
set b = null
set t = null
endfunction
function Trig_Rounding_Sheep_Modified_Conditions takes nothing returns boolean
return ( GetLearnedSkill( ) == guardian_rawcode() ) and ( GetUnitAbilityLevel( GetTriggerUnit( ), guardian_rawcode( ) ) == 1 )
endfunction
function Trig_Rounding_Sheep_Modified_Actions takes nothing returns nothing
local unit a = GetTriggerUnit( )
local unit b = CreateUnit( GetOwningPlayer(a), guardian_unitcode( ), GetUnitX(a), GetUnitY(a), 0 )
local timer t = CreateTimer( )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "a",H2I(a) )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "b",H2I(b) )
call TimerStart( t, 0.03, true, guardian_move() )
call DestroyTimer ( t )
set a = null
set b = null
set t = null
endfunction
//===========================================================================
function InitTrig_Rounding_Sheep_Modified takes nothing returns nothing
local integer h = 0
set gg_trg_Rounding_Sheep_Modified = CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent( gg_trg_Rounding_Sheep_Modified, Player(h), EVENT_PLAYER_HERO_SKILL, null )
set h = h + 1
exitwhen h == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( gg_trg_Rounding_Sheep_Modified, Condition( function Trig_Rounding_Sheep_Modified_Conditions ) )
call TriggerAddAction( gg_trg_Rounding_Sheep_Modified, function Trig_Rounding_Sheep_Modified_Actions )
endfunction
Nice, it got worse. Warcraft crashed.
EDIT:
The trigger is supposed to make the unit 'b' revolve around the unit 'a'.
function Trig_Rounding_Sheep_Modified_Actions takes nothing returns nothing
local unit a = GetTriggerUnit( )
local unit b = CreateUnit( GetOwningPlayer(a), guardian_unitcode( ), GetUnitX(a), GetUnitY(a), 0 )
local timer t = CreateTimer( )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "a",H2I(a) )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "b",H2I(b) )
call TimerStart( t, 0.03, true, guardian_move() )
[B] set a = null[/B]
set b = null
set t = null
endfunction
Does not help. Still get the void thing. After I remove both of the DestroyTimer() functions I get a void action there.
Code:function Trig_Rounding_Sheep_Modified_Actions takes nothing returns nothing local unit a = GetTriggerUnit( ) local unit b = CreateUnit( GetOwningPlayer(a), guardian_unitcode( ), GetUnitX(a), GetUnitY(a), 0 ) local timer t = CreateTimer( ) call StoreInteger( LocalVars( ), I2S( H2I(t) ), "a",H2I(a) ) call StoreInteger( LocalVars( ), I2S( H2I(t) ), "b",H2I(b) ) call TimerStart( t, 0.03, true, guardian_move() ) [B] set a = null[/B] set b = null set t = null endfunction
If I remove 'set a = null', the I get a void action on the 'set b = null' line. And ect.
function Trig_Rounding_Sheep_Modified_Actions takes nothing returns nothing
local unit a = GetTriggerUnit( )
local unit b = CreateUnit( GetOwningPlayer(a), guardian_unitcode( ), GetUnitX(a), GetUnitY(a), 0 )
local timer t = CreateTimer( )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "a",H2I(a) )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "b",H2I(b) )
[B]
call TimerStart(t, 0.03, true, guardian_move)[/B]
call DestroyTimer(t)
set a = null
set b = null
endfunction
function guardian_unitcode takes nothing returns integer
return 'n003' //Rawcode of the 'Guardian Sheep' unit.
endfunction
function guardian_rawcode takes nothing returns integer
return 'A001' //Rawcode of the 'Guardian Sheep' spell
endfunction
function guardian_radius takes nothing returns real
return 100.00 //Radius, which the 'Guardian Sheep' revolves around.
endfunction
function guardian_move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit a = GetHandleUnit( t,"a" )
local unit b = GetHandleUnit( t,"b" )
local integer h = GetUnitAbilityLevel( a, guardian_rawcode( ) )
local real x = GetUnitX( a )
local real y = GetUnitY( a )
[B] local real c = I2R( GetUnitUserData(b) )
local real x2 = ( x + guardian_radius( ) * Cos(c * bj_DEGTORAD) )
local real y2 = ( y + guardian_radius( ) * Sin(c * bj_DEGTORAD) )
call SetUnitPosition( b, x2, y2 ) [/B]
call SetUnitFacingToFaceUnitTimed( b, a, 0 )
call SetUnitUserData( b, (GetUnitUserData(b) + 2) )
call UnitAddAbility( b, udg_SheepAbility[h] )
call DestroyTimer(t)
set a = null
set b = null
endfunction
function Trig_Rounding_Sheep_Modified_Conditions takes nothing returns boolean
return ( GetLearnedSkill( ) == guardian_rawcode() ) and ( GetUnitAbilityLevel( GetTriggerUnit( ), guardian_rawcode( ) ) == 1 )
endfunction
function Trig_Rounding_Sheep_Modified_Actions takes nothing returns nothing
local unit a = GetTriggerUnit( )
local unit b = CreateUnit( GetOwningPlayer(a), guardian_unitcode( ), GetUnitX(a), GetUnitY(a), 0 )
local timer t = CreateTimer( )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "a",H2I(a) )
call StoreInteger( LocalVars( ), I2S( H2I(t) ), "b",H2I(b) )
call TimerStart(t, 0.03, true, function guardian_move)
call DestroyTimer(t)
set a = null
set b = null
endfunction
//===========================================================================
function InitTrig_Rounding_Sheep_Modified takes nothing returns nothing
local integer h = 0
set gg_trg_Rounding_Sheep_Modified = CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent( gg_trg_Rounding_Sheep_Modified, Player(h), EVENT_PLAYER_HERO_SKILL, null )
set h = h + 1
exitwhen h == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( gg_trg_Rounding_Sheep_Modified, Condition( function Trig_Rounding_Sheep_Modified_Conditions ) )
call TriggerAddAction( gg_trg_Rounding_Sheep_Modified, function Trig_Rounding_Sheep_Modified_Actions )
endfunction
local real c = I2R( GetUnitUserData(b) )
local real c = GetUnitFacing(b)
local real x2=(x+guardian_radius()*Cos(c*3.14159/180.00) )
local real y2=(y+guardian_radius()*Sin(c*3.14159/180.00) )
native AddSpecialEffectTarget takes string modelName, widget targetWidget, string attachPointName returns effect
local effect e = AddSpecialEffectTarget("Abilities\Spells\Human\Polymorph\PolyMorphFallingSheepArt.mdl", a, "origin")
function Effect_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local effect e = AddSpecialEffectTarget("Abilities\Spells\Undead\VampiricAura\VampiricAura.mdl", a, "origin")
...
...
endfunction
function Effect_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local effect e = AddSpecialEffectTarget("Abilities\Spells\Undead\VampiricAura\VampiricAura.mdl", a, "origin")
function Effect_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local effect e = AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAura.mdl", a, "origin")