Author Topic: [PSX/PC] General editor - Hades Workshop (0.50b)  (Read 844482 times)

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1000 on: 2018-02-06 07:55:36 »
Alright, Tirlititi
I have exported and reimported the Grimlock enemy and the game still crash.

with these settings active in HW:



Am I to use 3ds Max to change UVs to "Control Point" aka: "ByVertice" or can that restriction be remove by HW importer?
(btw, if someone could find [along side me] a converter or the like for that UV coordinate too would be hugely appreciated).
oh, did you manage to get Metasequoia 4 working? (not sure of how much it can do now, if it can even solve .fbx UV problem...)

EDIT:
However, now, when I export and reimport the mooglebook, it works perfectly. (Just to be clear, the "mooglebook" is the one seen when saving your game from a save moogle, right?)
« Last Edit: 2018-02-06 08:02:51 by Incinerator »

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1001 on: 2018-02-06 09:48:24 »
Is it now possible to increase the poly size of the NPCs?

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1002 on: 2018-02-06 16:17:45 »
Yeah, it should, Kaldarasha, minus the problems that importing a model seems to bug most of the time :/

So, I've tried to extract/reimport Zidane and it indeed crashes in-game. It's the meshes/materials that are causing the bug for some reason (the animations seem to be better done since Zidane's 401 animations were exported/reimported correctly).
Also tried with the Grimlock with the same result: it doesn't work anymore for me either... Since it worked previously, I can hope to find what I changed since I tested it.

Yes, the moogle book is the book you see when saving. That's the model 133, the first of the list when sorted, which is why I usually tested things on it.

I'll make a fix, but I'm busy this week, sorry.

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1003 on: 2018-02-06 22:13:46 »
Alright, at least I know it's a confirmed bug, and not a corrupted archive; take your time Tirlititi.

ste459

  • *
  • Posts: 14
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1004 on: 2018-02-09 15:00:37 »
Tirlititi, I have some more questions, this time about AI script:

Some enemies, for example Yans, can counterattack to many different kind of attacks (simple physical attacks, black/white/blue magics, steal...) but, in their counter function, only the following party command/attack are checked:

    if ( ( GetAttackCommandId == 25 ) && ( GetAttackId == 103 ) ) {
        return
    }

Which should be Zidane "skill" command  and "what's that?!" ability, according to description. However Yans can counter also to normal attacks (for example) which should be the not mentioned "commandid = 1" .
For example, Nova Dragon counters to "attack" command and this is the relative script:
    if ( GetAttackCommandId != 1 ) {
        return
    }
    set #( SV_Target = GetAttacker )
    Attack( 0 )
    return

I am missing something? To make an enemy counterattack to many different party action is it not necessary to list them all, one by one?



Another question: can I declare a completely new local variable without replacing an existing one?
I want to make an enemy cast the "A" attack only if the "B" attack has already been executed, so I need to declare a variable which turns to 1 after "B" is selected, and if this variable is not 1  and "A" is selected, "B" is casted in place of "A".
But if I  simple write "set isBexecuted == 0" at the beginning of the function the system doesn't recognize the variable.

How can I fix that? What is the right way to declare a new variable? And if replacing an already existing variable is mandatory, is there a list of completely unused variables?

Thanks in advance!
« Last Edit: 2018-02-09 15:12:44 by ste459 »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1005 on: 2018-02-09 15:59:12 »
These lines in the Yan's script are present in most of the enemies' Counter function. They precisely say to not counter to Zidane's What's That?!. Indeed, "return" means something like "skip everything's left". So actually, Yans counters to anything as long as it's not that single skill.

To give you ideas, you can also look the AI of Gizamaluke, who counters differently depending on a magical or a physical attack, and the AI of Soulcage, whose counter depends on the element of the attack (more complicated).

You can declare new local variables, yes. For AI, you should first import the "LocalVariables" .hws file that comes along with the tool: it declares all the used variables of the enemy scripts. If you import it, you'll see a few lines in the "Local Variable Panel" when editing an AI. These lines declare the used variables. You can add yours like this:
1) Select the function to which you want to add a local variable (or at least a function of the right enemy),
2) In the local variable panel, add a line like "local uint8 isBexecuted",
3) Use that variable in the function: when you parse, it will recognize the declared variable,
4) Most likely, you will still have a warning, like "Need to allocate more": change the "allocate N" line accordingly and parse again if that happens.

In the help (F2), you have some informations about variables (which types can be used, what is the difference between local, global and general, etc...).

Note that when you declare local variables in Field or World Map scripts, the local variables already used are not listed at all and you can overlap an existing variable if you're not careful. In order to be sure not to overlap an existing variable, you can write this kind of line instead for 2):
"local uint8 myVariable Loc_UInt8_[N]" where [N] is replaced by the number in front of "allocate".
You'll then need to increase the "allocate" number for sure.

ste459

  • *
  • Posts: 14
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1006 on: 2018-02-10 13:01:47 »
Thanks! I didn't realized that != is "not equal to.." sorry    :-D I've seen Gizamaluke AI, now is a bit more clear for me how counter system works.

Another question, what exactly is the function of the "Short" flag in the AI attack forms?
« Last Edit: 2018-02-10 13:17:18 by ste459 »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1007 on: 2018-02-10 21:54:23 »
It's the name of the flag from the engine's source code, but it doesn't seem to be used at all (I couldn't find anything that checks if this flag is on in the engine's code). It is most likely a flag dummied out during the game's development.

@Incinerator: Ok, I found a bug and it was, as usual, a pretty stupid one. I will make a fix update but I'll use the occasion to also add a couple of things. You can bypass the bug with the current version though: rename the texture dependancies in the FBX model to something else. The bug occurs when the model importer automatically catches the texture (more precisely, when another file as the same internal name as the texture, such as a material).
So you have to make sure that the program asks you what are the textures linked to the model.

With this, at least exported/reimported models work. I'll try to add compatibility with the UV indices by Polygon Vertex for the fix as well.

Not related, but I found where the "3 enemy types / 18 attacks" limit is: go to the CIL Code "FF9StateBattleSystem::.ctor", the limit is there.
Find the following lines and increase the numbers to whatever you need:
Code: [Select]
ldc.i4.3
newarr 0x2000062 // ENEMY_TYPE
...
ldc.i4.s 18
newarr 0x2000050 // AA_DATA
You may then ignore the warning that popups when adding too many enemy types or attacks in a battle.
There are other limits in that CIL method, but none of them can be modified as easily as just changing a number there.

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1008 on: 2018-02-11 01:44:23 »
rename the texture dependancies in the FBX model to something else. The bug occurs when the model importer automatically catches the texture (more precisely, when another file as the same internal name as the texture, such as a material).
So you have to make sure that the program asks you what are the textures linked to the model.

So, instead of naming the textures to 98_0.png, 98_1.png, 98_2.png and so on, I should rename to something other like, shirt.png, body.png?

So you have to make sure that the program asks you what are the textures linked to the model.

It does, yet trying to find the texture from the list is horrific; like trying to find a needle in a haystack.

Compatibility for the UV indices is heavily needed! >.<
Is it better to import a binary .fbx versus a ASCII .fbx? Curious.

I have searched the face of the Internet trying to find how to get the UV coordinates of my model to store by Control Points, and have not gotten/found an answer at all.  :o How rare is this method? Apparently VERY. Not even an answer on Unity forums. It's not a simple thing to check in 3ds Max either, oddly, I use to use 3ds Max 2015, but not much anymore, I use Maya more.
Proprietary model formats were removed, to allow custom models to be replaced/added, making the desired result successful? It's almost impossible to make a custom model follow exactly the proprietary format's rules 100% like the given above. Unless HW or some other can scan, detect and possible auto-fix the custom model to fit the proprietary format needed to work in game. You see?

"3 enemy types / 18 attacks" limit~
Nice! Now I now it's possible to increase so!

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1009 on: 2018-02-23 20:25:50 »
Tiriititi,

When I try to make a custom save point (not using a moogle) in game; the game does not save the player's position in that spot; instead, the player returns to the entrance of the field; (rather than) in between battles for the Trial Mode I have in the mod. Are there specific field functions I must include in the script to have the game properly saved? Currently I only called to function: [Save Menu]
Script:

Code: [Select]
        Wait( 1 )
        Menu( 0, 0 )
        Menu( 4, 0 )


Also, Do you know where, in game's code, what defines each sfx to play on which weapon? Currently the PC version (for some characters) point to the same weapon sfx aside from having their own sfx identifier.
« Last Edit: 2018-02-23 21:29:25 by Incinerator »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1010 on: 2018-02-23 23:06:16 »
About the SFX identifier, it is indeed dependant on the character only (the "serial_no" number). The method "btl_vfx::SelectCommandVfx" defines which Spell Animation is used depending on the command: most of the time, the Spell Animation used is the one given by the Spell, but for some special cases, like the Attack or Throw or a few others, it is handled by the engine.
The Spell Animation used by the Attack command should be around the position IL_0091 and it's "100 + btl_util.getSerialNumber(regist)".
For Zidane, the serial number is 0 or 1 depending on his weapon, for Vivi, the serial number is 2, etc...
There are only the 19 slots of Spell Animations used by the characters between 100 and 118 included. There are also 64 slots of Spell Animations used by the enemies for their physical attacks, ranging from 313 to 376, but the game won't allow a character to use one of these like an attack (it only displays the strike, without the animations of the characters running to the enemy).

For the save spot, the Fields are loaded and initialized after a loaded game just like after entering the Field normally.
What they do is that they set the variable "VAR_GenBool_184 = 1" right before saving. Since that variable is saved in the memory card/Steam save, the script knows when a field is entered by a loaded game, and generally, it then sets the variable "General_FieldEntrance" to the special value 10000. You can see the position where Zidane is created after loading a save in "Zidane_Init" functions.
In the World Map, the character's exact position is also saved in the variables "VAR_GenInt24_64" (X), "VAR_GenInt16_67" (Z), "VAR_GenInt24_69" (Y) and "VAR_GenUInt8_72" (angle) ; you can use them for the field's position as well with something like that:
Code: [Select]
set VAR_GenInt24_64 = GetEntryPosX(255)
set VAR_GenInt16_67 = GetEntryPosZ(255)
set VAR_GenInt24_69 = GetEntryPosY(255)
set VAR_GenUInt8_72 = GetEntryAngle(255)
set VAR_GenBool_184 = 1
Menu( 4, 0 )
set VAR_GenBool_184 = 0
And then something like this in the character's "Init" function:
Code: [Select]
if ( General_FieldEntrance==10000 ) {
    MoveInstantXZY( VAR_GenInt24_64, VAR_GenInt16_67, VAR_GenInt24_69 )
    TurnInstant( VAR_GenUInt8_72 )
}
I think that the lines "if ( VAR_GenBool_184 == 1 ) { set General_FieldEntrance = 10000 }" are present in all the Fields of the game so you don't have to care about adding them.

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1011 on: 2018-02-24 02:51:49 »
Thanks for the extensive info Tirlititi; I got it!

trostboot

  • *
  • Posts: 7
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1012 on: 2018-02-25 16:17:40 »
I've been slowly trying to familiarize myself with this fantastic tool, but unfortunately, it keeps crashing when trying to edit text from within HW itself.
Once it has finished displaying the preview as it would appear in-game, it crashes every time.

This is with HW 0.39, a FFIX PSX image, Win10 16299. Happy to provide additional info, just don't really know where to look.

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1013 on: 2018-03-01 10:18:20 »
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:
Code: [Select]
ldarg.1
ldstr 0x7003CA77 // "_B0_"
callvirt 0xA0001A7 // bool System.String::Contains( string )
brtrue IL_0098
Replace them by these:
Code: [Select]
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.

trostboot

  • *
  • Posts: 7
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39)
« Reply #1014 on: 2018-03-01 12:59:49 »
@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.

Excellent, that will do just fine for the moment, thank you.

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1015 on: 2018-03-01 23:05:39 »
Alright, just to clarify,
on this window:



am I to select the corresponding Texture2D file or .fbx gameobject file to continue?

(This is for Main model: Zidane)

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1016 on: 2018-03-02 07:51:09 »
You're supposed to select the corresponding Texture2D file.
That is, however, very weird that your texture is named "98.fbx"...

Incinerator

  • Guest
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1017 on: 2018-03-02 10:20:01 »
You're supposed to select the corresponding Texture2D file.
That is, however, very weird that your texture is named "98.fbx"...

Yep, a deeper level of testing is needed...

usb

  • *
  • Posts: 117
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1018 on: 2018-03-05 09:00:14 »
First of all thank you for this amazing tool.
I am here to ask some help for a very little problem that has FF9 italian steam version: during a battle, when you choose to use magic sword ability (the Steiner+Vivi combo  :)), the text that appears in the top of the screen with the ability name has the words swapped. Here an example:
You choose Firaga Sword (in italian is "Colpo Firaga" and in hades workshop is named perfectly), in the top screen appears as "Firaga Colpo" (maybe use english order with italian text?)

My question is: is it possible to fix with hades workshop or with some manual edit?

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1019 on: 2018-03-05 11:13:59 »
Thanks usb :)
Yeah, I thought that they fixed that bug, but apparently not. It doesn't concern only Italian but also French and Spanish. The bug lies in the CIL method "BattleHUD::SetBattleCommandTitle" but it's a bit tricky to fix it there with HW.

What you can do though is bypass the bug: go to the "Interface" panel, select the "Battle Spell Naming" field and add 13 entries to it (right-click -> Add), then write the proper full names ("Colpo Fire" etc...). Finally, go to the "Party -> Spells" panel and change the casting names of the magic swords spells to the entries that you just added.
It's a bit dirty as a fix, but it works. You should also translate the names in the "Interface" panel if you want it to work for all the languages (I think the game would crash in non-italian language otherwise).

For info, you can have up to 62 custom spell names in that interface field.

usb

  • *
  • Posts: 117
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1020 on: 2018-03-05 11:57:11 »
Thanks usb :)
Yeah, I thought that they fixed that bug, but apparently not. It doesn't concern only Italian but also French and Spanish. The bug lies in the CIL method "BattleHUD::SetBattleCommandTitle" but it's a bit tricky to fix it there with HW.

What you can do though is bypass the bug: go to the "Interface" panel, select the "Battle Spell Naming" field and add 13 entries to it (right-click -> Add), then write the proper full names ("Colpo Fire" etc...). Finally, go to the "Party -> Spells" panel and change the casting names of the magic swords spells to the entries that you just added.
It's a bit dirty as a fix, but it works. You should also translate the names in the "Interface" panel if you want it to work for all the languages (I think the game would crash in non-italian language otherwise).

For info, you can have up to 62 custom spell names in that interface field.

thank you for your reply... I'll try as soon as possible.

update:
change the casting names of the magic swords spells to the entries that you just added
under spells panel there are only the basic magic and not the magic swords (they are under special). if i change the vivi magic when Vivi cast Fire magic it will be shown as Colpo Fire but the magic sword is still wrong

For the "Interface" panel, in localization entry, there is this strange behavior (if it is supposed to be ok it can be ignored):
Select italian language > german text
Select spanish language > italian text
Select german language > spanish text
Select french language > french text
In hades 0.39b
« Last Edit: 2018-03-05 12:14:41 by usb »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1021 on: 2018-03-05 12:40:15 »
About the "Spells" panel: yes, the Magic Swords are in there as well, but they are spread around. Most of them are next to Dagger's summons and Flare/Doomsday are at the end of the list.

About the "Localization" field, yes I noticed that. As strange as it appears, it's not a bug from HW but that's how the latest Steam version texts are (they were correctly set in the previous Steam versions). Don't bother.

usb

  • *
  • Posts: 117
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1022 on: 2018-03-05 12:53:49 »
About the "Spells" panel: yes, the Magic Swords are in there as well, but they are spread around. Most of them are next to Dagger's summons and Flare/Doomsday are at the end of the list.

About the "Localization" field, yes I noticed that. As strange as it appears, it's not a bug from HW but that's how the latest Steam version texts are (they were correctly set in the previous Steam versions). Don't bother.

wow.. you're right. I didn't notice at all. Changed in english and I easly found. Thank you very much for you'ra patience.

Lyrithus

  • *
  • Posts: 5
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1023 on: 2018-03-12 19:08:26 »
I was hoping I could find a few resources. I'm looking for a list of CIL methods with definitions. For example, I found in this thread that "CalcSub_203" is the CIL method for "Physical Strike". I'd like to know what the other definitions are for the rest of the "CalcSub".

Couple things that would be handy:
The ability to import/export lists of new CIL methods for a specific CIL class. For example:

If I had a file that contained a list of Customized CIL methods ("SubCalc_100" through "SubCalc_525") for "btl_calc", I could upload that as a sub mod that could be imported by HW.

aidolu12

  • *
  • Posts: 7
    • View Profile
Re: [FF9] General editor - Hades Workshop (0.39b)
« Reply #1024 on: 2018-03-17 19:42:47 »
Hi Tirlititi, hope you are doing great, once again thank you for working on this tool! have been wonderful.

May I ask, since you told me to check the CIL codes to modify some parts of the game engine results (not sure how to put that), have been quite difficult for me to understand the language, even though I got a little bit more use to it.

I wanted to ask, and I am quite sure will be possible, but not sure how to put it inside the coding. Can the party HP and MP be recovered after a battle? or 25% of current hp and mp? If anybody know how to put it, will be awesome for letting me know.