EQ

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

{A2} EQ

EQ()

Equal | Variable 0x0000 = If ( Variable 0x0000 == Variable 0x0001 )


Compares Variables x0000 & x0001.

If x0000's value is equal to x0001's, x0000 is set to a value of 0001. If not, x0000 is set to a value of 0000.

JumpForwardIfZero can then be used to make the event do different things depending on the result.

Comparison commands can only be used to compare Variables x0000 & x0001.


See also: {A0} LTE{A1} GTE{A3} NEQ{A4} LT{A5} GT

Example

Let's say we want to let the player choose what to do in an event. Here's what we'd put in for that.

DisplayMessage(x10,x11,x0001,x01,x00,x00,+00000,+00000,+00000,x03)

//Message x01

{font:08}{Ramza}{font:00}{br}

{FB}We need to save them!{br}

We're going to kill them all!{FC}{close}


The result of dialog-box choices is saved to Variable x0018. The first option saves a value of 0000, the second a value of 0001, and so on.

So then we'd copy the value of x0018 to one of the two Comparison variables, zero out the other, and use a Comparison command.

ZERO(x0000)

SETVar(x0001,x0018)

EQ()

JumpForwardIfNot(x01)


If both variables have a value of 0000 - therefore, if the player picked the first choice - the JumpForwardIfNot command would be ignored, as the EQ check would set x0000 to a value of 0001.

Let's say we know Agrias is in the event and we want her to respond to Ramza's choice.

DisplayMessage(x10,x11,x0002,x34,x00,x00,+00000,+00000,+00000,x03)

//Message x02

{font:08}Agrias{font:00}{br}

I agree! We can't let{br}

innocents be harmed!{end}


Then let's say that her dialog is the only thing the player's choice affects, no Bravery gain or recruitment or whatever. We're done with everything this choice affects, so we'll set up a normal JumpForward to skip over what the other choice results in.

JumpForward(x02)


Now we need to set up a ForwardTarget for the second choice, show Agrias's alternate reaction, then set up a ForwardTarget for the first choice, at which point both choices return to being just one event.

ForwardTarget(x01)

FaceUnit(x01,x00,x34,x00,x00,x01,x00)

WaitRotateUnit(x34,x00)

DisplayMessage(x10,x11,x0003,x34,x00,x00,+00000,+00000,+00000,x03)

ForwardTarget(x02)

//Message x03

{font:08}Agrias{font:00}{br}

Ramza, what the fuck?!{end}