Difference between revisions of "MODVar"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Xifanie moved page Event Instruction B9 to MODVar)
 
(No difference)

Latest revision as of 05:01, 23 February 2021

{B9} MODVar

MODVar(xVAR1,xVAR2)

Divide Immediate | Variable = Variable ÷ ImmediateValue (high 32bit)


Divides Variable 1's Value by Variable 2's Value and gives the remainder as the result.

So if VAR1's Value was 0018 and VAR2's Value was 0006, the result (saved to VAR1) would be 0000.

If VAR1's Value was 0019 and VAR2's Value was 0006, the result (saved to VAR1) would be 0001.


Can be used after Random to essentially generate a random number along a specific range - from 0 to one number less than VAR2's Value.


See also: {B6} DIV{B7} DIVVar{BE} ZERO


Variable 1 : Half-Word (hex)

Click here for the list of Variables


Variable 2 : Half-Word (hex)

Click here for the list of Variables