- Joined
- Feb 13, 2019
- Messages
- 128
So you can convert GUI triggers to JASS, but I want to say I read somewhere the way they are written are inefficient and leak?
I may be misremembering but I guess my main question is this the standard way to go about triggering in JASS
Could/Should I just start using JASS for my triggers and typing them, what's a good way to word this, ummm, in this format? I mean I think so right? they're just functions going off? The trigger is being created and named via function InitTrig_JASS_Test takes nothing returns nothing set gg_trg_JASS_Test = CreateTrigger( ), ? (Am I setting some type of variable? Set = is generally for setting variables I thought? )
this is where I get a bit confused, call TriggerRegisterAnyUnitEventBJ( gg_trg_JASS_Test, EVENT_PLAYER_UNIT_DEATH ) so it's "calling" a native(?) command in JASS that is when any unit dies, but what is a call? it you could say it's saying "hey do this?" and it looks for any unit to die? is it just always running? Why don't I need like an event checking every second to see if something died?
and these are also "called",? and told to use the actions as well via
call TriggerAddAction( gg_trg_JASS_Test, function Trig_JASS_Test_Actions )
endfunction and it's actions (the function called?) is up top as
Which says hey, if this, then do this?
Sorry if this is a dumb question, I'm reading JASS tutorials as well, I just feel as if I learn better bouncing ideas off someone, and asking dumb questions, and just going in and learning by doing.
Should I write every trigger in JASS? Is GUI a lost cause or is it best to use both?
Could I start writing triggers or trigger like events in JASS like this?
I may be misremembering but I guess my main question is this the standard way to go about triggering in JASS
-
Trigger Test
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
((Triggering unit) is A Hero) Equal to True
-
-
Actions
-
Game - Display to (All players) the text: ripirino
-
-
JASS:
function Trig_JASS_Test_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_JASS_Test_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "ripirino" )
endfunction
//===========================================================================
function InitTrig_JASS_Test takes nothing returns nothing
set gg_trg_JASS_Test = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_JASS_Test, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_JASS_Test, Condition( function Trig_JASS_Test_Conditions ) )
call TriggerAddAction( gg_trg_JASS_Test, function Trig_JASS_Test_Actions )
endfunction
Could/Should I just start using JASS for my triggers and typing them, what's a good way to word this, ummm, in this format? I mean I think so right? they're just functions going off? The trigger is being created and named via function InitTrig_JASS_Test takes nothing returns nothing set gg_trg_JASS_Test = CreateTrigger( ), ? (Am I setting some type of variable? Set = is generally for setting variables I thought? )
this is where I get a bit confused, call TriggerRegisterAnyUnitEventBJ( gg_trg_JASS_Test, EVENT_PLAYER_UNIT_DEATH ) so it's "calling" a native(?) command in JASS that is when any unit dies, but what is a call? it you could say it's saying "hey do this?" and it looks for any unit to die? is it just always running? Why don't I need like an event checking every second to see if something died?
and these are also "called",? and told to use the actions as well via
call TriggerAddAction( gg_trg_JASS_Test, function Trig_JASS_Test_Actions )
endfunction and it's actions (the function called?) is up top as
JASS:
function Trig_JASS_Test_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_JASS_Test_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "ripirino" )
endfunction
Which says hey, if this, then do this?
JASS:
function Trig_XXXXXX_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_XXXXXX takes nothing returns nothing
set gg_trg_XXXXXX = CreateTrigger( )
call TriggerAddAction( gg_trg_XXXXXX, function Trig_XXXXXX_Actions )
endfunction
Sorry if this is a dumb question, I'm reading JASS tutorials as well, I just feel as if I learn better bouncing ideas off someone, and asking dumb questions, and just going in and learning by doing.
Should I write every trigger in JASS? Is GUI a lost cause or is it best to use both?
Could I start writing triggers or trigger like events in JASS like this?