Formula System Conversion

From PCGen Wiki
Revision as of 04:10, 4 March 2016 by Tom Parker (talk | contribs)
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

Face

Past Process

FACE: in Race LST

FACE: in Template LST (overrides Race LST - order is somewhat arbitrary of "what wins")

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:

  • FACE:x
  • "x" in this case is the name of the new formula system variable that contains the FACE value. It is expected to be an ORDEREDPAIR

Effects

If the FACE code control is used, then any FACE token in Race or Template LST files will be reported as a "not supported" token. The FACE control is either ON (new variable) or OFF (FACE LST token supported).

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

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

${pc.val.x}

(again, where the "x" is the new variable now holding new FACE).

Specific Considerations

None


Equipment Critical Multiplier (CRITMULT)

Past Process

  • CRITMULT: Token in Equipment LST (for primary head)
  • ALTCRITMULT: Token in Equipment LST (for secondary head)
  • BONUS:WEAPONPROF|CRITMULTADD to alter the critical multiplier

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:

CRITMULT:x

   "x" in this case is the name of the new formula system variable LOCAL to EQUIPMENT.PART that contains the CRITMULT value.  It is expected to be a NUMBER

Effects

If the CRITMULT code control is used, then any CRITMULT or ALTCRITMULT token in Equipment LST files will be reported as a "not supported" token. The CRITMULT control is either ON (new variable) or OFF (*CRITMULT LST tokens supported).

Any BONUS:WEAPONPROF|CRITMULTADD will also be reported as an unsupported token if the CRITMULT code control is used.

The Equipment CRITMULT Term will also break (not have the correct value)

The CRIT (and ALTCRIT) portions of the export system (output system) will continue to function. This includes portions of the following Export tokens: EQ, EQCONTAINERS, EQCONTAINER, EQCONTAINERW, WEAPON. The Crit Mult values are controlled by whether the CRITMULT code control is enabled. If not, it uses the CRITMULT as generated by the tokens. if it is, it uses the new formula provided as the argument to the CRITMULT code control.

In the long term, the preferred method will be to convert fetching the Critical Multiplier to getting the variable, but this is not currently possible due to lack of ability to do all the export of equipment in the new freemarker system.

Specific Considerations

Check for usage of "CRITMULT" in a formula in any Equipment. If this is used, then the game mode may not be convertable (yet) and/or a temporary variable may need to be created to carry that value in the old calculation system.

Equipment Critical Multiplier (CRITRANGE)

Past Process

  • CRITRANGE: Token in Equipment LST (for primary head)
  • ALTCRITRANGE: Token in Equipment LST (for secondary head)
  • BONUS:EQMWEAPON|CRITRANGEADD to alter the critical range
  • BONUS:EQMWEAPON|CRITRANGEDOUBLE to alter the critical range
  • BONUS:WEAPONPROF|CRITRANGEADD to alter the critical range
  • BONUS:WEAPONPROF|CRITRANGEDOUBLE to alter the critical range

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:

CRITRANGE:x

   "x" in this case is the name of the new formula system variable LOCAL to EQUIPMENT.PART that contains the CRITRANGE value.  It is expected to be a NUMBER

Effects

If the CRITRANGE code control is used, then any CRITRANGE or ALTCRITRANGE token in Equipment LST files will be reported as a "not supported" token. The CRITRANGE control is either ON (new variable) or OFF (*CRITRANGE LST tokens supported).

Any BONUS shown above will also be reported as an unsupported token if the CRITRANGE code control is used.

The CRITRANGE (and ALTCRITRANGE) portions of the export system (output system) will continue to function. This includes portions of the following Export tokens: EQ, EQCONTAINERS, EQCONTAINER, EQCONTAINERW, WEAPON. The Crit Range values are controlled by whether the CRITRANGE code control is enabled. If not, it uses the CRITRANGE as generated by the tokens. if it is, it uses the new formula provided as the argument to the CRITRANGE code control.

In the long term, the preferred method will be to convert fetching the Critical Range to getting the variable, but this is not currently possible due to lack of ability to do all the export of equipment in the new freemarker system.

Specific Considerations

None

Weapon EDR

Past Process

EDR: in Equipment LST

  • BONUS:EQMARMOR|EDR to alter the EDR

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:

  • EDR:x
  • "x" in this case is the name of the new formula system variable that contains the EDR value. It is expected to be a NUMBER

Effects

If the EDR code control is used, then any EDR token in Equipment LST files will be reported as a "not supported" token. The EDR control is either ON (new variable) or OFF (EDR LST token supported).

Any BONUS:EQMARMOR|EDR will also be reported as an unsupported token if the EDR code control is used.

The EDR export (output system) token will continue to function, and its value is controlled by whether the EDR code control is enabled. This includes portions of the following Export tokens: EQ, EQCONTAINERS, EQCONTAINER, EQCONTAINERW, ARMOR. If not, it uses EDR. if it is, it uses the new formula provided as the argument to the EDR code control.

In the long term, the preferred method will be to convert fetching the Critical Range to getting the variable, but this is not currently possible due to lack of ability to do all the export of equipment in the new freemarker system.

Specific Considerations

None