Karmakeld wrote:Awsome and yet simple. I found a similar (a special thanks goes to Maciek for letting me know how often I had misspelled this word) script in Tawny's campaign where you continue to increase a hero's level untill the desired level is reached. I could have definitely used your script in one of my maps, but perhaps it could still come in handy.
I actually use a script just like that to increase hero levels in the first map of my Reckoning campaign
![smile_teeth :D](/forums/images/smilies/smile_teeth.gif)
I couldn't figure out how to set a heroe's level past 40, so I used a recursive script to increase to the desired level for 2 heroes. The interesting part was one of them is player controlled, so I had to have the hero be a different color, increase the level, and then change him back.
Maciek wrote:@iLiVeInAbOx05The number 4096 was chosen arbitrarily. Could just as well be 1 billion.
Now, imagine it's not elves you want to take, but every creature type the hero might've acquired. That's where it gets annoying.
And not half, but a percentage based on the hero's Diplomacy skill (though that doesn't complicate things too much).
Recursion would probably be good enough for the number of creatures, but you still need the script for every possible creature.
This example comes from map 5 of Karmakeld's campaign.
Btw, recursion should work if the scripts are on a hero, but not in placed events (nowhere to put the custom event).
Well, I'd rather script my 4ish lines for each one instead of that big string of ifs
![smile_teeth :D](/forums/images/smilies/smile_teeth.gif)
It's much easier to just script those few lines for each type of creature, but I agree, it's still annoying to have to do so. It would have been great if we could explicitly construct methods with parameters for scripts.
As far as the recursive method working on creature only armies, I thought I was onto something using a quest gate, but it only has one triggered script >.< I was also thinking of using a garrison, but it looks like you can only affect the creatures in the garrison with the triggered scripts
Karmakeld wrote:Iliveinabox You script could have made some things easier for me in my 4th map, luckily for me, Maciek did the hard work in my 5th map as he described, but I can only agree that when it comes to cases where you wanna check for multiple options, like take an amount of any creature type, or check skill level of any skill type, you're forced to do heavy amount of scripting.
Some copy function would have been useful.
Definitely agree with needing the ability to write functions which take parameters. You can kind of do this a little bit, but not enough for it to really be powerful and enable reuse of code
![sad :(](/forums/images/smilies/sad.gif)