• 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

Stopping a Script

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.
 
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.
 
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.
 
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.
 
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:
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).
 
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:
The only min or max value I can set is in Spells, so I'm not sure what you are referring to here, maybe the max limit of the thing. What tracker are you referring to? I'm trying to do something like this in custom abilities and also in feats. Even so, I don't know what tracker you are referring to even if it was a class ability.
 
Back
Top