• 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

Mechanic for Skill Bonus

insaneurge

Well-known member
I am having trouble creating a script for a mechanic to assign a skill bonus to all skills equal to half class levels. I have was trying something like the following.

Code:
~ Generate our level for bonus
      field[abValue].value += field[xAllLev].value

field[abValue].value += round(#skillbonus[AllSkills]/2,0,-1)
 
Take another look at what you've written.

The first line says "add our level to our stored value".

The second line says "add half the bonus that's currently being applied to all skills to the stored value"

I think your second line is backwards, based on what you're describing - you want to add half your stored value to the bonus that's being applied to all skills.
 
Take another look at what you've written.

The first line says "add our level to our stored value".

The second line says "add half the bonus that's currently being applied to all skills to the stored value"

I think your second line is backwards, based on what you're describing - you want to add half your stored value to the bonus that's being applied to all skills.

Something like this?

Code:
~ Generate our level for bonus
      field[abValue].value += field[xAllLev].value

#skillbonus[AllSkills] += round(field[abValue].value/2,0,-1)

When I recompile I get an error box with the following

Attempt to access field 'xAllLev' that does not exist for thing 'SWSkills'
Location: 'eval' script for Thing 'SWSkills' (Eval Script '#1') near line 2
- - -
Attempt to access field 'abValue' that does not exist for thing 'SWSkills'
Location: 'eval' script for Thing 'SWSkills' (Eval Script '#1') near line 2
- - -
Attempt to access field 'abValue' that does not exist for thing 'SWSkills'
Location: 'eval' script for Thing 'SWSkills' (Eval Script '#1') near line 2
- - -
Attempt to access field 'abValue' that does not exist for thing 'SWSkills'
Location: 'eval' script for Thing 'SWSkills' (Eval Script '#1') near line 4
 
Last edited:
This is a Mechanic, right? Mechanics don't have an xAllLev field, which is why you're getting that error. Check out the list of fields that exist on the hero itself (Develop -> Floating Info Windows -> Show Hero Fields) and you should be able to find the one that fits your purposes. Once you have that, you can refer to the field in a script with "herofield[fieldID].value".
 
This is a Mechanic, right? Mechanics don't have an xAllLev field, which is why you're getting that error. Check out the list of fields that exist on the hero itself (Develop -> Floating Info Windows -> Show Hero Fields) and you should be able to find the one that fits your purposes. Once you have that, you can refer to the field in a script with "herofield[fieldID].value".

Thank you both! Changed the script to:

Code:
~ Generate our level for bonus

#skillbonus[AllSkills] += round(herofield[tTotLevel].value/2,0,-1)

Of course nothing happened. Finally realized I hadn't changed the timing :o
 
Another unrelated and probably simple answer. What tag would I use in a bootstrap to assign a custom racial trait at different levels. Something like ClSpecWhen but for races?
 
Thank you both! Changed the script to:

Code:
~ Generate our level for bonus

#skillbonus[AllSkills] += round(herofield[tTotLevel].value/2,0,-1)

Of course nothing happened. Finally realized I hadn't changed the timing :o

Since you mentioned that this works off of class level, I'll point out that tTotLevel isn't quite the field you want - unless you meant to say character level. There's a separate field for class level. The difference will be important if/when you have characters who have class levels on top of racial Hit Dice. You just want to make sure you're using the one that matches your intent.

Another unrelated and probably simple answer. What tag would I use in a bootstrap to assign a custom racial trait at different levels. Something like ClSpecWhen but for races?

There's no tag for that as far as I know. What you can do instead is use conditional bootstraps, with the condition being "count:Hero.HitDice >= X" (or "count:Classes.? >= X" if you care specifically about class levels and not overall Hit Die count).

Another thing you can do is bootstrap the ability with Helper.SpcDisable, and then have a script remove that tag if the hero is sufficiently high level. The conditional bootstrap is generally cleaner, though.
 
Back
Top