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 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 35
501
% is the modulus operator, it gives the remainer of the euclidean division. You nailed it right (all your assumptions about Tantarian's AI are correct).
& and >> are bitwise operators, in the sense that they have a meaning on the bits rather than numbers.
https://en.wikipedia.org/wiki/Bitwise_operations_in_C

What you need to remember most of the time, it's that "GetRandom % 2" and "GetRandom & 2" are indeed equivalent, but it's not the case anymore with larger numbers.
"(GetRandom % N)==0" is a 1/N chance to occur.
"GetRandom % N" is a (N-1)/N chance to occur.
"GetRandom & 1", "GetRandom & 2", "GetRandom & 4" are all 1/2 chances to occur.
"GetRandom & 3" is a 3/4 chance to occur (it's the independant probability of having either "GetRandom & 1" or "GetRandom & 2").

For >>, you can see it as divisions.
"A >> 1" is the same as A/2,
"A >> 2" is the same as A/4,
"A >> 3" is the same as A/8,
etc...
The result is always truncated (5 >> 1 = 5/2 = 2 for instance). There exists only integral numbers in FF9.

For Kuja's AI, it indeed connects the counter-attack only if Kuja's HP are below half of his Max HP without counting the extra 10 000 HP (so it's half of his in-game visible Max HP, not the number that appears in the datas).

502
It depends on the type of the variable actually.
Code: [Select]
UInt8 -> contains a value between 0 and 255
UInt16 -> contains a value between 0 and 65535
UInt24 -> contains a value between 0 and 16777215
Int8 -> contains a value between -128 and 127
Int16 -> contains a value between -32768 and 32767
Int24 -> contains a value between -8388608 and 8388607
Bool -> contains 0 or 1
The more the max value is, the more the variable takes of memory in the RAM. The following infos are important when you declare variables or use new variables in the script:
 - A variable of type "Int8" or "UInt8" takes only 1 byte of RAM, meaning that you can use both VAR_LocUInt8_0 and VAR_LocUInt8_1 without problem, for instance.
 - A variable of type "Int16" or "UInt16" takes 2 bytes of RAM, so if you use one, you can't use a variable that directly follows its numbering and is of the same type: you can use both VAR_LocUInt16_0 and VAR_LocSometype_2, but not VAR_LocUInt16_0 and VAR_LocSometype_1.
 - A variable of type "24" takes 3 bytes of RAM, so you need to let a gap of 2 in the numbering of variables that you use.
 - A variable of type "Bool" is special: it takes only 1 bit = 1/8 byte and has a special numbering. The number specifies the bit position in the RAM, not the byte position like the ones above. So VAR_LocBool_8 corresponds to the first bit of the second byte, meaning that you can't use both VAR_LocBool_8 and VAR_LocInt8_1 at the same time. More generally, you can't use AR_LocBool_N and VAR_LocSometype_[N/8] at the same time without conflict.

503
It's is possible to do that without a lot of changes.

Zorn and Thorn both have a flag stating whether there spell is available or not. It's "VAR_GlobUInt8_28" of Zorn (or "zornpoweron" if you imported the LocalVariables.hws, which is recommended for AI modding), and it's "VAR_GlobUInt8_29" for Thorn (or "thornpoweron").

When their spell becomes available, that flag is set to 1, and when it's not available anymore, it's set back to 0. What you need to do is turn those variables into counters instead of flags: you set it to 3, for instance, and you decrease it at each attack, canceling the spell only if it reaches 0.
CounterEx becomes like this:
Code: [Select]
Function Zorn_CounterEx
    if ( GetAttacker == SV_FunctionEnemy ) {
        if ( GetAttackId == 7 ) {
            set SV_FunctionEnemy[PREVENT_ATTACK] =$ 1
        }
        return
    }
    if ( GetAttacker == thorn ) {
        if ( ( GetAttackId == 13 ) || ( GetAttackId == 14 ) ) {
            set zorn[PREVENT_ATTACK] =$ 1
            set thorn[PREVENT_ATTACK] =$ 1
            set SV_FunctionEnemy[ATB] =$ 0
            set zornpoweron = 3                                         // HERE: setup the number of attacks required to cancel the spell
        }
        return
    }
    if ( #( SV_FunctionEnemy[HP] <$ hp ) ) {
        set hp = FirstOf(SV_FunctionEnemy[HP])
        if ( ( GetAttackCommandId == 18 ) || ( ( GetAttackCommandId == 27 ) && ( GetAttackId == 122 ) ) ) {
            return
        }
    } else {
        set hp = FirstOf(SV_FunctionEnemy[HP])
        return
    }
    if ( zornpoweron ) {
        set zornpoweron--                                         // HERE: decrease the counter instead of directly set it to 0
        if ( zornpoweron==0 ) {
            BattleDialog( 24 )
        }
    }
    set SV_FunctionEnemy[STAND_ANIMATION] =$ 0
    set SV_FunctionEnemy[PREVENT_ATTACK] =$ 1
    return
And in the counter:
Code: [Select]
    case +2:
        if ( zornpoweron ) {
            set zornpoweron--
            if ( zornpoweron==0 ) {
                BattleDialog( 24 )
                set SV_FunctionEnemy[STAND_ANIMATION] =$ 0
                set SV_FunctionEnemy[PREVENT_ATTACK] =$ 1
            }
        } else {
            set SV_FunctionEnemy[STAND_ANIMATION] =$ 0
            set SV_FunctionEnemy[PREVENT_ATTACK] =$ 1
        }
        return
    case +3:
        if ( zornpoweron ) {
            set zornpoweron--
            if ( zornpoweron==0 ) {
                BattleDialog( 24 )
                set SV_FunctionEnemy[STAND_ANIMATION] =$ 0
                set SV_FunctionEnemy[PREVENT_ATTACK] =$ 1
            }
        } else {
            set SV_FunctionEnemy[STAND_ANIMATION] =$ 0
            set SV_FunctionEnemy[PREVENT_ATTACK] =$ 1
        }
        if ( ( !zornpoweron ) && ( !thornpoweron ) ) {
            set #( SV_Target = thorn )
            Attack( 6 )
            set waitingpowerthorn = 1
        }

And you do the same for Thorn. They have a symmetric script.

504
It's the same trick as artificially increasing the max HP limit of bosses. You can find a very detailed example of how to do it for Kuja here. It's similar for any boss (in particular those who have this kind of system "when under 10 000 HP -> dies").

505
EDIT: The Memoria Engine modifier now provides a simpler way to modify supporting abilities: see the documentation in "StreamingAssets\Data\Characters\Abilities\AbilityFeatures.txt" after installing Memoria.

@resinate: It is possible, but on Steam version only, and it requires editing the CIL code, again.
Since Memoria Engine will allow to do it more conveniently, I stoped developping CIL macros for that. However, changing a HP +20% into a +80% is quite simple and can be done like this:
1) Find the method "ff9play::FF9Play_GetSkill",
2) In the second half of the method, spot these lines:
Code: [Select]
ldarg.1
ldind.ref
ldarg.1
ldind.ref
ldfld 0x40008AB // FF9PLAY_SKILL::max_hp
ldarg.1
ldind.ref
ldfld 0x40008AB // FF9PLAY_SKILL::max_hp
ldc.i4.s 10
div
add
conv.u2
stfld 0x40008AB // FF9PLAY_SKILL::max_hp
There is a similar code 4 times in a row, for HP+10%/20% and then for MP+10%/20%.
3) Replace the two lines.
Code: [Select]
ldc.i4.s 10
div

// Replace it by:
ldc.i4.s 80
mul
ldc.i4.s 100
div
This changes it into +80%

@dclem: First, I would like you to stop double-posting like that. You have a button to edit your messages ><
It makes it difficult for me to answer cause I have to browse the page, and besides it makes you ask the same question several times for nothing.

Secondly, you could read what I told you: it's "RunBattleCode( 37, 2929 )" in battle, and not "Field". If you tried that, you would have seen that 2929 is the field ID and so can be replaced by 16000 for your purpose.
And for the CIL code of the cinematics, I don't know. But I suspect it will be difficult to remove those steps like that. You'd better replace the cinematics by some black screen cinematic during 0.1 second or something similar.

506
@livegood118: Indeed, the .hws provided by Vir are not working for now. Use this one instead (I compiled it from his .ppf):
https://www.dropbox.com/s/14ger23aouudy9p/FF9%20Fixed%20Stats.hws?dl=1

@dclem: In battle, the script line is "RunBattleCode( 37, 2929 )" for running the end-game cutscenes, starting right after Necron's battle. Put it in the "Main_Init" function, next to the InitObjects.
I don't know for playing a music during a battle, other than modifying the BgmEncounterData thing.
In Alexandria's Main Street, you probably removed the lines "ShowTile( 11 and 12, 0 )" in the "Main_Init" function, which isn't good. Those lines are here to hide them. The code used to display it once is in the "Code14_19" function (which is called in the "Alexandrian_GirlA_Loop" function since the title appears the same instant as her).

@resinate: Not really. It might be possible to increase that limit on Steam but not on PSX. What you can do is transforming learnable spells into learnable auto-abilities in the "Stats" panel (you have the learnable ability lists). However, the total of "learnable spells + auto-abilities" can not exceed 48. You can only trade-off.

507
Your "FFP_Data" is a link to a folder and not a folder itself. Most programs don't like it at all.

Cut/paste the real folder there so it is spotted.

508
Hum, yes I changed Kuja's fight. He can indeed cast Flare Star in any situation now (1/3 if I recall correctly), but he has two other spells as well. I guess you were unlucky (or probably lucky I'd say instead ^^).

509
@livegood118: The Assembly-CSharp.dll is important for Vir's mod. I'll take a look at it.
However, you'd only need to import 1 file, not 4.

@dclem: The titles are background tiles. You manage them in the script with functions such as "ShowTile" or "SetTileColor". For Quan's dwelling, it happens in the first half of the "Main_Loop" function.
For ending the game, it's a special call to "Field( 16000 )". It triggers the ending cinematics though (based on the the CIL Code of "EndingMain").

@DanTsukasa: I don't know about the World Map model. I surely went a step further for it, but it may still be a long way. Plus that's not my personnal priority.

510
Yes, it disables the cheats except the game speed (but speeding the game also speeds up the minigame timers and so it can't be used as a cheat for Chocobo Hot & Cold for instance).

511
It usually looks like this:
Code: [Select]
Function Zidane_Reinit
    RunSoundCode( 4616, 914 )
    RunSoundCode( 4616, 923 )
    RunModelCode( 16, 25, 4, 914 )
    RunModelCode( 17, 25, 4, 923 )
    RunModelCode( 18, 25, 4, 1 )
    RunSoundCode( 4616, 914 )
    RunSoundCode( 4616, 923 )
    RunModelCode( 16, 25, 13, 914 )
    RunModelCode( 17, 25, 13, 923 )
    RunModelCode( 18, 25, 13, 1 )
    RunSoundCode( 4616, 914 )
    RunSoundCode( 4616, 923 )
    RunModelCode( 16, 38, 0, 914 )
    RunModelCode( 17, 38, 0, 923 )
    RunModelCode( 18, 38, 0, 1 )
    RunSoundCode( 4616, 914 )
    RunSoundCode( 4616, 923 )
    RunModelCode( 16, 38, 8, 914 )
    RunModelCode( 17, 38, 8, 923 )
    RunModelCode( 18, 38, 8, 1 )
    return
However, the sound IDs change from field to field (as the footstep sound changes). Check out the "Zidane_Init" function to get those.

There will be a model importer eventually. You won't be able to re-import the currently exported models though.
But I said that already.

512
@resinate: I thought I had a patch for that, but I can't find it anymore...

@ddclem: yep, fields have ID, like pretty much everything.
You can also get the ID from the Script Editor: write a line "Field( 0 )" anywhere in a script and you'll have the list of fields displayed on the right. Selecting a field there will write the appropriate ID instead of the "0".

For the "Zidane_Reinit", yes it sometimes doesn't exist and there's a "Zidane_11" or whatever instead. But then that function "Zidane_11" is called from the "Main_Reinit" (there's a line "RunScriptAsync( 0, 250, 11 )" ). Using directly a function Reinit, there's no need to call it from "Main_Reinit".

513
Ah, maybe you need to add a function "Main_Reinit" to the script for those fields. That's a function that runs at that point (when the game returns to the field after a battle).

Check out the script of a field in which there are random battles (or even non-random battles), they usually have this function ; I won't test now, but I guess you can simply copy the script from it and paste it into a Reinit function that you add in your modified field (right-click -> Add function -> choose function ID to be 10).

Also, maybe you'd need a "Zidane_Reinit" as well ; IIRC ( :p ) there is one most of the time in order to setup the footstep sounds again after a battle.

514
LocalVariableSettings should have no impact at all on the Steam modded files. It's only used for displaying the local variables properly (in AI scripts only for v1).
If resources.assets is the huge file, then it is most likely some corrupted texts. Verify the names and helps of the different things and the dialogs (in HW, after you import your mod). You may find a fuzzy one.

515
I'll ask Albeoris.
Yes, do that. Now that I think of it, I think that Memoria can already change the text font.
For your other problem, you need to be more specific indeed, as Resinate said.

@Resinate: yeah, I saw that you made a spell like this also, but Transcend was already in the first (english) release of my mod and therefore I was the first of us to have the idea  :evil:

516
Yep, the hidden scenes are included in my mod (Alternate Fantasy) but I forgot to make a stand-alone for it. Thanks for pointing this out.
So here it is: a link for the Hidden Scenes patch for PC.

The Magic Stone progression is defined in the CIL Code, so it's a bit tedious to change. It's the method "ff9level::FF9Level_GetCap" :
Code: [Select]
public static int FF9Level_GetCap(int slot_id, int lv, bool lvup) {
PLAYER pLAYER = FF9StateSystem.Common.FF9.player[slot_id];
FF9LEVEL_BONUS bonus = pLAYER.bonus;
FF9LEVEL_BASE fF9LEVEL_BASE = ff9level._FF9Level_Base[ff9play.FF9Play_GetCharID((int)pLAYER.info.menu_type)];
if (lvup) {
int num = (pLAYER.cur.capa != 0) ? 0 : 5;
int num2 = 0;
FF9LEVEL_BONUS expr_53 = bonus;
expr_53.cap += (ushort)(num + num2);
}
int num3 = (int)fF9LEVEL_BASE.cap + lv * 4 / 10 + (bonus.cap >> 5);
if (num3 > 99) {
num3 = 99;
}
return num3;
}
In term of CIL Code, the main operation ("int num3 = ...") is those lines:
Code: [Select]
ldloc.3 // fF9LEVEL_BASE
ldfld 0x4000890 // FF9LEVEL_BASE::cap
ldarg.1 // lv
ldc.i4.4 // Multiply by 4
mul
ldc.i4.s 10 // Divide by 10
div
add
ldloc.2 // bonus
ldfld 0x400088B // FF9LEVEL_BONUS::cap
ldc.i4.5 // Right-shift by 5 ( = Divide by 32)
shr
add
stloc.0

I have no idea of where the font used is defined.

517
Hello and thanks Inu92,
The mod is available in french only for the PSX version (here), not Steam. I'd like to make mods compatible with any language, but that's not likely to happen so soon :/

Zidane is indeed mandatory until Memoria, as in vanilla.

Happy easter to you and bon jeu !

518
IIRC = If I Recall Correctly. I said that eidolon's jewel powerup was linked to the spells and commands slots ("Ramuh"'s spell slot and "Summon"'s command slot for instance).
No, you can't swap monsters in certain battles in the PSX version.
There's no model importer yet.

519
@resinate: Oh yes, I forgot you were on PSX, sorry. Adding enemies is not available for the PSX version unfortunatly (only adding spells/groups are).

@dclem: No, if you remove that "if" block, the game will softlock because you'd kill the bosses and it's not intended.
You can import images of any size. The UV coordinates being scaled, the textures of 3D models will fit nicely if they are upscaled. For some other textures, changing the size could bug (I think the "SquareEnix/Silicon Studio" and the opening screen must be of fixed size). You should check for the Atlas textures, but I'd guess they will be fine.
You can't import assets if the same game files are opened in the main Hades Workshop frame. You have a warning about this...

520
Thanks iamthehorker.

Update to v0.37c. Since I didn't put a changelog for v0.37b, I also state what was added for it:
- Improved the Unity Assets Viewer
--- Can now import the files back,
--- Can automatically remove the AKB headers from audio files to have proper .ogg (re-importing them put that header back),
--- When importing the images, they are converted back (you can choose the format),
--- Can export 3D models.
- Tweaked the way the background images are exported/imported in order to keep the alpha informations. You can also now import them without compression (RGBA format - the files are 4x bigger).
- Fixed a few bugs, completed the list of 3D model names.

For importing the images (including backgrounds), not all the formats could work. I saw a few textures that are "Alpha only" and should be kept as it. Usually though, converting into RGBA is fine, 32bpp but without quality loss, and DXT5 is 8bpp with a bit of quality loss.

The exporting of 3D models is far from perfect. You can export most models from p0data4 (NPC, characters, enemies, accessories...), models from p0data2 (battle scenes and weapons) and a handle of effects in p0data3 (World Map) but not the whole World Map. What is exported is the geometry and texture information, but not the animations. Also, other (unknown) informations are lost during conversion, so these models will likely have a few problems for importing them back when an imported will be there.
You need to export the related file ".fbx" of type "GameObject" and the related textures in the Viewer. It generates a .obj (and .mtl) that can be used by Blender for example. It happens sometimes that the related textures are not properly linked, so in that case you need to open the .mtl with a text editor and replace the "TextureNotFound" by the name of the textures yourself. I also saw a few models (Amarant, Earth Guardian...) that are a bit fragmented (maybe that normal and the animations fix it though).
All in all, I don't guarantee that all the models are exported properly. I've tested a lot of them, but the format is still full of unknowns.

For the background exporter/importer, I changed the alpha format to fit more the format of the internal files. In these, most layers (lights, candles...) are fully opaque but made transparent using their blend mode (Substractive usually). In order to see them properly in a texture editor, you need to setup the blend mode of these layers manually (maybe I'll export them in the future if I find how to).

@dclem: Increasing the max HP can be done with a trick that I describe here:
http://forums.qhimm.com/index.php?topic=14315.msg224426#msg224426
It is not possible to just increase the possible max HP. It would require huge changes. For the Damage limit, I replace all the 9999 in these methods by the new value (only Tonberry's Grudge is limited by another mean).
For the eidolons, it is linked to the spell slot and the command slot IIRC.

@Resinate: you right-click on an enemy then copy -> paste it in another battle.

521
I updated the link here. I guess you found a proper link on RomHacking.net.
Thanks for warning :)

522
@dclem: I worked on a partial model converter. With the next release, you will be able to export the models as .obj (Wavefront) format.

@Iamthehorker: Ok, so there are two things there I think:
1) The sectors are not updated properly. I have no idea of how I should update them: there is periodically a block of data (0x130 in size) that has informations about the sectors. I never cared to touch them as they have no impact when using ePSXe and Psx. I guess there is a checksum in those blocks of datas ; if you can link me to a description of that checksum (on Retroarch maybe?), I can try to implement a sector repairing for "Export as PPF" and "Overwite Binary".
2) The bin/block fail is another problem. What "Export as PPF" does is looking at the file on your hard drive and create a PPF from the differences of the hard drive file and the modifications done in HW. That's why it is important to use it only on files that were not modified previously ; it's always a patch "Current version you have -> Current version you have + modifications done in the editor or imported via .hws". I don't really know why it gave you that error though, but that's not because of the sectors.

@Vomitrocious00: These items are set in the Field and World scripts. First go to the "Items" panel just to load them up, then go to the "Fields" panel, search for the field where the treasure or reward is and click on "Edit Script".
It may be different from cases to cases, but usually:
- For items found in a chest, you have (on the left of the window) a few functions called "Function Chest_Init" or "Function Chest_Something". In one of them, there is what happens when you open it, including the item you receive (since you went in the "Items" panel, you can click on the number defining the item and see the corresponding item's name).
- For items found on the ground (no 3D model related to it), it's usually the same kind of things, but with a "Function EntryX_Something" instead and they are a bit more difficult to spot as there are also other "EntryX" that are not related to items.
- For rewards and items given, that's in the midst of the dialog cutscene where the reward is given. If Stilzkin is the one giving you the reward, search in the "Function Stilzkin_...", if it's Artemicion, try "Function Artemicion_..." etc... The cutscenes are also sometimes handled by a "Main_..." function so you can search in those as well.
- For chocographs, bubbles and cracks, there are 3 functions defining the rewards (one for chocograph, one for bubbles and one for cracks). If I recall correctly, they are "Chocobo_..." functions.

Once you found the number defining the item, change it to what you want (there may be a couple of lines where you need to change them, but they are always next to each other), then Parse the function and then Ok.

523
The Excalibur II requirement is in the field datas indeed.
You need to do things a bit like I explained to Almaz a few posts ago, but you need to:
(1) only keep the "Fields" ticked when importing the .hws,
(2) in Mod Manager, untick every fields except for the following ones:
Memoria/Gate to Space
Daguerreo/Entrance
Daguerreo/Right Hall
Treno/Pub
You may also let "Memoria/Birth" ticked but that's for the other way of getting Excalibur II (beat Hades before 14h).

524
I'm not planning to make a font customizer ; Memoria is surely more fitted for that. For Freya's spell animation, it seems to be specially handled in the FF9SpecialEffectPlugin.dll so we don't have control of it. A workaround could be to swap the two animation files (in p0data5.bin, I guess).

525
Okay, if you're certain I asked you this question the first time, PLEASE link me where I said that, cause I can't find it.
But I know of a fact I did not ask such before; just lying so you don't have to help me with your tool?
If that makes you happier...
http://steamcommunity.com/app/377840/discussions/0/353915953249510749/?ctp=20#c133258593400587717

You're lucky though, I found the file where you can determine which music plays for which battle a few days ago. It's the files "BtlEncountBgmMetaData.txt" and "WldBtlEncountBgmMetaData.txt" that are in the resources.assets.
For each field, there's a list of the ID of the battles that are used in this field and the ID of the music that plays for it. If a battle is not preset, the music doesn't change. I didn't test anything though, just guesses.

And yes, I'm not at home and I have less time than usual for FF9 related things.

Pages: 1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 35