Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 23rd, 2014, 09:42 AM
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]
AndrewD2 is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old January 23rd, 2014, 09:57 AM
Multiple foreaches, each handling some of them.
Mathias is online now   #2 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 23rd, 2014, 10:08 AM
Guess its simpler than I thought, is there a suggested number of items that should be the limit in a foreach loop?
AndrewD2 is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old January 23rd, 2014, 10:20 AM
Sorry, I'm not sure what the limit actually is.
Mathias is online now   #4 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 23rd, 2014, 10:23 AM
Ok, I'll just play around with it.
AndrewD2 is offline   #5 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old January 23rd, 2014, 10:51 AM
Looks like the answer is about 7 to 8
AndrewD2 is offline   #6 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:20 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.