Flare
Stops copies me!
- Reaction score
- 662
I'm trying to make my first JASS spell, but for some reason, I'm getting an Undefined function error when I save (it's the only error I have so far).
(Most of the comments can be ignored, they are just for personal reference)
(Most of the comments can be ignored, they are just for personal reference)
JASS:
scope CrimsonFlash
//Alter this to change the speed of the fireballs, how often fireballs spawn, the rawcode of your base ability, and how often the fireballs move
globals
constant integer spellid = 039;A000039;
constant real distance = 30
constant real slideperiod = 0.04
constant real spawnperiod = 0.25
constant real angleincrease = 35
constant real initangle = GetRandomReal (1, 360)
endglobals
//Data used to create fireballs and set their facing angle
struct Firespawn
unit fireowner
real spawnrate //This will increase with level, when the spell works in the first place
endstruct
//Data used to move the fireballs, and determine when they expire
struct Firemovement
unit fireunit //The dummy fireball unit
real x1
real x2
real y1
real y2
real anglerad
real angledeg
integer ticks
endstruct
//Spell conditions
function Spell_Conditions takes nothing returns boolean
return GetSpellAbilityId () == spellid
endfunction
//Spell actions
function Spell_Actions takes nothing returns nothing
local real angle
local timer t1 = CreateTimer ()
local Firespawn data = Firespawn.create ()
call SetTimerStructA (t1, data)
set data.fireowner = GetTriggerUnit ()
call TimerStart (t1, spawnperiod, true, function Timer1Actions) //Error saying that function Timer1Actions is undefined
endfunction
function Timer1Actions takes nothing returns nothing
local Firespawn data
local timer t1 = GetExpiredTimer ()
local real spawnangle
set data = GetTimerStructA(t1)
set spawnangle = initangle
set spawnangle = spawnangle + angleincrease
endfunction
//Trigger Init
function InitTrig_Spell takes nothing returns nothing
local trigger Spell = CreateTrigger( )
call TriggerAddAction( gg_trg_Spell, function Spell_Actions )
call TriggerRegisterAnyUnitEventBJ (Spell, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition (Spell, Condition (function Spell_Conditions))
endfunction
endscope