• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Lua object generation text macro

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,342
Hi,

Edit: nevermind, I just wrote a function for this. Silly question to ask!

I found this tutorial but could not answer my question: http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/lua-object-generation-191740/#V

Suppose I've got an ability with 10 levels, each with increasing damage. But there is no formula for getting Damage given a level (suppose it's arbitrary), so I use a constant for each level, e.g.

ABIL_LVL_1 = "50.0" (damage)
ABIL_LVL_2 = "73.0" (damage)
etc.

Now I want to run a text macro to fill these fields in for my ability--how do I write this?,

i.e. I just want a two liner like this:
*****

string/function target = "makechange(current, "xxxx", ABIL_LVL_$N$)"
myTextMacro(target, 5)

*****

outputs:

makechange(current, "xxxx", ABIL_LVL_1)
makechange(current, "xxxx", ABIL_LVL_2)
makechange(current, "xxxx", ABIL_LVL_3)
makechange(current, "xxxx", ABIL_LVL_4)
makechange(current, "xxxx", ABIL_LVL_5)
 
Last edited:
Status
Not open for further replies.
Top