| 10-25-2004, 10:55 AM | #1 |
Hi, i am still a JASS noob trying to feel my way through this language, my question is this i want to imbed a native function inside of another function: call ForGroupBJ(G, call UnitDamageTargetBJ(udg_Fistandantilus, GetEnumUnit(), 3, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL)) when i put in that line it says expected an expression statement. G = my unit group Fistandantilus = my hero does anyone know what i am doing wrong? |
| 10-25-2004, 01:14 PM | #2 |
You can't directly put code there, it has to be a function. So put that code in a separate function and state function your_new_func_name in the ForGroup |
| 10-26-2004, 08:41 AM | #3 |
Guest | ...yes, it sucks. A workaround if you don't know what the argument will be in advance is store the argument in a game cache or sth, and have that function always look for the parameters before doing anything else. That means modifying all functions that you want to use that way, tho... :-\ |
| 10-26-2004, 04:00 PM | #4 |
hi again, itried taking your advise and ran into a snag: Code:
function Trig_Blood_Gout_Action_Func1 takes integer LifeGain returns nothing
call UnitDamageTargetBJ( udg_Fistandantilus, GetEnumUnit(), LifeGain, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL)
endfunction
function Trig_Blood_Gout_Action_Actions takes integer SpellRange, integer LifeGain returns nothing
local filterfunc F = Filter(function FilterDeadAndAllies)
local group G = GetUnitsInRangeOfLocMatching(SpellRange, GetUnitLoc(udg_Fistandantilus),F)
call DestroyFilter(F)
call ForGroupBJ(G, function Trig_Blood_Gout_Action_Func1(LifeGain))
call ForGroupBJ(G, function AttachEffects)
call SetUnitLifeBJ( udg_Fistandantilus, ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_Fistandantilus) + ( LifeGain * I2R(CountUnitsInGroup(G)) ) ) )
call PolledWait( 1.00 )
//Cleanup local group
call DestroyGroup(G)
set G = null
endfunction
//===========================================================================
function InitTrig_Blood_Gout_Action takes nothing returns nothing
set gg_trg_Blood_Gout_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_Blood_Gout_Action, function Trig_Blood_Gout_Action_Actions )
endfunction
i am still not sure what i am doing wrong it tells me it expected ' on this line: call ForGroupBJ(G, function Trig_Blood_Gout_Action_Func1(LifeGain)) any help? |
| 10-26-2004, 06:43 PM | #5 |
Parameters do not work for these functions. You have to use globals to pass that info. |
