• 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

Calculating values based off tags

AndrewD2

Well-known member
I'm working up a system that will have something similar to the Pathfinder CharCalc.? and ChargeAttr.? tags that are used for calculating trkMax and I was wondering if it would be possible to see some of the component script that is used for that.
 
Andrew,

Typically I think when you are using this kind of thing you need something like this, where you if ... then ... elseif .... through the available tags to apply the correct values to the tracker via an eval script.

Code:
  field[whatever].value += tagvalue[thetag.?]

  ~for ChargeCalc I think its something like
  if (tagis[ChargeAttr.Strength] <> 0) then
    field[trkMax].value += #attrmod[aSTR]
  elseif ... repeat for other attributes

  if (tagis[ChargeAttr.Minimum1) then
    field[trkMax].value = maximum(1,field[trkMax].value)
 
Oh I have something worked out, I just wanted to see the logic they used. It's a lot simpler than a ton of if/then/else statements. You can do a lot of just if (tagis[????]) then, especially if you use tagvalue[] because for example

Code:
  if (tagis[ChargeCalc.Minimum?] <> 0) then
   field[trkMax].value = maximum(field[trxMax].value, tagvalue[ChargeCalc.Minimum?])
   endif

That would actually allow you to create new tags for minimums as long as you followed the appropriate format of Minimum? where ? is a number. Same applies for the LevelX?.? and LevelDiv?.? tags.

What I'm most interested in is their order of operation.
 
Back
Top