Carl-Fredrik
New Member
- Reaction score
- 51
Picking Every Unit Matching
Hi everyone!
I'm learning Jass/vJass...
So I'm about to make a trigger that kills the player's Hero when he types "-kill" in my map.
So I made the event... then I converted the GUI Unit Group Actions...
It looks like this:
My first thought was (of course): What a mess!?
So.. do I really need all those functions to check if the unit picked is: Hero, Alive, Under the Player's Control?
I was wondering if there's a better way... thanks in advance!
// Carl-Fredrik
Hi everyone!
I'm learning Jass/vJass...
So I'm about to make a trigger that kills the player's Hero when he types "-kill" in my map.
So I made the event... then I converted the GUI Unit Group Actions...
It looks like this:
JASS:
function Trig_Untitled_Trigger_002_Func001001002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Untitled_Trigger_002_Func001001002002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Untitled_Trigger_002_Func001001002002002 takes nothing returns boolean
return ( GetOwningPlayer(GetFilterUnit()) == GetTriggerPlayer() )
endfunction
function Trig_Untitled_Trigger_002_Func001001002002 takes nothing returns boolean
return GetBooleanAnd( Trig_Untitled_Trigger_002_Func001001002002001(), Trig_Untitled_Trigger_002_Func001001002002002() )
endfunction
function Trig_Untitled_Trigger_002_Func001001002 takes nothing returns boolean
return GetBooleanAnd( Trig_Untitled_Trigger_002_Func001001002001(), Trig_Untitled_Trigger_002_Func001001002002() )
endfunction
function Trig_Untitled_Trigger_002_Func001A takes nothing returns nothing
endfunction
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Untitled_Trigger_002_Func001001002)), function Trig_Untitled_Trigger_002_Func001A )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
set gg_trg_Untitled_Trigger_002 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction
My first thought was (of course): What a mess!?
So.. do I really need all those functions to check if the unit picked is: Hero, Alive, Under the Player's Control?
I was wondering if there's a better way... thanks in advance!
// Carl-Fredrik