Huh, I didn't see your post until now Trostboot. That's a shame :/
I updated the tool to v0.39b:
- Fixed a bug in Model Importer when the texture files were auto-detected,
- Allow to use UV, normals and tangents in "ByPolygonVertex" mode for importing models,
- Improved the "Edit Similar Enemies" option: it now applies to the enemies' attacks as well,
- Added a few editable datas to the enemies, related to how they look and sound in-game, as well as which model animations they use,
- Allow to input the model ID of an enemy so you can choose an imported model ID or a model that is normally not used for battles.
This last feature needs a bit of engine modification to work though. When you use an imported model, you need to add it to the engine's database like any other model, but even if you use a standard field model, you'll need to modify 3 CIL methods.
Indeed, there are 2 model databases:
1) "FF9BattleDB::Animation", containing the battle models (enemies, characters and weapons),
2) "FF9DBAll::AnimationDB", containing all the models (including the battle models).
You must make it so the "FF9DBAll::AnimationDB" is used anyway instead of looking in the "FF9BattleDB::Animation" table.
Additionally, you must tell the engine to load all the animations in the RAM for the models used in battles. The policy is indeed that:
1) For Fields, only the animations listed in "Preloading" are initally loaded in the RAM. Other animations are automatically loaded everytime if you use them in the Field script (with a "RunAnimation" call for example). The only exception to this rule is the "Jump" Animation that isn't automatically loaded by the related call so must be loaded another way (either have it in "Preloading", or use a "RunAnimation" or "SetStandAnimation" call on the "Jump" animation beforehand).
2) For World Maps and Battles, all the animations that can be found are loaded in the RAM along with the model.
Whichever option is chosen doesn't depend on the game's state unfortunatly, but on the model's string ID (if it contains something like "_B0_" or "_W0_", it is considered as a Battle/World Map model). So the wrong policy is used if you select a Field model for an enemy.
In practice, do these changes in the CIL Code if you want to use a Field model for an enemy:
- In the method "btl_init::SetMonsterParameter", you should have a line "ldsfld 0x40004B6 // FF9BattleDB::Animation" near the middle of the method. Change it to "ldsfld 0x40012A4 // FF9DBAll::AnimationDB" (the hexadecimal IDs are the ones from the latest Steam release).
- Same in the method "btlseq::SeqExecAnim". Change the "FF9BattleDB::Animation" line to the "FF9DBAll::AnimationDB" line.
- In the method "AnimationFactory::AddAnimToGameObject", search for these lines:
ldarg.1
ldstr 0x7003CA77 // "_B0_"
callvirt 0xA0001A7 // bool System.String::Contains( string )
brtrue IL_0098
Replace them by these:
call 0xA0000BB // !0 PersistenSingleton`1<class EventEngine>::get_Instance()
ldfld 0x40019E6 // EventEngine::gMode
ldc.i4.2
beq IL_0098
It may have an inconvenient bug though: sometimes models will be messed up in the first screen you see after launching the game. Going to the menu -> Title Screen -> Continue, it will be fixed back, but it is annoying.
And, of course, you must setup the datas in the enemy's resources (at least setup the animations it uses ; the other datas won't make the game crash if they are at 0).
Another problem though is that the animation speed are slowed by a factor of 0.5 in battles, so the field models will have slower movements...
Hopefully, these troubles will find a convenient fix in the future.
@Trostboot: I will fix that bug for the PSX version for the next release, but you can use an older version of HW in which there is not this bug. The
version 0.37c doesn't seem to have that bug. Also, most recent features are for the Steam version mainly so you don't miss a lot. Sorry about that.