Formula System Conversion
Background
This work is based on:
- Formula Parser Equip Vars Demo based on Formula Parser Equip Vars Proposal which includes Formula Parser-JEP removal (sandbox) and Formula Parser Conversion Instructions
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.