• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Disabling Breath Weapons

AndrewD2

Well-known member
I've running script on a template that gets rid of some natural attacks and breath weapons (and any other mouth based specials) and I made a large foreach loop to get through the ~40 breath weapons in the editor. The problem is it seems my loop is crashing Hero Lab so I'm looking for suggestions to make it not crash.

Post-Levels/10000
Code:
var tentacles as number
var tentstr as string

foreach pick in hero from BaseNatWep where "thingid.wBite|thingid.wGore|thingid.wHeadButt"
   perform eachpick.assign[Hide.Weapon]
   tentacles += 1
nexteach

~foreach pick in hero from Ability where "thingid.raBraBreaW|thingid.raBreaWeap|thingid.raBreath|thingid.raCaiBreaW|thingid.raCalBreaW|thingid.raChiBreaW|thingid.raCloBreaW|thingid.raCraBreaW|thingid.raDraBreaW|thingid.raFaeBreaW|thingid.raFafBreaW|thingid.raFjoBreaW|thingid.raGorBreaW|thingid.raIceBreaW|thingid.raIroBreaW|thingid.raJyoBreaW|thingid.raKhaBrea|thingid.raRPDraBre|thingid.raRavBret|thingid.raSpiBreaW|thingid.raTaiBreaW|thingid.raTarBreaW|thingid.raTorBreaW|thingid.raUmbBreaW|thingid.raVemBreaW|thingid.raWyBreath|thingid.xAirMeBrth|thingid.xDustMeBrth|thingid.xEarMeBrth|thingid.xFirMeBrth|thingid.xHDBreath|thingid.xlcMeBrth|thingid.xOozMeBrth|thingid.xSalMeBrth|thingid.xSteMeBrth|thingid.xWatMeBrth"

~   perform eachpick.assign[Helper.SpcDisable]
~   perform eachpick.assign[Helper.SpcReplace]
~   tentacles += 1
~nexteach

   tentacles += hero.child[wTentacle].tagvalue[Value.?]
   tentstr = "Value." & tentacles
   perform hero.child[wTentacle].delete[Value.?]
   perform hero.child[wTentacle].assignstr[tentstr]
 
Guess its simpler than I thought, is there a suggested number of items that should be the limit in a foreach loop?
 
Back
Top