This document outlines the behavior and standard implementation of the <VAR command, a 3rd-party TSC command that lets the user set numeric variables instead of just single bits.
There are several different implementations of this command that are implemented slightly differently, but perform many of the same actions.
One of the many features that come with the AVA modloader patch. Variables are stored internally as 32 bit integers, and appended among other things to the save file. (Note that saves made with AVA break compatability with vanilla!) There are currently 100 avalable in a static array.
VARxxxx:yyyy - VARiable, Set variable xxxx to yyyyVA+xxxx:yyyy - VAriable +, Add number yyyy to variable xxxxVA-xxxx:yyyy - VAriable -, Subtract number yyyy from variable xxxxVA*xxxx:yyyy - VAriable *, Multiply number yyyy with variable xxxxVA\xxxx:yyyy - VAriable \, Divide number yyyy into variable xxxx (integer only, dangling decimals will be trimmed!)VAJwwww:xxxx:yyyy:zzzz - VAriable Jump, compare raw number number wwww to xxxx using operation yyyy, and jumping to zzzz if true. (also see addressing)
yyyy operations:
0000 - wwww == xxxx0001 - wwww != xxxx0002 - wwww > xxxx0003 - wwww < xxxx0004 - wwww >= xxxx0005 - wwww <= xxxx0006+ - doesn’t jumpVAZxxxx:yyyy - VAriable Zero, Sets yyyy number of variables starting at xxxx to zeroVNDxxxx:yyyy:zzzz - Variable raNDom, Assigns zzzz to a random number between xxxx and yyyyVIJxxxx:yyyy:zzzz - Variable Increment Jump, Increments variable xxxx by 1 until xxxx is >= yyyy, then it zeros xxxx and jumps to zzzzAny numeric arguments for any TSC prefixed with V will instead use the corresponding variable at that address.
Example:
<FAI0004 // fades in with direction "4"
<FAIV010 // fades in using the value of variable 10
This is a hack for freeware bundled with most releases of Booster’s Lab. Variables are stored internally as a 16 bit integer, and are saved in the profile, reusing flags 6000-8000. There are 124 (0-123) avalable for use. Flags beyond this are considered out-of-bounds and will affect other parts of memory!
VARxxxx:yyyy - Set variable xxxx to yyyyVAOxxxx$yyyy - Perform operation $ between xxxx and yyyy
Valid operations: +, -, *, % (note: % is NOT modulus here)
VAJwwww:xxxx:yyyy:zzzz - compare raw number number wwww to xxxx using operation yyyy, and jumping to zzzz if true. (also see addressing)
yyyy operations:
0000 - wwww == xxxx0001 - wwww != xxxx0002 - wwww > xxxx0003 - wwww < xxxx0004 - wwww >= xxxx0005 - wwww <= xxxx0006 - always jumpsRNDxxxx:yyyy:zzzz - RaNDom, Assigns zzzz to a random number between xxxx and yyyyAny numeric arguments for any TSC prefixed with V will instead use the corresponding variable at that address.
Example:
<FAI0004 // fades in with direction "4"
<FAIV010 // fades in using the value of variable 10