Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 5th, 2011, 03:57 PM
Is there a way to stop a script from running once it's actually been run? I've tried deleting the Helper.ShowSpec and testing for it, but that doesn't work in this case (it's a Custom Ability). The script always runs, when all I want it to do is run once and stop. A general search of the board hasn't helped much.
Kendall-DM is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 5th, 2011, 05:10 PM
Please elaborate on what you're trying to accomplish here.

Last edited by Mathias; March 5th, 2011 at 05:12 PM.
Mathias is online now   #2 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 5th, 2011, 05:38 PM
I have given the Rogue a choice in its Special Abilities to choose an Extra Skill Point, but the Extra Skill Point works like Intelligence in that it applies to the current level and every level thereafter. So, for example, a Halfling Rogue with a 10 Int gets 8 skill points per level, but at 10th level he takes this ability and gets 9 skill points per level for each level from 10th to 20th. So I've tried two approaches, one is to just add the extra 1 into herofield[tSkTotals].arrayvalue[index] where the index is for Rogue, but that only adds to the current level, or I can add 1 to hero.child[cHelpRog].field[cSkills].value, but it changes ALL the levels of Rogue. So I've determined that I can just subtract out the previous levels extra points, with the cSkills to the new points per level already set for each level afterwards. Unfortunately, every level wants to run the recalculation of the previous levels, and I want it to no longer run that script. Once the points are subtracted out the first time, and the cSkills set to add an extra point, I no longer need the script to run.

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

~ Add an additional skill point per rogue level hereafter.
hero.child[cHelpRog].field[cSkills].value += 1

~ Remove skill points from previous levels in Rogue.
var index as number
var prev as number
index = hero.child[cHelpRog].field[cClsIndex].value
prev = #levelcount[Rogue] + 2
herofield[tSkTotals].arrayvalue[index] -= prev

So, obviously, once this script runs the first time, it continues to run each level to subtract out the previous levels, and I would like it to no longer run the script. I've tried some control statements to ignore the critical section here, but since I don't have a static variable I can set to make sure it paths correctly, it continues to run the script.
Kendall-DM is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 6th, 2011, 12:40 AM
You'll need a selector - the activation amount is the normal one to use for this - to let the user specify what level they took the ability at. Then have the ability figure out what it should actually grant based on that level.
Mathias is online now   #4 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 6th, 2011, 05:24 AM
Once you have that level, you can do a foreach that looks at the Class levels (not the Class Helper) and compares the value of their Index field to the level it was taken at. If it is equal or above, add one to a variable "BonusSkill". Then, outside the foreach add "BonusSkill" number of skills to the rogue class skill total.

I did a similar thing with the "Vow of Poverty" feat from Book of Exalted Deeds if you want an example.
Lawful_g is offline   #5 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 6th, 2011, 07:49 AM
Sorry Mathias, what do you mean by selector? Nevermind, figured it out.

Lawful_g, I was trying to avoid user tags if I could, but I'll keep that in mind if I end up needing to use it. The foreach is another way to achieve the same thing I'm doing here, and is probably more elegant if I don't really need to change cSkills.

Last edited by Kendall-DM; March 10th, 2011 at 07:19 PM.
Kendall-DM is offline   #6 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 10th, 2011, 07:19 PM
Ok, I've been plugging at this for about an hour or so. How exactly do I make a selector with hit dice? I just can't seem to figure it out. I created a Hit Dice special that I could set its Value to herofield[tHitDice].value, but it never took. Even though I could get the value from tHitDice, assigning it to a Value field in xHitDice simply resulted in '0' in that field. I changed phases, timing, anything that I could think of, still stayed '0'. Of course in this case, it would only give a selector with the current level, but I was just trying to get it to work at this point. Plus I couldn't figure out how to make a list in the selector that is 1 through 20. So, I tried a few other methods, including just trying to make the selector "1|2|3|4|...|20", which it doesn't recognize. I'm at a complete loss (outside of making 20 user tags for each level, but I'd like to avoid that).
Kendall-DM is offline   #7 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 11th, 2011, 09:59 AM
bump... still need help trying to code level in a selector (either as a list of levels, or the current level, either will do).
Kendall-DM is offline   #8 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 15th, 2011, 08:04 AM
Bump again... still not sure how to accomplish this, if at all.
Kendall-DM is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 15th, 2011, 09:11 AM
Sorry, I was remembering an "activation amount" field that's somewhere else, rather than available where you need it.

You can use the tracker - give it a min of 1 and a max of 20, and let the user enter the level they took the thing at.

Last edited by Mathias; March 15th, 2011 at 09:35 AM.
Mathias is online now   #10 Reply With Quote
Reply

Thread Tools
Display Modes

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:06 AM.


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