Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
Enforcer84
Senior Member
 
Join Date: Oct 2011
Location: Portland
Posts: 313

Old May 14th, 2020, 05:30 PM
So I've got a subrace that adds Smith's Tools to the character and I used the script add that allows expertise if they already have it.

Phase: Post-levels Priority: 10000 Script:

~ If we're disabled, do nothing
doneif (tagis[Helper.Disable] = 1)

if (hero.tagis[ProfTool.gTooSmith] = 0) then
perform hero.assign[ProfTool.gTooSmith]
perform hero.child[gTooSmith].assign[Helper.TrainTool]
perform hero.child[gTooSmith].assign[Hide.Tool]
perform hero.child[gTooSmith].assign[Proficienc.Tool]
else
foreach pick in hero from BaseEquip where "ProfTool.gTooSmith"
perform hero.assign[ProfTooDbl.gTooSmith]
nexteach
endif

when I add the sub race I get errors. (attached as image)

I cannot add the skill it's not listed with the tools. If I add the Smith's Tools gear it just kind of works.
Attached Images
File Type: png Smiths Errror.PNG (155.4 KB, 6 views)
Enforcer84 is offline   #1 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old May 15th, 2020, 08:07 AM
Try checking out how it was done for the Forge Cleric. it bootstraps the tool gear itself, then assigns it in an eval script with a linkage table (I don't know how that works, but I'm going to go see if I can search and find out).

Then the only thing you'll need to solve is the expertise thing. I'd pull that out, make sure just the proficiency part is working, then put it back in and work from there.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!

Last edited by Fenris447; May 15th, 2020 at 08:28 AM.
Fenris447 is offline   #2 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old May 16th, 2020, 09:21 AM
I don't think that the line that pushes the proficiency to the link table actually works (perform root.linkage[table].assign[ProfTool.gTooSmith]) -that looks like some leftover test code. If you play around, you can remove that line - it's the bootstrap that pushes the proficiency.

Tool proficiencies are a hack, wish that they had done them the way skill proficiencies are done.

One way to try and accomplish what you want would be to:
1. Bootstrap Smith's Tools with the Procienc.Tool tag, AND add a conditional that looks for a field value - like "fieldval:abValue = 1"

2. add your script (postlevel 10000, Before Calc skProfBon)
Look to see if you have the proficiency. If you don't, set abValue to 1 (enabling the bootstrapped tool skill) and EXIT.
Else,
perform hero.assign[ProfTooDbl.gTooSmith]

or

if (hero.tagis[ProfTool.gTooSmith] = 0) then
~ if I can't see that we have the proficiency, set abValue so that the bootstrap fires off
field[abValue].value = 1
else
~ I see that we already have the tool, so let the hero have double proficiency
perform hero.assign[ProfTooDbl.gTooSmith]
endif


What is very important is the extra timing on the script:
Before Calc skProfBon
forces the script to run before any proficiencies bonuses actually get added, without it your script could run after and never works.
dungeonguru is offline   #3 Reply With Quote
Enforcer84
Senior Member
 
Join Date: Oct 2011
Location: Portland
Posts: 313

Old May 18th, 2020, 01:20 PM
Thanks guys!
Enforcer84 is offline   #4 Reply With Quote
Enforcer84
Senior Member
 
Join Date: Oct 2011
Location: Portland
Posts: 313

Old May 18th, 2020, 01:37 PM
Quote:
Originally Posted by dungeonguru View Post
I don't think that the line that pushes the proficiency to the link table actually works (perform root.linkage[table].assign[ProfTool.gTooSmith]) -that looks like some leftover test code. If you play around, you can remove that line - it's the bootstrap that pushes the proficiency.

Tool proficiencies are a hack, wish that they had done them the way skill proficiencies are done.

One way to try and accomplish what you want would be to:
1. Bootstrap Smith's Tools with the Procienc.Tool tag, AND add a conditional that looks for a field value - like "fieldval:abValue = 1"

2. add your script (postlevel 10000, Before Calc skProfBon)
Look to see if you have the proficiency. If you don't, set abValue to 1 (enabling the bootstrapped tool skill) and EXIT.
Else,
perform hero.assign[ProfTooDbl.gTooSmith]

or

if (hero.tagis[ProfTool.gTooSmith] = 0) then
~ if I can't see that we have the proficiency, set abValue so that the bootstrap fires off
field[abValue].value = 1
else
~ I see that we already have the tool, so let the hero have double proficiency
perform hero.assign[ProfTooDbl.gTooSmith]
endif


What is very important is the extra timing on the script:
Before Calc skProfBon
forces the script to run before any proficiencies bonuses actually get added, without it your script could run after and never works.
I'm having a bit of trouble figuring out when/where to add that before argument, can I do it from the editor's timing button? Or is this something I should add to the .user file with a text editor?
Enforcer84 is offline   #5 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old May 18th, 2020, 04:17 PM
Yes, when you hit the timing button there are three fields you can fill in.

Type or paste Calc skProfBon into the Before Scripts box and hit OK.

You don't need anything in the other two, although for troubleshooting you can type a script name to help if you know how to read the timing report or debug statements that might use it.
dungeonguru is offline   #6 Reply With Quote
Enforcer84
Senior Member
 
Join Date: Oct 2011
Location: Portland
Posts: 313

Old May 18th, 2020, 06:44 PM
Works perfectly! Thank you!
Enforcer84 is offline   #7 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old May 19th, 2020, 05:50 AM
And this is why dungeonguru is the master.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #8 Reply With Quote
Enforcer84
Senior Member
 
Join Date: Oct 2011
Location: Portland
Posts: 313

Old May 24th, 2020, 07:25 PM
I was getting an error because I literally pasted "Before Calc skProfBon" which still worked but the script would remind me I'd done a boner with every new add.
Enforcer84 is offline   #9 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old May 24th, 2020, 11:50 PM
Quote:
Originally Posted by Enforcer84 View Post
So I've got a subrace that adds Smith's Tools to the character and I used the script add that allows expertise if they already have it.

Phase: Post-levels Priority: 10000 Script:

~ If we're disabled, do nothing
doneif (tagis[Helper.Disable] = 1)

if (hero.tagis[ProfTool.gTooSmith] = 0) then
perform hero.assign[ProfTool.gTooSmith]
perform hero.child[gTooSmith].assign[Helper.TrainTool]
perform hero.child[gTooSmith].assign[Hide.Tool]
perform hero.child[gTooSmith].assign[Proficienc.Tool]
else
foreach pick in hero from BaseEquip where "ProfTool.gTooSmith"
perform hero.assign[ProfTooDbl.gTooSmith]
nexteach
endif

when I add the sub race I get errors. (attached as image)

I cannot add the skill it's not listed with the tools. If I add the Smith's Tools gear it just kind of works.
I'm no script genius but look at your foreach loop carefully... I think you should be doing eachpick.assign, not hero.assign... hero.assign sends the tag to the actor, not the pick you are looping through.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #10 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 04:32 AM.


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