I will write guide NOW!! Ok I'm on Easter vacation now, so why not write the %&#$ guide lol. At least I can start with this post, and try to answer any questions that might pop up. I bet there are many others on this forum can probably answer 'em too. I'm not at home now and didn't bring any files. That means I don't have any of my files available. I'll be back home Tuesday next week.
Before I start, just to make things clear, you need to know that there are a fixed number of battle models in the... uh battle.lgp was it? Anyway they are in the lgp archive where the battle models are stored (It's located in data\battle). Each battle model has it's own ID. That means, unless you want to make your own models, you have to use that is already used by the game.
Anyways...
Lets go through it step by step. In the scene the important sections are:
- Enemy IDs (Battle model)
- Enemy Data (skills, items, elements etc)
- Attack ID list
- Attack Data (moves enemies have)
- Attack Names
- AI
- Formation
Enemy IDs (Battle model)To
ADD enemies to a scene you have to find a scene that isn't full (has 3 enemies), and then add a ID. This part is the easy part 'cause the IDs is in the very beginning of the scenes. The 6 1st bytes. Which means each ID is 2 bytes long. To begin with, you should find a scene you know where the encounters in the game are. For testing purpose.
Lets say you want to use the MP's battle model. I believe the ID here is 0x0010. Then if ID 1 is XXXX and ID 2 is YYYY then ID 3 will be 0x0010.
Enemy Data (skills, items, elements etc)The next natural step would be to fill in the enemy data. Information on this is found
HERE! To do this easy just use a scene editor. There are some parts of the enemy data that are unknown on the wiki but I'll try to explain 'em.
OFFSET LENGTH DESCRIPTION
0x0038 16 I call this one "Body Animation" (BM). There are things tied to the attack data too.
I think all enemies got 0x03 as the "standard" attack BM, and 0x04 is usually used as
the magical and/or secondary etc. attack. Each BM is tied to an attack ID in the same order.
That means that the 1st attack ID use the 1st BM. Each BM is 1 byte, 16 in all.
0x0048 32 This isn't unknown, but the length is wrong (I think). 'Cause each ID is 2 bytes (see wiki).
??????? 6 I don't remember where this starts. The 2 1st bytes are the attack ID
that the enemy uses under Berserk and Confuse. All 3 IDs will appear in the Manip. menu.
I'll find out where it was when I return.
0x00A2 1 or 2 I don't actually know what this byte is, but it might be what attack Odin will use.
0xFF10 means normal and 0xFF20 means the lance attack. I haven't tested this though.
Attack ID listThe next step is to to add your enemy's attack IDs in the attack ID list which starts at offset 0x0840 in each scene. Write 'em down in the same order as you did in your enemy's data (Enemy data). It doesn't have to be, but for the reason of order it's best to do this. If this confuses you let me explain a bit deeper:
In the Enemy Data you make the enemy's attack IDs. Those attack IDs should also be in the general attack ID list at offset 0x0840. Each attack that are stored in the scene are above this list, and the order here (Attack data and the ID list) is the important ones. Attacks are given their ID to the corresponding # ID from the ID list. In other words, the 1st attack will be referred to as the 1st ID from the attack ID list in the AI. That means that enemies in the scene can indeed share attacks. In the Enemy data you just set what attack IDs the enemy use. And those IDs appear again in the AI.
And if you got the gist of this you understand that the Attack names are stored in the same order.
Attack Data (moves enemies have)Next is to add the attacks. Naturally the enemy should have as many attacks as attack IDs (duh). The attack data start at offset 0x04C0, and each attack is 28 bytes long. I'll try to explain every byte.
2 of Safer's attacks:
AC: Accuracy
IA: Impact animation
TA: Target Animation
MP: MP cost
IS: Impact sound
CA: Camera movement.
TG: Target
ID: Attack's ID
TD: Type damage. 11 = physical 22 = magical
PW: Attack power.
RT: Restore type. 00 = restore HP 01 = restore MP
SE: Status effect. 3F = 100% cause status 7F = 100% remove status.
AT: Additional targets??
NU: Number of times the attack takes effect in 1 command IF AT = 00. Please note this will not make the enemy perform it more times.
ST: Status Afflictions
EL: Element
SP: Special (reflectable, unblockable etch).
AC|IA|TA|--|-MP--|-IS--|----CA-----|TG|ID|TD|PW|RT|SE|AT|NU|----ST-----|-EL--|-SP--|
FF 0B 00 FF 00 00 E2 00 FF FF FF FF 01 FF 11 18 FF 3F FF FF 00 00 00 06 00 04 FF FF (Physical Wing Attack. Has no name)
FF FF 00 FF 00 00 FF FF FF FF FF FF 05 75 22 19 FF FF FF FF FF FF FF FF 00 00 FF FF Deen
Attack NamesAttack names are easy. Each attack is 32 bytes long. FF text encoding can be found
HERE! Or use a tool.
AIAnd now for the tedious part: The AI. Each enemy in the game got it's unique AI. The AI script has a number of opcodes and is, well, "stack based". Opcodes can, for instance, push values or addresses on the stack, and then use those to execute commands, create variables, set addresses, check equality etc.
The AI section starts at offset 0x0E80. The 1st 3x2 bytes are the general pointers, which points to each enemy's AI section. 0xFFFF means no section. The 1st pointer will naturally always be 0x0006. As well will the 1st enemy's AI start at offset 0x0E86, 'cause there are 6 bytes of pointers. Each enemy's AI section always starts with 32 bytes of pointers to a specified AI section: Setup, Main, Counter General etc. The pointers hare are also 2 bytes, thus it's 16 pointers in total. An enemy hardly ever use more than 3-4 pointers. 0xFFFF means no section.
The 1st pointer points to the Setup section. (1st 2 bytes)
The 2nd pointer points to the Main section. (next 2 bytes etc)
The 3rd pointer points to the Counter General section.
The 4th pointer points to the Counter Death section.
The 5th pointers points to the Counter Physical section.
The 6th pointer points to the Counter Magical section.
The ?th pointer points to the Pre-Turn section.
I have no clue at the moment what the others are, but they are barely used at all.
For the actual opcodes you'll have to wait 'till I get home (it's funny how I always end up in these situations during holidays lol). It's possible to just copy another enemy's AI, but keep in mind you have that the AI contain the attack ID as well before an attack is executed. Replace those with the current attack IDs.
FormationsMoving on to
formations. There are room for max 6 enemies in each formation, and it's 4 formation in each scene. The four different formations starts at offsets 0x0118, 0x0178, 0x01E8 and 0x0238. Each enemy has 16 bytes each that decides different things.
ID = enemy's ID
XX = enemy's X pos
YY = enemy's Y pos
ZZ = enemy's Z pos
RO = enemy's row
bytes:
ID ID X? XX Y? YY Z? ZZ RO ??->
I'm not sure about the rest and X? Y? Z? as wel.
BOSSES?Now that your enemy is done, you may want to make some bosses too? Well that requires field editing. There are tools for that too.
Well it is easier than it sounds (at least for the PC version I dunno for PlayStation). You kinda have to find some place in the field script that can trigger a "monster-in-a-box", e.g when picking up items etc.
1st you need to know the formation ID you want to trigger. Each scene has 4 formations.
Scene1 has formation ID 0-3
Scene2 has formation ID 4-7... and so on...
And then insert a line in the field script with opcode 0x70. This opcode takes 2 arguments. Mak the 1st 0x00 and the 2nd equal the ID you want in hex. General info 'bout the field is found
HERE! Meteor is a great tool for this. The opcode name is BATTLE.
I'm sorry if this was confusing 'but it should at least get you started.