• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Max Charges Based on Selected Attribute

DeathSheep

Well-known member
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.
 
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.
 
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.
 
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 ______"
 
Here is the output. I started the selection on WIS and switched to CHA, while tracking CHA.
 

Attachments

  • Screenshot 2021-11-08 081309.jpg
    Screenshot 2021-11-08 081309.jpg
    52.9 KB · Views: 2
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.
 
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!
 
Back
Top