- Joined
- Jul 17, 2006
- Messages
- 145
Alright this script here is coming up with an error:
The error is:
Cannot convert real to integer
Once again im using the cache system blah blah
http://forums.dota-allstars.com/index.php?showtopic=92616
Code:
function Rocket_Engines_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04D'
endfunction
function Rocket_Engines_Knockback takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cast = GetAttachedUnit(t, "cast")
local integer steps = GetAttachedInt(t, "steps")
local location curr = GetUnitLoc(cast)
local location dest = PolarProjectionBJ(curr, 25, GetUnitFacing(cast))
call SetUnitPositionLoc(cast, dest)
call RemoveLocation(curr)
call RemoveLocation(dest)
set curr = null
set dest = null
if (steps <= 1) then
call FlushHandle(t)
call DestroyTimer(t)
call FlushHandle(cast)
set cast = null
set t = null
return
endif
set cast = null
call AttachInt( t, "steps", steps - 1 )
set t = null
endfunction
function Rocket_Engines_Actions takes nothing returns nothing
local boolean stopped = true
local timer t = CreateTimer()
local unit cast = GetTriggerUnit()
local integer channeltime = GetAttachedInt(cast, "channeltime")
local integer steps = channeltime/.025
call AttachBoolean(cast, "stopped", stopped)
call AttachInt(t, "steps", steps)
call AttachObject(t, "cast", cast)
call TimerStart(t, .025, true, function Rocket_Engines_Knockback)
set cast = null
set t = null
endfunction
//===========================================================================
function InitTrig_Captian_Germross_Rocket_Engines takes nothing returns nothing
set gg_trg_Captian_Germross_Rocket_Engines = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Captian_Germross_Rocket_Engines, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Captian_Germross_Rocket_Engines, Condition( function Rocket_Engines_Conditions ) )
call TriggerAddAction( gg_trg_Captian_Germross_Rocket_Engines, function Rocket_Engines_Actions )
endfunction
The error is:
Cannot convert real to integer
Code:
call AttachBoolean(cast, "stopped", stopped)
Once again im using the cache system blah blah
http://forums.dota-allstars.com/index.php?showtopic=92616