HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

jass compile error

04-28-2007, 04:35 AM#1
TheXenocide
I keep getting an "expecting function call" error for this call:

Code:
Dark Ritual
    Events
    Conditions
    Actions
        Advanced - For Stack_castingunit[Stack_numberSpells] Increase mana maximum by 150
        Unit - Set mana of Stack_castingunit[Stack_numberSpells] to ((Max mana of Stack_castingunit[Stack_numberSpells]) + 150.00)
        Custom script: call Trig_Dark_Ritual_Undo_Actions()
Code:
function Trig_Dark_Ritual_Undo_Actions takes nothing returns nothing
    local unit u = udg_Stack_castingunit[udg_Stack_numberSpells]
    call PolledWait( 30.00 )
    call ChangeMana( u, false, 150 )
    call SetUnitManaBJ( u, ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, u) - 150.00 ) )
endfunction

//===========================================================================
function InitTrig_Dark_Ritual_Undo takes nothing returns nothing
    set gg_trg_Dark_Ritual_Undo = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Dark_Ritual_Undo, function Trig_Dark_Ritual_Undo_Actions )
endfunction
I have tried to combine the two functions together since they do not need to be separated, but when I do that I get an "expected code" error for the unit declaration:
Code:
local unit u = udg_Stack_castingunit[udg_Stack_numberSpells]
I am new to jass, any help would be appreciated. Thanks.
04-28-2007, 03:22 PM#2
Vexorian
"Expected code"? Do you have WEU's advanced triggers installed in the map? Also, use http://www.wc3campaigns.net/misc.php?do=bbcode#jass and http://www.wc3campaigns.net/misc.php?do=bbcode#trigger tags next time
04-30-2007, 01:25 AM#3
Pyrogasm
Function A can call Function B, but only if B is above A in the map script. If your "Dark Ritual Undo" trigger is below "Dark Ritual" in the list of triggers, you will get an error.
04-30-2007, 11:28 AM#4
SFilip
Considering it's already a part of another trigger it might be easier to do
call TriggerExecute(gg_trg_Dark_Ritual_Undo)