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

Some LUA help needed: Batch-create abilities

Status
Not open for further replies.
I've never worked with LUA before except for very simple one-liner creation of abilities through object merger.

But now I have a rather complicated task that I don't know how to code in LUA:

I have 30 hero abilities with 5 levels each. I want to split the individual levels up into seperate 1 level abilities. Since that equals a total of 150 abilities, I'm looking for a LUA script that does that automaticly.

Now, why not just create a simple LUA loop to spamcreate the 150 abilities? The problem is:
1) I need to copy the description data from the old abilities
2) I need to extract substrings from said description data to get what the individual levels do

So, for example, the description looks like this:
"Level1: TEXT1|nLevel2: TEXT2|nLevel3: TEXT3"

I need to extract only TEXT1 for ability number 1, only TEXT2 for ability number 2, etc.


Can someone help me please on doing this? I know how string concatenation works in LUA, but I don't know how to get a substring from a data field.
 
Status
Not open for further replies.
Top