• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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