Member
Join Date: Jun 2018
Posts: 83
|
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.
|
#1 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#2 |
Member
Join Date: Jun 2018
Posts: 83
|
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 |
#3 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#4 |
Member
Join Date: Jun 2018
Posts: 83
|
Post-levels 10000
|
#5 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#6 |
Member
Join Date: Jun 2018
Posts: 83
|
Here is the output. I started the selection on WIS and switched to CHA, while tracking CHA.
|
#7 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
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! |
#8 |
Member
Join Date: Jun 2018
Posts: 83
|
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!
|
#9 |
Thread Tools | |
Display Modes | |
|
|