Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Mechanic for Skill Bonus (http://forums.wolflair.com/showthread.php?t=59971)

insaneurge January 19th, 2018 09:33 PM

Mechanic for Skill Bonus
 
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)


Mathias January 19th, 2018 11:21 PM

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.

insaneurge January 20th, 2018 09:19 AM

Quote:

Originally Posted by Mathias (Post 261693)
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

Quote:

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

TheIronGolem January 20th, 2018 10:08 AM

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".

insaneurge January 20th, 2018 01:35 PM

Quote:

Originally Posted by TheIronGolem (Post 261718)
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

insaneurge January 20th, 2018 01:38 PM

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?

TheIronGolem January 20th, 2018 02:00 PM

Quote:

Originally Posted by insaneurge (Post 261727)
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.

Quote:

Originally Posted by insaneurge (Post 261728)
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.

insaneurge January 20th, 2018 02:53 PM

Thank you sir!


All times are GMT -8. The time now is 10:48 PM.

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