Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Max Charges Based on Selected Attribute (http://forums.wolflair.com/showthread.php?t=66508)

DeathSheep November 5th, 2021 09:03 AM

Max Charges Based on Selected Attribute
 
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.

Fenris447 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.

DeathSheep 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.

Fenris447 November 5th, 2021 06:36 PM

What timing are you using?

DeathSheep November 6th, 2021 11:08 AM

Post-levels 10000

Fenris447 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 ______"

DeathSheep November 8th, 2021 07:17 AM

1 Attachment(s)
Here is the output. I started the selection on WIS and switched to CHA, while tracking CHA.

Fenris447 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.

DeathSheep 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!


All times are GMT -8. The time now is 01:43 AM.

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