- Joined
- Aug 7, 2013
- Messages
- 1,337
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)
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: