• 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

Help with Adding Racial ability

Gragan

Member
Im trying to add the Dayborn race from Kobold Press Midgard setting as unfortunately its not yet available on Herolab. Im trying to work through the scripting tutorials but havn't coded in about 20 years! I've been mostly copying things with similar abilities and tweaking them which has worked so far.

Im trying to code the following racial ability.

Fire Resistance: Dayborn gain a +1 racial bonus to saves against
fire-based magic and effects. This increases by 1pt for every 4 class
levels they possess.

This is what i have as a start point


#situational[hero.childfound[svRef],"+1 Racial bonus vs. fire based magic and effects.",field[name].text]
#situational[hero.childfound[svFort],"+1 Racial bonus vs. fire based magic and effects.",field[name].text]
#situational[hero.childfound[svWill],"+1 Racial bonus vs. fire based magic and effects.",field[name].text]

But i cant think off the top of my head of other racial ability that increases with HD. So im not sure how to code that part in.

Any help would be appreciated.
 
Below is a script I just wrote without access to HL. Hopefully it works. In this case you need to calculate the bonus by taking the number of class levels and dividing by 4. Then we round that value "down" so if we are level 3/4 we get .75 round down to 0.

We place this in the abValue fields which is a "generic" field on almost all Things in HL. This value is then used to generate the string value you place on the saves.

I would recommend reading the Glossary of Terms for the Editor. Then check out FAQ#2 for all the places to learn about the editor including YouTube videos.

Post-Levels/10000 <- This timing/phase is VERY important. You must be in Post Levels or the count of Class tags will always return zero.
Code:
[B]~ If we're disabled, do nothing[/B]
doneif (tagis[Helper.SpcDisable] <> 0)

[B]~ Set the initial bonus value of 1[/B]
field[abValue].value += 1

[B]~ Calculate a +1 per 4 class levels bonus. 
~ Round the value down to match standard Pathfinder rounding rules[/B]
field[abValue].value += round(hero.tagcount[Classes.?]/4,0,-1)

[B]~ Set situational note on all saves[/B]
#situational[hero.child[svAll],signed(field[abValue].value) & " Racial bonus vs. fire based magic and effects.",field[name].text]
Anything with a ~ in front is a comment. Hopefully that gets you going in the right direction. :)
 
You are a legend thank you, i had gone over some of the tutorials but some of it i have taken in and some just goes over my head. I guess practice makes perfect. That script has worked perfectly. I've managed coding a few things, but i'd have struggled with the rounding down part.
 
HL scripting is one of those things that just takes time to learn. You are on the right track of trying to find stuff that already does what you want. I started with a copy/pasting stuff from LW scripts myself.

Sometimes it hard to find an example to copy from in which case feel free to ask here. :)
 
Back
Top