- Joined
- Jun 16, 2008
- Messages
- 1,939
Hi! I just started to learn JASS because it seems much more smart to me. So i am reading this JASS: Moving From GUI to Jass, the Start - The Helper Forums.
(tutorial)
It is not very easy to comrehend.
As a result i decided to ask the community some questions to different questions i have when i read the tutorial...
Here is my first question:
I convert this trigger into JASS:
result:
we have 3 functions there... i just want to know exactly and comprehensable what each function stands for and what they do.
thx very much
(tutorial)
It is not very easy to comrehend.
As a result i decided to ask the community some questions to different questions i have when i read the tutorial...
Here is my first question:
I convert this trigger into JASS:
-
KillUnit
-
Events
- Unit - A unit is being attacked
-
Conditions
- (Unit-type of (Triggering unit)) equal to Soldier
-
Actions
- Unit - Explode (Triggering unit)
-
Events
result:
JASS:
function Trig_KillUnit_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
return false
endif
return true
endfunction
function Trig_KillUnit_Actions takes nothing returns nothing
call ExplodeUnitBJ( GetTriggerUnit() )
endfunction
//===========================================================================
function InitTrig_KillUnit takes nothing returns nothing
set gg_trg_KillUnit = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_KillUnit, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_KillUnit, Condition( function Trig_KillUnit_Conditions ) )
call TriggerAddAction( gg_trg_KillUnit, function Trig_KillUnit_Actions )
endfunction
we have 3 functions there... i just want to know exactly and comprehensable what each function stands for and what they do.
thx very much