- Joined
- Feb 15, 2009
- Messages
- 463
hey guys im trying to create a spiral spell which goes outside-in in begin it moves correctly inside and furthermore.. but the last thingies are never at the center but still about 200 range away also in myopinion the value Polar Project +0 comes out so it should be the center but it isnt
The rest is not interesting i hope you can figure out the problem in my formula i tried it now for about 2 hours and i am to idiotic
i created spiral spells before and they were correct but here i have probs
also feel free to comment the rest concerning efficiency , performance etc....
Saia_Djinn
+Rep for every answer that helps for sure
JASS:
globals
////////////////////////////////////////CONFIGURATION////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private constant integer SPELL_ID = 'A000'
//The Id of the Spell used by your Hero
private constant integer MAX_EFFECT = 100
//How many Effects are created
private constant real START_DISTANCE = 600.
//How far from the caster the 1st Effect is created
private constant real ANGLE_DECREMENT = 10.
//How much the next Angle differs from the previous one
private constant real START_HEIGHT = 600.
//In which Height the 1st Effect is created
private constant real HEIGHT_DECREMENT = 10.
//How much Height is lost per Intervall?
private constant real TIMER_INTERVALL = 0.03
private constant string SHADOW_FX = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"
//The Model of every Spiraleffect
////////////////////////////////////////////////END///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
endglobals
JASS:
private function Callback takes nothing returns nothing
local Spiral e = GetTimerData(GetExpiredTimer())
local location l
if e.counter > MAX_EFFECT then
call ReleaseTimer(GetExpiredTimer())
set e.counter = 0
call e.destroy()
else
set e.angle = (360. - ANGLE_DECREMENT) * bj_DEGTORAD * e.counter
set e.cos = Cos(e.angle)
set e.sin = Sin(e.angle)
set e.x = e.sx + (START_DISTANCE - (RANGE_DECREMENT * e.counter)) * e.cos
set e.y = e.sy + (START_DISTANCE - (RANGE_DECREMENT * e.counter)) * e.sin
set e.faceangle = Atan2( e.sy - e.y , e.sx - e.x)
set l = Location(e.x , e.y)
set e.z = GetLocationZ(l) + (START_HEIGHT - HEIGHT_DECREMENT * e.counter)
set e.shadow[e.counter] = xefx.create( e.x , e.y , e.faceangle )
set e.shadow[e.counter].fxpath = SHADOW_FX
set e.shadow[e.counter].z = e.z
call RemoveLocation(l)
set l = null
set e.counter = e.counter + 1
endif
endfunction
JASS:
private function Conditions takes nothing returns boolean
local unit u
local timer t
local Spiral sp
if GetSpellAbilityId() == SPELL_ID then
set u = GetSpellAbilityUnit()
set t = NewTimer()
set sp = Spiral.create()
set sp.sx = GetUnitX(u)
set sp.sy = GetUnitY(u)
//set sp.x = sp.sx + START_DISTANCE
//set sp.y = sp.sy + START_DISTANCE
call SetTimerData( t , sp)
call TimerStart(t , TIMER_INTERVALL , true , function Callback)
endif
return false
endfunction
The rest is not interesting i hope you can figure out the problem in my formula i tried it now for about 2 hours and i am to idiotic
i created spiral spells before and they were correct but here i have probs
also feel free to comment the rest concerning efficiency , performance etc....
Saia_Djinn
+Rep for every answer that helps for sure