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
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 5th, 2021, 09:03 AM
So it's fairly straightforward to set the charges to calculate from an attribute modifier. I want to have an ability that has a maximum charges equal to a user-selected attribute (WIS or CHA). It's not an issue getting the user selection box, but I'm not exactly sure what the syntax would be to assign the chosen attribute to TrkMax. As always, any help is greatly appreciated.
DeathSheep is offline   #1 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 511

Old November 5th, 2021, 01:42 PM
In the selection, restrict the list to All Picks on Hero. That'll allow you to specifically find the instances of those attributes that are on the hero itself. Then you can find field[usrChosen1].chosen.field[whateverfieldyouwant].value. Make sure you're doing this late in timing, after the modifier has been set, and after all potential bonuses may have been added to it.

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   #2 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 5th, 2021, 03:50 PM
I think I'm close. I did this:

Code:
      doneif (tagis[Helper.ShowSpec] = 0)

      doneif (tagis[Helper.Disable] <> 0)
      
      var iTrack as number
    
      iTrack = field[usrChosen1].chosen.field[aModBonus].value
      iTrack = maximum(1,iTrack)
      field[trkMax].value = iTrack
It takes the selection, shows the power in the resource tracker, but doesn't reflect the right number of uses. I think the logic of the code is right, but I am not confident in the syntax.
DeathSheep is offline   #3 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 511

Old November 5th, 2021, 06:36 PM
What timing are you using?

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   #4 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 6th, 2021, 11:08 AM
Post-levels 10000
DeathSheep is offline   #5 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 511

Old November 6th, 2021, 03:11 PM
I may be wrong on what it's pulling from...pull the field history for the attribute and see what it's showing for that field and when. You can see what the field is, and when, if ever, it was changed. Let's make sure we're matching them up first in terms of timing.

In case you don't know how to do that, go to Develop->Enable Data File Debugging. Then right click on the attribute in the Basics section and select "Show Debug Field Histories for ______"

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   #6 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 8th, 2021, 07:17 AM
Here is the output. I started the selection on WIS and switched to CHA, while tracking CHA.
Attached Images
File Type: jpg Screenshot 2021-11-08 081309.jpg (52.9 KB, 2 views)
DeathSheep is offline   #7 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 511

Old November 8th, 2021, 02:58 PM
Resolution is too low. Check the aModBonus value. Compare what you're getting from your script with what's showing on that debug screen to see if you're getting the right thing. Keep timing in mind.

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
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old November 8th, 2021, 03:55 PM
Thanks! The problem was in the timing. The aModBonus was coming in at Final. Moving the Eval Script to Final seems to have solved the problem!
DeathSheep is offline   #9 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 05:24 AM.


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