• 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.

Running trigger from String variable

Status
Not open for further replies.
Level 3
Joined
Oct 6, 2008
Messages
47
Is it possible to run a trigger using a string variable. Eg: String variable 'Round' is equal to Round1. So I can run a trigger named Round1.
 
Level 14
Joined
Nov 23, 2008
Messages
187
There is a function called ExecuteFunc, it takes string as parameter and allows to run specified function. However, there are some bugs (like called function shouldn't take any arguments to it, and function must exist), that can cause game crash.

Example code:

JASS:
function MyTrigger_run takes nothing returns nothing
  call TriggerExecute(gg_trg_MyTrigger)
endfunction

// . . .
call ExecuteFunc("MyTrigger_run")
// . . .
 
Status
Not open for further replies.
Top