Formula System Conversion

From PCGen Wiki
Revision as of 01:18, 25 February 2016 by Tom Parker (talk | contribs) (Created page with "{| align="right" | __TOC__ |} =Background= This work is based on: * Formula Parser Equip Vars Demo based on Formula Parser Equip Vars Proposal which includes F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Background

This work is based on:

Considerations

Things to watch out for in any conversion:

  • If the BONUS token has trailing PRExxx, then conversion may not be possible without other conversions being done in parallel
  • If the BONUS token takes in other variables, then conversion may require other new variables to be created

Conversions

Alternate HP

Past Process

BONUS:HP|ALTHP|...

Replacement

Requires a codeControl.lst file in the game mode. Reminder that the codeControl.lst file takes one token per line.

The codeControl.lst token is:

  • ALTHP:x
  • "x" in this case is the name of the new formula system variable that contains the alternate HP value.

Effects

If the ALTHP code control is used, then any BONUS:HP|ALTHP will be reported as a "not supported" token. The ALTHP control is either ON (new variable) or OFF (BONUS supported).

The ALTHP export (output system) token will continue to function, and its value is controlled by whether the ALTHP code control is enabled. If not, it uses BONUS, if it is, it uses the new formula provided as the argument to the ALTHP code control.

Of course, the preferred method (since the old output tokens will be deprecated anyway) is to convert the ALTHP export token to use the FreeMarker tokens for new variables:

${pc.val.x}

(again, where the "x" is the new variable now holding alternate HP.

Specific Considerations

None