JumpForwardIfNot

From Final Fantasy Hacktics Wiki
Revision as of 02:37, 4 September 2021 by Nyzer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{D0} JumpForwardIfZero

JumpForwardIfZero(xJF)

Jumps to {D2} ForwardTarget if Variable 0x0000 is equal to 0. Otherwise simply keeps advancing.

Must be placed before {D2} ForwardTarget!


See also: {D1} JumpForward{D2} ForwardTarget{D3} JumpBack{D5} BackTarget


JumpForward ID : Byte (hex)

Assigned ID from x00 to xFF so you have related instructions work only with this value to not create conflict.

Allows up to 256 possible jumping destination forward, and 256 jumping destinations backwards.

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()

JumpForwardIfZero(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}