Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,236
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.
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.