• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
June 15, 2025, 03:12:01 pm

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


Questions RE: Event Instructions

Started by Valendian, September 17, 2010, 10:42:59 am

Valendian

http://www.ffhacktics.com/instructions.php
^This page has struck my interest. A few of these instructions bear a resemblance to Vagrant Story script opcodes as below.
http://datacrystal.romhacking.net/wiki/ ... pt_Opcodes

I was wondering if anyone out there can explain the operations performed by the following instructions
B0 ADD
B2 SUB
B4 MULT
B6 DIV
B8 MULTHI
B9 DIVHI
BA AND
BC OR
BE ZERO

How often are these arithmetic instructions used in practice? (Are they used all the time or only in some maps)
what do they perform their operations on? (is there a section contained within the maps reserved for variables)

I suspect that vagrant story may have something like these arithmetic instructions in its scripting language. I have already seen looping opcodes in VS Script but they are very hard to figure out how they work or even which opcode is responsible for the jumping back and forth. in the Room files of VS you have a script section which is split up into a header then an opcode section, a dialog section and two sections that are unknown but always present. Do you guys think that theres a good chance that one of these sections is for variables

Heres what I have been able to do with that hand full of VS opcodes that I have figured out. I wonder what would be possible if I knew twice this number
http://www.youtube.com/watch?v=jZGf9WZgEFg

Xifanie

Each Event Instruction has a fixed length. The first byte determines the instruction: B0 to BE in this case. Then you have two half-words, Except for Zero which has only one.

This is used in all events (maps), mainly because one of those values is used to determine if the event has started....
But really it can be used for anything, because we can set/add/whatever to those values and use specific conditions with them to start another event (from the world map) or another event script (from inside the original event itself).

FFT has choices you can select sometimes in the game

This writes 0 or 1 to a specific value, and you can use it as a condition.
With that condition you can determine the next event script to load... one for 0 and another for 1.

Really those instructions mess with a lot of stuff... and like it's shown on the list, it will load a word or bit depending on the ID you assign the instruction/condition.

For example:
B4 MULT

B424000500 = MULT(0x0024, 0x0005)
It will load Value with ID 0x0024
since it is under 0x0080, it's a word.
Let's say that value was 50 to start with
MULT 0x00000032, 0x00000005
hi = 0x00000000
lo = 0x000000FA
It stores the lo back into the original ID location 0x0024. Simple as that.
The game always uses the Zero instruction to reset values back to zero... Whoever I'm pretty sure ORI would work instead of Zero + Add to set a value, but I forgot if it was useable.

I wouldn't be surprised if the two games have a very similar event script structure.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Pickle Girl Fanboy

Valendian, that was awesome!  Could we someday see VS characters with even less clothing?

Valendian

@Pickle: You will have to be patient I have no current plans to follow the "Nude Raider" trends of old  8P

@Zodiac: Thanks

10 Display Message   10 DialogShow(idDlg, Style, x,x, y, w, h, ?, ?, ?)
28 Walk To   28 ModelMoveTo(idChr, x,x,x,x, y,y,y,y)
29 Wait Walk   29 ModelMoveTo2
F1 Wait      F0 Wait(numFrames)

Thats 4 direct hits and I've only been able to name some of the opcodes. Thats more then a similarity. I believe they are both based on the same system. Much like the way Vagrant Story music is based on FF7's AKAO frames. There have been some modifications but it seems the team that produced VS brought a lot of solutions to the table before they even started to code. and I dare to say re-cycled some of the in house toolkits.

Cheetah

That is very interesting. The differences between a 2D and 3D cutscene system are so vast that I doubt there could be much more similarity besides camera controls and general pacing cues.
Current Projects:

Xifanie

Must I remind you that everything related to maps, camera, etc. in FFT are 3D?
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful