• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] No event

Status
Not open for further replies.
Level 20
Joined
Apr 14, 2012
Messages
2,901
If a trigger doesn't have event in the trigger window, it doesn't necessarily mean it has no event - the event for that trigger may be add in another trigger via Trigger - Add new event action.


What the..? If a trigger does not have an event in the trigger window, then it really has no event at all unless you add in another trigger using the Add New Event.

Like in JASS:
JASS:
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction

See there are only actions. No events.
 
Level 17
Joined
Jul 17, 2011
Messages
1,863
events in jass register an event only to one function although it is possible to register the same event to multiple functions
it the case of converting gui written events to jass the events are written in a function that runs on map initialization, in other words a function that does not require events in order to execute its actions, so when this function runs it registers the events to the specific function in the event native or bj 's argument
JASS:
 call TriggerRegisterGameStateEventTimeOfDay( function_name, EQUAL, 12 )
    call TriggerRegisterGameLoadedEventBJ( function_name )
    call TriggerRegisterGameEvent( function_name, EVENT_GAME_TOURNAMENT_FINISH_NOW )

the name of the function that will run when the event happens is "function_name" so if time of day becomes equal to 12, function_name will execute all actions in it.

map init event should not be required if you are initializing anything in a function that does not require an event
 
Status
Not open for further replies.
Top