Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Tirlititi

Pages: [1] 2 3 ... 20
@resinate: Exactly what Incinerator said. Scripts are not in the CSharp.
Except for the texts (which are in "resources.assets"), the CSharp includes what's in the "Party", "Items" and "CIL Code" panels (there may be a couple of exceptions, like the "Status Sets" which are editable from the "Enemy" panel but are in the CSharp, but it is roughly correct).

@ToraCarol: Great that you fixed your problem yourself. I admit that I don't remember at all how head focuses are dealt with.

FF8 Tools / Re: [PSX/PC] Save editor - Hyne (1.9.2)
« on: 2018-06-09 20:06:52 »
That sounds plausible ; who tries to forget abilities?

@ploppo: About the wrong spell special effects, that's quite strange ; I think you did something wrong in your settings. The poisonous effect is the default animation in most cases (when no other is set).
About how I added Beatrix, I don't mind giving you tips, but you need to be more specific... Did you read the tutorial? What didn't you understand?

Again, there is nothing related to the Ipsen Curse in the field. The flag in the battles is everything there is.

@Kefka: Yes, it is possible with dnSpy again. In the "btl_calc::CalcMain", you need to put the line "btl_calc.CalcSub_15E(cALC_VAR);" a bit everywhere ^^'
Again, having a look at this file makes it easier to read the spell effects before editing the real thing (that has idiotic names and is harder to read).

For example, go to the "case 19" (Physical Strike effect) and change it to this:
Code: [Select]
case 19:
if (btl_calc.CalcSub_152(cALC_VAR))
You should put the line before the "CalcSub_20X" ("DoSetDamage_..." in the readable version).

Which string and which tutorial? What I did for Alternate Fantasy is a lot like what is described there.
For the Ipsen Curse, it's only a flag in the battles: you see that all the enemies of the Ipsen castle have this "Ipsen Curse" flag enabled.
It's a bit different for the Oeilvert Curse because that one also has an effect out of battles (you can't use magics). For this curse, there's the flag in the battles but also a general variable that is changed in the "Entrance" field of Oeilvert (I don't remember if it's turned off in the field where Ark is or if it's in one of the Desert Palace fields). The general variable is "Setting_MagicOff": as long as it's 1, magic is disabled in the player's menu.

About the jump ability, you may try the following using dnSpy: go to the "btl_cmd" class and its "CheckCommandCondition" then search for a part of the code that looks like this.
Code: [Select]
btl_stat.AlterStatus(regist, 1073741824u);
regist.cmd[3].cmd_no = cmd.cmd_no;
regist.cmd[3].tar_id = ((cmd.cmd_no != 3) ? btl_util.GetStatusBtlID(1u, 0u) : cmd.tar_id);
cmd.tar_id = regist.btl_id;
return true;
And add a few lines before that return:
Code: [Select]
btl_stat.AlterStatus(regist, 1073741824u);
regist.cmd[3].cmd_no = cmd.cmd_no;
regist.cmd[3].tar_id = ((cmd.cmd_no != 3) ? btl_util.GetStatusBtlID(1u, 0u) : cmd.tar_id);
cmd.tar_id = regist.btl_id;
btl.cmd[1].info.priority = 1;
if (btl.cmd[3].cmd_no == 3) {
btl_cmd.SetCounter(btl, 10u, 185, btl.cmd[3].tar_id);
} else {
btl_cmd.SetCounter(btl, 11u, 186, btl.cmd[3].tar_id);
return true;
I've not tested it but it should work (and she should perform the attack without any delay).

@ToraCarol: About the animation at Ipsen Castle, I can't say anything without the script code that you use.
I still don't know how to handle cameras... You can try random things like using the following kind of lines after Blank joins the fight:
Code: [Select]
RunBattleCode( 36, 0 ) // Change "0" to other numbers to try different cameras
Sorry for late answers but that's a lot of things to read.

@ploppo: You can right-click on files in the Unity Assets Viewer to export files and import them back.
The files exported appear in a folder "HadesWorkshopAssets" in your FF9 game directory. To import a file, you must put the new file in that "HadesWorkshopAssets" folder (in a sub-directory actually) exactly at the same place and exactly with the same name as when the file is exported.

@ToraCarol: I think that you didn't get it. Once you have linked Seiken abilities and Summon abilities, it frees space for other commands. Once you have done that, you can add up to 12 spells in another command without being told that there's no space.

About Blank's sword... It's strange but I got it!

So actually, "set character[MODEL_OFF] =$ 65535L" hides weapons only for the enemies (it might be that they have weapons meshes but I don't think so, so it's useless) and not for the party characters.
"set character[PRESENCE_OFF] =$ 1" hides weapons (as well as other stuff ; the character doesn't seem to even exist when its presence is off) but it is called a bit later, just before the ATB appears and the battle starts.

Conclusion: Dagger's weapon also appears mid-air before the battle starts. I just checked it on a youtube video and, indeed, there is a very small window during which you can clearly see her weapon...

So, I think that it's another bug of the Steam version. In the "btl_mot::HideMesh" and "btl_mot::ShowMesh", there is a "if" line that is wrong:
Code: [Select]
if (mesh == 65535 && == 0) ...I think that it should be "!= 0" instead: it was meant to take care of weapons only if the character is a team member and not the opposite.

You may fix the bug in this particular battle by adding another PRESENCE_OFF line together with the shadow/model hiding (still keep the PRESENCE_OFF lines that are below):
Code: [Select]
if ( #VAR_GlobUInt16_28 ) {
    set VAR_GlobUInt8_46++
    set VAR_GlobUInt16_28[MODEL_OFF] =$ 65535L
    set VAR_GlobUInt16_28[SHADOW] =$ 0
    set VAR_GlobUInt16_28[PRESENCE_OFF] =$ 1
    set VAR_GlobUInt16_42[MODEL_OFF] =$ 65535L
    set VAR_GlobUInt16_42[SHADOW] =$ 0
    set VAR_GlobUInt16_42[PRESENCE_OFF] =$ 1
Unless I'm mistaken, it should not crash the game  8)

About giving trance to someone else, I'll make a few tests but it may be possible to actually do it now with dnSpy/Albeoris's Memoria. Of course, unless you import another model, the trance appearance will be roughly the same as the normal state.
I don't guarantee anything though ^^'

1) I don't know :/
The "set VAR_GlobUInt16_42[MODEL_OFF] =$ 65535L" line should be the one that hides the weapon if I am not mistaken. I'll look in the engine if there are special instances where it's not good enough.
2) You can select one of the "Seiken" command and link it to the other "Seiken" command because they share the same abilities anyway ; that frees 4 slots that you can distribute somewhere else. You can do the same with Dagger's summons (normal & trance commands).
3) I gave the answer to that: musics are stored in the p0data61 archive and you can swap/replace them at will. You only need to have your music in .ogg format (and define looping points if you want it to loop in-game ; it is a feature of .ogg files).

@ploppo: The musics are in the "p0data61" archive. You can replace them using the Unity Assets Viewer (in the "Tools" menu). Only .ogg files are accepted. Incinerator's answer is more complete, if you want to change some the musics of individual battles.
Also, the battle spots are still there, just displayed better (there was only the first 4 battles in each spots before and spots at the same place were not shown together).

Update to v0.40:
- Improved the text changing window:
--- Fixed the crash of the PSX version,
--- Added a proper preview of most Steam text opcodes,
--- Allow to change all the languages on the same window,
--- Compute the dialog bubble size, approximately.
- Added a language link between scripts (AI scripts, World Map scripts and Field scripts):
--- When languages are linked, any modification on the script of one language also applies to the linked languages,
--- Except for dialog text IDs, the scripts of linked languages are the same (you can choose the translations of each text ID),
--- By default, if two language scripts only differ by the text IDs of the dialogs, they are linked,
--- The scripts batch exported are exported in all the languages checked in the "Preferences".
- Added a preview for the item icons in the Steam version (it was already there in the PSX version).
- Improved a bit the display of the World Map Battle Spots.
- Fixed some bugs (crash for some .hws files, crash when editing scripts after adding/removing a function, crash when trying to edit the "Opening-For FMV" Field...).

So, with this new version, you can, without too many troubles, create mods that are compatible with all the languages.
As I said, you can't automatically translate the texts right now, but it will be possible eventually (keeping in mind that it will be nowhere as good as true translations ; it will be about "google-translate" quality and manage the opcodes of the translations more easily). I didn't add a way to import PSX texts in Steam or vice versa. I'm not sure if it will be a thing one day (well, if really I don't have anything more to do).

Also, about the "STRT" opcode, it is updated when clicking on the "Auto-Size" button but it's not very important to have a precise width (the height is just the number of lines). If the specified width is too short, the game automatically choose the best fitting width.
It is however extremely important to have exactly one STRT opcode at the start of all the texts (at least in the "Texts" panel), even in texts that are not actually used.

Also, I tweaked the way that 3D models are imported, especially when custom model hierarchy are used, but I couldn't make everything work unfortunatly :/
I saw that replacing the 3D models of main characters is quite complicated (even swapping models) but it is possible: it needs to really make it perfect to have the good animations (so, let's say you use Quina's model instead of Zidane's, you'd need to rename the animations of Quina to fit the names of the animations of Zidane, not to mention to import everything properly with the right path names)... I'm not sure if I can make the process easier because it seems very dependant to what the engine expects... and when there is a dummy animation together with the model in the p0data4 archive, it has to be imported as well (for some reason, it's important to have this dummy animation when it's there by default).
Accessory, enemy and NPC models are much easier to change than models of the main characters (for battles, there's an additional problem since normal battle models and trance battle models share their animations).

EDIT: I forgot to add. About script languages that are linked and those that are not:
Most of the times Field scripts are the same between languages except for minor differences (but sometimes not so minor).
1) The Japanese version is not often linked to others because the buttons used are not the same. In particular, most of the time, when the script awaits a "Confirm" or "Moogle" button in the international versions (when dialog bubbles are handled by the script, for instance), it awaits a "Cancel" or "Moogle" button instead in the Japanese version.
2) In the Japanese and US versions, some "Wait" times are higher than in the other versions (surely to catch up with the PAL/NTSC frame rate). It is not always the case, far from that, but it may happen that a "Wait( 60 )" in the US/Japanese version is a "Wait( 50 )" in the European versions.
3) Dummy differences: it happens sometimes that dummy lines, with no effect, are present in some languages and not in the others. An example of this is the Chocobo Forest's UK script where an extraneous local variable is set up but never used (as part of the functions dealing with the display of the "Chocobo Forest" title tiles).
4) Real and important differences: there are a couple of real differences between the different languages. The most known is the reward of the Blank swordfight minigame (there is no static reward of 10000 gil when performing a 100/100), but there are also titles tiles that are displayed a bit differently, or some "Wait" lines added in some cutscenes... The AI script of Ragtime Mouse is also different in the US language because, contrary to all the other versions, the questions are displayed in 2 successive dialogs in US instead of 1 dialog with two lines.
Even though, it is usually safe to force the link on all the languages (except for the button mapping in Japanese that can be troublesome for people used to it). If you do force the link, you'll have to verify that dialogs used in the scripts are using the correct translation (as you may have noticed, the number of texts varies from language to language: some unused texts are removed/added in some versions, creating a shift in the text IDs).

I will now work on Alternate Fantasy for a while. I'll make an international version first, but then I'll also work on the mod ; I'm planning to only work sparsely on HW while doing that.

Also, I have once again changed a lot of things related to .hws file format (for script and text datas) ; I have done tests to check if that goes without bugs and didn't find any, but everything is possible. So I advise you to have copies of you .hws files (anyway, these files are so low-sized that I advise to have backups of them in any case).

Yes, you need to select the english (US) language. There is no italian translation right now (after the next release of HW, I'll work on an international version of Alternate Fantasy).

The problem with Albeoris's Memoria is that it changes sensible parts of the engine. The spell datas, for instance, are not stored in the same format anymore after applying Memoria.

@ploppo: About adding Beatrix, the simplest ways if you don't care about story are to use either CheatEngine or Albeoris's Memoria (the latter is the easiest but not compatible with changes made with HW).
I don't do team viewer or other things like this. I explained precisely how to import Beatrix out of my mod and if you made a mistake the 1st try, just try again ^^'

About Salamender/Zidane trance skills, the most probable if I got it right is that you only swapped the command in the "Stats" panel.
In the "Stats" panel, you need to:
1) Remove the "Trance link" of those characters by setting the option to "None",
2) Replace the abilities from the ability list to the ones used by the trance commands.
If you apply 1) without 2), you should be able to use all the abilities without learning them. If you apply both 1) and 2), you'll make these abilities learnable exactly the same as for the other abilities. In particular, you should also make sure that Zidane's weapons (and Salamender's) teach the trance abilities instead of the normal ones.

@Squid7777: It is not possible without changing the battle engine (the solution proposed by Incinerator doesn't work because Break abilities are not statuses). There are 2 ways of changing the battle engine: using Albeoris's Memoria tool (not compatible with HW) or using a C# DLL editing tool (compatible with HW as long as you don't mess with sensible parts of the engine).
I suggest that you use dnSpy for that.
What you need to do is to edit the class "btl_calc". More specifically, the method "CalcMain" of that class and even more specifically, the cases 33, 34, 35 and 36 in the switch. It should be something like this by default:
Code: [Select]
case 33:
case 34:
case 35:
case 36:
if (btl_calc.CalcSub_121(cALC_VAR))
if (prog_no == 33)
DEF_PARAMS expr_F0B = target.defence;
expr_F0B.p_def /= 2;
else if (prog_no == 34)
target.elem.str = target.elem.str * 3 / 4;
else if (prog_no == 35)
DEF_PARAMS expr_F54 = target.defence;
expr_F54.m_def /= 2;
else if (prog_no == 36)
target.elem.mgc = target.elem.mgc * 3 / 4;
The "CalcSub" lines are quite abstruse.
"CalcSub_101" setups the accuracy of the spell,
"CalcSub_114" lowers the accuracy if Shell is on,
"CalcSub_121" performs the accuracy check: what is inside the "if" block is executed only if this check connects and the "missed" flag is turned on otherwise.
In that file, I've copied the "btl_calc" class and renamed the "CalcSub" methods to make it more readable. You can look at it to understand how spell effects work.

What you want to do is changing these lines to something like this:
Code: [Select]
case 33:
case 34:
case 35:
case 36:
btl_calc.CalcSub_101(cALC_VAR); // Accuracy for the break effect
btl_calc.CalcSub_114(cALC_VAR); // Shell hit rate malus for the break effect
if (((int)v.hit_rate > Comn.random16() % 100) && ((int)v.ev <= Comn.random16() % 100)) // conditionally lower stat
if (prog_no == 33)
DEF_PARAMS expr_F0B = target.defence;
expr_F0B.p_def /= 2;
else if (prog_no == 34)
target.elem.str = target.elem.str * 3 / 4;
else if (prog_no == 35)
DEF_PARAMS expr_F54 = target.defence;
expr_F54.m_def /= 2;
else if (prog_no == 36)
target.elem.mgc = target.elem.mgc * 3 / 4;
// Unconditionally damage the target:
btl_calc.CalcSub_13A(cALC_VAR); // Setup base damage like a physical strike
btl_calc.CalcSub_141(cALC_VAR); // Apply caster bonuses of Bersek/Trance and malus of Mini
btl_calc.CalcSub_143(cALC_VAR); // Apply target bonuses of Sleep/Mini and maluses of Defend/Protect
btl_calc.CalcSub_159(cALC_VAR); // Apply equipment elemental boosts of the spell element
btl_calc.CalcSub_203(cALC_VAR); // Setup the damage... Everything else is handled by "CalcResult"
It's a kind of mix between "Break" spells and "Physical Strike" spells.

@ToraCarol: I'm not sure...
These lines from the "Main_Init" function are definitely wrong:
Code: [Select]
    while ( GetBattleState != 1 ) {
        if ( #VAR_GlobUInt16_42 ) {
            set VAR_GlobUInt16_42[PRESENCE_OFF] =$ 1
        Wait( 1 )
Use these instead:
Code: [Select]
    while ( GetBattleState != 1 ) {
        Wait( 1 )
    if ( #VAR_GlobUInt16_42 ) {
        set VAR_GlobUInt16_42[PRESENCE_OFF] =$ 1
Also, you should import the .hws file "LocalVariableSettings": in the AI scripts, it gives names to the local variables and make it much more readable (you'll see "dagger" and "blank" instead of "VAR_GlobUInt16_28" and "VAR_GlobUInt16_42" for example).
But I'm not sure that it will fix the bug... I'll try to investigate it if it doesn't work, but I'm busy with the next version of HW right now.

I don't know either... You have weird problems seriously ^^'
Please show your codes in which you add Blank in the battle. I also need to see the "SetCharacterData" line that you use for setting up Blank.

For model swapping, I'm working on it but I don't guarantee anything for the next release.

@Tetraspore: No, adding the three Tantalus members to the party is still relying on shared slots.
It is in the realm of possible to add slots to them, because it's in the engine source code (that can be modded using Albeoris's Memoria or other C# DLL editing tools like dnSpy). It however requires a big amount of work and it would be hard to deal with the interface (in the party selection menu and for the shop portraits).
The game is designed with 9 character slots ; a lot of datas and static numbers are relying on that, not to mention that the Field scripts are, as for them, expecting to have 8 team characters at some points (same problem with Beatrix).
I am not interested myself in adding Blank, Marcus or Cinna to the team of permanent characters, because I don't see the point both gameplay-wise and story-wise. But if I ever get into it, I'll let you know.

@ploppo: You're welcome :)
As ToraCarol said, you'll have the ability to recruit her. That means you must go to Alexandria's castle after getting the airship where you can meet her and let her come in the team. Then she'll appear in the party selection menu just like any other playable character.

@ToraCarol: no, sorry... As said, HW has little to no control over the cameras. I really don't know why the camera is scrambled for you and not for me (I mean, when you add Blank in your mod versus when I add Beatrix in mine).

I will release a new version of HW pretty soon (surely this week-end). I have investigated an "auto-translation" feature for translating texts automatically and, while I saw that it was possible, it would have delayed too much the next version (that has important bug fixes among other things).
So there will be an auto-translate in the future, but not in the upcoming version.

The AI script is the script in the "Enemies" panel. Select the battle against Abadon and there's an "Edit Script" button. That's the AI (and it presents like the Field scripts indeed, but that's a different script).

@fmalust: Oh, I'm sorry. I didn't see your message... Good that you could fix the problem.
It's not the first time that I miss a message ; it happens too frequently these days...

@ToraCarol: I have double-checked and I didn't change any camera setting for this battle in AF. You are doing something making it weird.
Verify that the camera used is the camera 0 in the group data (below the list of attacks of Abadon).
If the camera is indeed 0, a camera bug could occur because of AI script: did you change a function of the AI script? If so, what are those changes?

I'll check ; I have no idea of what is the glitch that you describe. The only slowdowns I've ever experienced were because of bad 3D models (or badly configurated).

Well, in any case, I did built the mod after saving/loading the .hws several times so it seems doubtful that the file itself is corrupted.

EDIT: Ah well, I nevermind then ^^'

I messed with the battle, but not with the camera.
I have seen several people doing that fight without bug, so I guess it's your version that glitches. The second Abadon uses the same functions as the first (even if it has a different attack pattern).

You can't control the battle camera... but that battle should allow 3+1 characters with a good camera: I don't remember messing with the camera when I added Beatrix to this battle and it works fine.

About the name, it may have been reseted by the script for some reason... Add a "SetName" line in the Pandemonium script before the fight and choose to rename Blank with the appropriate name.

Which window dialog? 493, 494 or 224?

The 493 and 224 dialogs are supposed to be handled by the script: the player has no natural control on closing the windows (or displaying the text faster) but with the lines "while ( !IsButton(655360L) ) { Wait( 1 ) }", the script waits for the player to press a button ("Confirm" or "Moogle") and closes the windows after a fading.
These dialogs are assumed to have either the opcode [NFOC] (= "No Focus") or [TIME=-1] (which has the same effect but can also determine a timeout for closing the window if the argument is non-negative).

The dialog 494 is not closed by the script and is assumed to have none of the opcodes [NFOC] or [TIME=...].

Hum, no idea. I thought that the light was dependant on the position of the character. Maybe that's because he's next to a light source?
It seems weird to me that models would need some special setting to have a correct light.

That might be the case. It seems to me that they are a bit off. At least there are the bugs you mention, and the cameras during Beatrix fights are shifted. There definitely is a problem with battle camera but I still don't know whether the PSX cameras are badly read or if they made other cameras and failed some of them.

Actually, there is a whole bunch of methods in the "SFX" class that are external, so not in the Assembly-CSharp.dll, and I don't know how to access to them. Surely that they are in the FF9SpecialEffect.dll plugin, but the dll's header doesn't list them.

Wrong ! Try again :p

Just kidding: the files with field cameras are the .bgs files (Tilesets (BG_SCENE)). These files contain both the tilesets and the camera(s). Binary-wise, it presents like this:
Code: [Select]
uint16 tileset_size // I don't remember if it's the whole file or only tiles
uint16 depth_shift // ???
uint16 tileanim_count
uint16 tileset_count
uint16 light_count
uint16 camera_count
uint32 tileanim_offset // Offsets are absolute with respect to the .bgs file
uint32 tileset_offset
uint32 light_offset
uint32 camera_offset
int16 origin_y // The Y coordinate is called Z in the game's source code ; it's the depth
int16 current_y // All these coordinates don't seem to be used anyway
int16 origin_x
int16 origin_z
int16 current_x
int16 current_z
int16 min_x
int16 max_x
int16 min_y
int16 max_y
int16 screen_x
int16 screen_y
// At camera_offset:
uint16 distance // "proj" in the source code
int16[9] matrix_3x3
int32 offset_x
int32 offset_z
int32 offset_y
int16 center_offset_x
int16 center_offset_y
int16 offset_width
int16 offset_height
int16 min_x // "vrpMinX" in the source code
int16 max_x
int16 min_y
int16 max_y
int32 depth
The main problem for me is the 3x3 matrix: I don't know to which OpenGL matrix it corresponds. I got bad views when I tried to do what seemed logical to me considering how the source code uses everything.

Note that the PSX cameras for the battle scenes are in the .raw17 (of archive p0data2) together with the enemy attack sequencing (and some datas related, like animation lists). But maybe they are ignored for the Steam version and they use other cameras somewhere else.

The MCF files seem to be something about ambiant light, but I'm not sure since there's already data about light in .bgs (EDIT : Ah, no ! I remember that the "light_count" is always 0 in all the .bgs of the game).

Good luck ^^'

Here you are.
In the PSX version, the icons are defined by a shape and a palette of colors (unlike for the Steam version where each used icon has its own image file, even if only the color changes). A lot of those icons are thus a combination of shape + color that is not used in-game.

So, you can do it like this, in the "Main_Init" function :
Code: [Select]
if ( ( GetRandom % 100 ) < 1 ) {
    InitObject( X, 0 )
Where "X" is the entry of the chest. With this, the chest will appear with only 1/100 chances each time the player enters the field.
Using the usual code that is made for chests, it will appear opened if the player already took its content. For making it renewable, you need to change the general flag variable that says it is opened into a global variable (which reinits when you leave the field).
The general flag variable is something like "VARL_GenBool_7283" ; turn it into something like "VARL_GlobBool_560" (I just had a look at the game's engine and it seems that the global variables are limited to 80 bytes, so up to "VAR_GlobUInt8_79" or "VARL_GlobBool_639").

If you want the chest to be a one-time, though, you don't need to use global variables instead of general ones.

I don't say it's wrong, I say it's incomplete. You didn't show the first lines of the function.

There is no "else if" statement in the script language (it would be possible to implement it but I'm not sure if I'll do it).
You have to put it in a function "NPC_SpeakBTN" of the NPC of your choice. In this post, you have an other example of such function, based on what is usually done for NPCs in the game. The function that Incinerator showed is not complete because, for instance, it uses "TimedTurn( VAR_GlobUInt8_16, 16 )" without showing how "VAR_GlobUInt8_16" is setup.

Other than that, I guess he answered what you're missing, right?

Pages: [1] 2 3 ... 20