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

Textmacro parameters

Status
Not open for further replies.
Level 5
Joined
Oct 24, 2007
Messages
90
Hello, just wondering about something recently. I am developing a spell in which dummies are spawned for it in the form of lightning orbs... and I use textmacros for it. Is there a way to set parameters to variables? I want people to choose how many dummies are spawned from the constant global block. Here's an example:

JASS:
//! textmacro create takes INTEGER
    set this.Dummy$INTEGER$ = CreateUnit(bla bla)
//! endtextmacro

function SomeFunction takes nothing returns nothing
    local string S = "1"
    local integer I = 1
    //! runtextmacro create(I)  [Is there a way to make this work?]
    //! runtextmacro create(S)  [Or is it done this way?]
    //Or is it even possible? D:
endfunction

I use textmacro method instead of loops since struct members cannot be arrays (they can't... can they?). Thank you.
 
Status
Not open for further replies.
Top