I was trying to simplify one of my problems, the timer call back with 0 expiraton time.
I've made a trigger that uses it, but one of the textmacros won't go in the trigger :S
The Textmacro setup:
And the usage in a trigger:
My problem is, that jasshelper says the Callback_Runes function is undeclared, but there is the textmacro that adds it there :S:S
I've made a trigger that uses it, but one of the textmacros won't go in the trigger :S
The Textmacro setup:
JASS:
globals
timer TIMER_MACRO = CreateTimer()
endglobals
//! textmacro Globals takes name, global, realx, realy
globals
$global$_$name$
$realx$_$name$
$realy$_$name$
endglobals
//! endtextmacro
//! textmacro Callback takes name, load
function Callback_$name$ takes nothing returns nothing
$load$
endfunction
//! endtextmacro
//! textmacro Timer takes name, saveglobal,saverealx,saverealy
$saveglobal$
$saverealx$
$saverealy$
call TimerStart(TIMER_MACRO,0,false,function Callback_$name$)
//! endtextmacro
And the usage in a trigger:
JASS:
//! runtextmacro Globals( "Runes", "item Item", "real X", "real Y" )
//! runtextamcro Callback( "Runes", "call CreateItem( GetItemTypeId(Item_Runes), X_Runes, Y_Runes))" )
function Trig_Runes_Actions takes nothing returns nothing
if GetItemTypeId(GetManipulatedItem()) == 039;I000039; then
call ResetCooldownAll( GetTriggerUnit() )
//! runtextmacro Timer( "Runes","set Item_Runes = GetManipulatedItem()","set X_Runes = GetItemX(Item_Runes)","set Y_Runes = GetItemY(Item_Runes)" )
endif
endfunction
//===========================================================================
function InitTrig_Runes takes nothing returns nothing
set gg_trg_Runes = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Runes, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_Runes, function Trig_Runes_Actions )
endfunction
My problem is, that jasshelper says the Callback_Runes function is undeclared, but there is the textmacro that adds it there :S:S