HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Event001, RunFunc001 and Event002, RunFunc002?

11-21-2007, 04:44 PM#1
Pinzu
Just showing how noob I am, but can I do some thing like this in the same trigger.

Event001, RunFunc001 and Event002, RunFunc002?

some thing simuar show example plz...
11-21-2007, 05:31 PM#2
Pinzu
some sort of condition checking what event it registrated...
11-21-2007, 10:38 PM#3
Deaod
Hope this helps you:

Of course you can create different triggers in a single trigger window.

Collapse Example:
// First Trigger

function Trig_blahbla_Actions takes nothing returns nothing
//do some stuff here
endfunction

function InitTrig_blahbla takes nothing returns nothing
local trigger trig = CreateTrigger()
    // Register some Event
    call TriggerAddAction(trig, function Trig_blahbla_Actions)
endfunction

// Second Trigger

function Trig_blabla_Actions takes nothing returns nothing
//do some stuff here
endfunction

function InitTrig_blabla takes nothing returns nothing
local trigger trig = CreateTrigger()
    // Register some Event
    call TriggerAddAction(trig, function Trig_blabla_Actions)
endfunction

// Dummy Trigger

function Trig_Dummy_Actions takes nothing returns nothing
    call ExecuteFunc("InitTrig_blahbla")// Here were calling the init triggers of other triggers,
    call ExecuteFunc("InitTrig_blabla")// which register new events and execute code correspondingly.
endfunction
function InitTrig_Dummy takes nothing returns nothing
local trigger trig = CreateTrigger()
    call TriggerAddAction(trig, function Trig_Dummy_Actions)
endfunction

Note: For this to work correctly you have to name the init trigger after the name of the trigger in the trigger editor. You also have to mark that trigger to run on mapinit to prevent some incompatibilities or lags.
11-21-2007, 11:21 PM#4
midiway
I think it is exactly what you want

GetTriggerEventId( )==EVENT_UNIT_DAMAGED

It allow you make conditions comparing the event that triggered