Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 211

Old April 18th, 2021, 07:29 PM
Hi folks,

Writing a script for this ability: "Grants a bonus on two of the following skills of the rogue’s choice: Fly, Handle Animal, Profession (driver), Profession
(sailor), or Ride."

I've got the custom expression choosing the correct skills. Now I want to apply a +2 competence bonus to the chosen skills.
<post-attributes 10000>
Code:
hero.childfound[usrChosen1].field[BonComp].value += 2
hero.childfound[usrChosen2].field[BonComp].value += 2
That produces a syntax error. So what's the correct command to take the user's selections and apply bonuses to them?

Thanks as always!

Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 85%, Eldritch Godling (Super Genius Games) 66%, Mighty Godling (Super Genius Games) 42.2%, Adept Godling (Super Genius Games) 40.5%, Clever Godling (Super Genius Games) 38.7%, Fortunate (rebuild of Luckbringer, Rite Publishing) 26%, Legendary Cavalier (Legendary Games) 24.1%

Message me for a list of completed projects.
Visit my blog! https://gauntletsofblogrepower.blogspot.com/
Bob G is offline   #1 Reply With Quote
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 647

Old April 18th, 2021, 07:45 PM
The reason you're getting errors is because that script is looking for picks on the hero called userChosen1 and usrChosen2, which don't exist. What you are looking for is the transition "chosen", like so:

Code:
doneif (field[usrChosen1].ischosen = 0)
field[usrChosen1].chosen.field[BonComp].value += 2
The first line basically says, "Hey, did the user pick a skill yet? If not, then don't do anything else because we don't want errors when we try to give bonuses to a skill we haven't picked".

The second line starts from the ability's 'usrchosen1' field, then uses the 'chosen' transition to move to the pick selected in that field (i.e. the chosen skill), and is then able to apply the value to the BonComp field.
TheIronGolem is offline   #2 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 211

Old April 23rd, 2021, 07:39 PM
That makes more sense now IG, thanks for taking the time to explain it. Works great now.

Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 85%, Eldritch Godling (Super Genius Games) 66%, Mighty Godling (Super Genius Games) 42.2%, Adept Godling (Super Genius Games) 40.5%, Clever Godling (Super Genius Games) 38.7%, Fortunate (rebuild of Luckbringer, Rite Publishing) 26%, Legendary Cavalier (Legendary Games) 24.1%

Message me for a list of completed projects.
Visit my blog! https://gauntletsofblogrepower.blogspot.com/
Bob G is offline   #3 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 211

Old April 25th, 2021, 12:28 AM
Quote:
Originally Posted by Bob G View Post
That makes more sense now IG, thanks for taking the time to explain it. Works great now.
Maybe I spoke too soon. I'm now getting an error message saying "Attempt to assign field value with no pick context."
Code:
doneif (field[usrChosen1].ischosen = 0)
field[usrChosen1].chosen.field[BonComp].value += 2

doneif (field[usrChosen2].ischosen = 0)
field[usrChosen2].chosen.field[BonComp].value += 2
What's it tripping up on?

Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 85%, Eldritch Godling (Super Genius Games) 66%, Mighty Godling (Super Genius Games) 42.2%, Adept Godling (Super Genius Games) 40.5%, Clever Godling (Super Genius Games) 38.7%, Fortunate (rebuild of Luckbringer, Rite Publishing) 26%, Legendary Cavalier (Legendary Games) 24.1%

Message me for a list of completed projects.
Visit my blog! https://gauntletsofblogrepower.blogspot.com/
Bob G is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,897

Old April 25th, 2021, 09:36 AM
In the editor, how did you set up your choosers for this? It sounds like you left one of the settings blank, so it's defaulting to thing-based selections, instead of choosing "picks on hero".
Mathias is online now   #5 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 211

Old April 27th, 2021, 02:58 PM
Quote:
Originally Posted by Mathias View Post
In the editor, how did you set up your choosers for this? It sounds like you left one of the settings blank, so it's defaulting to thing-based selections, instead of choosing "picks on hero".
Yessir, that was the problem. All good now, thanks!

Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 85%, Eldritch Godling (Super Genius Games) 66%, Mighty Godling (Super Genius Games) 42.2%, Adept Godling (Super Genius Games) 40.5%, Clever Godling (Super Genius Games) 38.7%, Fortunate (rebuild of Luckbringer, Rite Publishing) 26%, Legendary Cavalier (Legendary Games) 24.1%

Message me for a list of completed projects.
Visit my blog! https://gauntletsofblogrepower.blogspot.com/
Bob G is offline   #6 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 02:09 PM.


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