Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
The first function that gets run by engine ingame is the "main" function, which you normally do not see in standard editor/JNGP. This main function can run other functions such as the init functions of your triggers. To run something, you can either do a direct call with call function(<params>), a more indirect call via a native function like ForGroup(<group>, <code>) or you set up a trigger with an action block and an event (TriggerRegister...) that gets automatically fired by engine.
Take a look through the functions list or if you used GUI before, convert some stuff.
By default, each trigger leaf that you create in editor gets one "InitTrig_<trigName>" function that is registered for being run by the main function in beginning.
Not directly to the functions but trigger handles.
JASS:
function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerAddAction(t, function yourFunction) or TriggerAddCondition(t, Condition(function yourFunction))
call TriggerRegister...(t, ...)
set t = null
Well, i noticed the add action and add condtion can be binded to a function (i think since i cant really read the jass) while the event only be binded to a trigger how do i make the event execute something then? Because i have heard that jass can use multiple events in same trigger so you only need one big trigger for things. if the event you scroll through all functions that wont work
JASS:
call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
The event fires the trigger and the trigger fires the conditions/actions. If multiple events are registered for a trigger, when any of those events occurs, the trigger will be fired.
Stuffing everything in one trigger would not be so smart. You cannot perfectly differentiate which event occured and checking this would take some performance. Accumulating events on one trigger only makes sense when those events should run about the same conditions/actions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.