Final Fantasy Hacktics

Modding => Event Editing => Topic started by: Werewolfe on August 11, 2020, 01:25:27 pm

Title: SPID - For Battle?
Post by: Werewolfe on August 11, 2020, 01:25:27 pm
Hello!

I have not yet made or changed an event, but I am trying to read in the mean time to get an understanding of what I can and cannot do.  I had a question with SPID though.

Is this a viable command in battle?  Meaning, can I have a dialogue option with SPID to check if a character is in battle and have a dialogue/event play, or otherwise ignore the command if they're not present?  Or is SPID only used to begin an event, and not to alter an event itself?
Title: Re: SPID - For Battle?
Post by: Nyzer on August 11, 2020, 01:41:54 pm
UnitAddress is the event command you're looking for.

Just make sure you use the newest version of the Event Upgrade hack as older versions didn't have a functional UnitAddress
Title: Re: SPID - For Battle?
Post by: Werewolfe on August 11, 2020, 08:03:34 pm
Thank you so much!  I greatly appreciate it.
Title: Re: SPID - For Battle?
Post by: Nyzer on August 12, 2020, 12:30:54 am
Specifically, you'll want to use UnitAddress to write to Variable x0001 based on that unit's innate Unit ID (which I think is equal to their spritesheet ID number?). If that unit isn't present, UnitAddress will write a value of zero to that variable.
ZERO out Variable x0000.
You then use NEQ which compares Variable x0000 and Variable x0001, and sets Variable x0000 to a value of 1 if the two are Not EQual - meaning, if the unit is present.
JumpFowardIfNot will go to the appropriate ForwardTarget if x0000 is set to a value of x00. Meaning, if the unit is not present, it will skip over all the commands between it and the appropriate ForwardTarget.
Those commands should be that unit's dialogue or whatever else you're putting in there.