• 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

I need help writing script

Savage

New member
Hi guys, I'm new here and having trouble writing a rule for a skill I added. It's Iaijutsu Focus, like it's D&D 3.0 counterpart, gains a bonus if you have a particular feat. Basically I want Iaijutsu Focus to gain +1 if the character has the Acrobatics feat.

Here is what I wrote in the Eval Rules for Iaijutsu; I would have wrote a simplified script in the Acrobatic feat but I'm not allowed to edit it and I don't want a duplicate feat sitting in there.

if (@valid = #hasfeat[fAcrobatic]) then
#skillbonus[skIaijutsu] += 1
endif

Now here's what happened:
1. The bonus from the "#skillbonus[skIaijutsu] += 1" just went and applied itself before I even selected the feat...

2. Acrobatics, upon being selected, removes this bonus. I've tested this over and over.

Please help. I'm new to coding and trying to get my feet wet, but this is driving me crazy.
 
Last edited:
Is there a somewhere to educate me on how timing works? I'm having no luck.
Does anyone out there have advice on how I'd add a priority code into mine? I'm getting Evalrule errors all over the place.
 
Last edited:
Is there a somewhere to educate me on how timing works? I'm having no luck.
Does anyone out there have advice on how I'd add a priority code into mine? I'm getting Evalrule errors all over the place.

Timing is broken up into phases, each having a large range of numbers that determine the order within each phase.

More detail is in the editor help files, which the default installation location is:
C:\HeroLab\data\pathfinder\authoring\pathfindereditphases.htm
 
@valid = 0 when you start an EvalRule, and before you add the feat, #hasfeat[] = 0, too, which is why you're getting the bonus before you add the feat.

Code:
if (#hasfeat[fAcrobatic] <> 0) then
  field[Bonus].value += 1
  endif

You also don't mention that you're trying to impose any restrictions while you're adding this bonus. If that's the case, you'll probably want to enter this as an Eval Script, rather than as an Eval Rule.

If you do want to use this to impose a restriction, then if, when the Eval Rule ends, @valid = 0, the skill will turn red and the message you entered will be reported in the validation report. So, figure out what condition makes the restriction you're imposing true, and set @valid = 1 if that's the case.
 
Thank you guys! Works like a charm. :D

Out of curiosity, does anyone know how to program a timer like a breath weapon for abilities? I see the charge count and then it ask for /round, or /day. I don't really see a way to effectively have a skill usable once every 1d4 rounds.
 
Back
Top