Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
insaneurge
Member
 
Join Date: May 2011
Posts: 53

Old January 19th, 2018, 09:33 PM
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)
insaneurge is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old 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.
Mathias is offline   #2 Reply With Quote
insaneurge
Member
 
Join Date: May 2011
Posts: 53

Old January 20th, 2018, 09:19 AM
Quote:
Originally Posted by Mathias View Post
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

Last edited by insaneurge; January 20th, 2018 at 09:31 AM.
insaneurge is offline   #3 Reply With Quote
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 676

Old 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".
TheIronGolem is offline   #4 Reply With Quote
insaneurge
Member
 
Join Date: May 2011
Posts: 53

Old January 20th, 2018, 01:35 PM
Quote:
Originally Posted by TheIronGolem View Post
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
insaneurge is offline   #5 Reply With Quote
insaneurge
Member
 
Join Date: May 2011
Posts: 53

Old 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?
insaneurge is offline   #6 Reply With Quote
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 676

Old January 20th, 2018, 02:00 PM
Quote:
Originally Posted by insaneurge View Post
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
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 View Post
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.
TheIronGolem is offline   #7 Reply With Quote
insaneurge
Member
 
Join Date: May 2011
Posts: 53

Old January 20th, 2018, 02:53 PM
Thank you sir!
insaneurge is offline   #8 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:54 AM.


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