Author Topic: [FF9 PC][for modders] Some layering fixes in p0data7 that every mod should have  (Read 15552 times)

snouz

  • *
  • Posts: 200
  • [FR_EN]
    • View Profile
EDIT 2024: this is now outdated, as all of this is now part of Memoria directly.


This is for mod creators.
With Hades Workshop, open your mod. In "Environment" > "Fields", for each field > "edit script", and each field has its functions, the first one is always Main_init, and second one is often Main_reinit (for when you get out of battle)
Some field names appear several times, so I indicated the number if that's the case.



BUGS OF THE PC version
The two chests appearing in front of objects is due to the Steam version having slightly shifted chests compared to PSX

Spoiler: Fixed in the latest version • show


Gulug/Well 1
In Main_Init and Main_Reinit, at the start of the function:
    SetTilePositionEx( 23, 0, 0, 4000 )





In Gargan Roo/Passage 1
Main_Init and Main_Reinit
Change:
    SetTilePositionEx( 2, 0, 0, 150 )
To:
    SetTilePositionEx( 2, 0, 0, 70 )





In Dali/Production Area 2
In Main_Init and Main_Reinit, at the start of the function:
    SetTilePositionEx( 27, 0, 0, -100 )
    SetTilePositionEx( 23, 0, 0, 100 )




BUGS OF THE PSX version
These two bugs were present in the PSX version and were likely an oversight from the developers




Crystal World 1
In Main_Init and Main_Reinit, at the start of the function:
    SetTilePositionEx( 8, 0, 0, 3000 )
    SetTilePositionEx( 10, 0, 0, -600 )
    SetTilePositionEx( 11, 0, 0, -600 )
    SetTilePositionEx( 12, 0, 0, 2000 )


This fix will need a bit shortening of the top bit of the path, because it makes the path appear in front of the giant boulder. It also makes the magic glow on the right appear on top of the boulder as well.





in field Palace/Dungeon 2
in Main_init (beginning of the function):
    SetTilePositionEx( 13, 0, 0, 500 )
    SetTilePositionEx( 18, 0, 0, 500 )


after "    case 9530:" and after "    case 9815:"
        SetTilePositionEx( 2, 0, 0, -500 )
        SetTilePositionEx( 3, 0, 0, -500 )
        SetTilePositionEx( 4, 0, 0, -500 )
        SetTilePositionEx( 5, 0, 0, -500 )
        SetTilePositionEx( 6, 0, 0, -500 )
        SetTilePositionEx( 7, 0, 0, -500 )
        SetTilePositionEx( 8, 0, 0, -500 )
        SetTilePositionEx( 9, 0, 0, -500 )
        SetTilePositionEx( 13, 0, 0, -500 )



In Function Zidane_13
replace:
    ShowTile( 2, 0 )
    SetObjectLogicalSize( 14, 20, 30 )
    InitWalk(  )
    Walk( -1983, 2306 )
    InitWalk(  )

with:
    ShowTile( 2, 0 )
    SetTilePositionEx( 3, 0, 0, -500 )
    SetTilePositionEx( 4, 0, 0, -500 )
    SetTilePositionEx( 5, 0, 0, -500 )
    SetTilePositionEx( 6, 0, 0, -500 )
    SetTilePositionEx( 7, 0, 0, -500 )
    SetTilePositionEx( 8, 0, 0, -500 )
    SetTilePositionEx( 9, 0, 0, -500 )
    SetTilePositionEx( 13, 0, 0, -500 )
    SetObjectLogicalSize( 14, 20, 30 )
    InitWalk(  )
    Walk( -1983, 2306 )
    SetTilePositionEx( 3, 0, 0, 500 )
    SetTilePositionEx( 4, 0, 0, 500 )
    SetTilePositionEx( 5, 0, 0, 500 )
    SetTilePositionEx( 6, 0, 0, 500 )
    SetTilePositionEx( 7, 0, 0, 500 )
    SetTilePositionEx( 8, 0, 0, 500 )
    SetTilePositionEx( 9, 0, 0, 500 )
    SetTilePositionEx( 13, 0, 0, 500 )
    InitWalk(  )


In each main character _16:
add before "    WaitTurn(  )"
    SetTilePositionEx( 2, 0, 0, 200 )
    SetTilePositionEx( 3, 0, 0, 200 )
    SetTilePositionEx( 4, 0, 0, 200 )
    SetTilePositionEx( 5, 0, 0, 200 )
    SetTilePositionEx( 6, 0, 0, 200 )
    SetTilePositionEx( 7, 0, 0, 200 )
    SetTilePositionEx( 8, 0, 0, 200 )
    SetTilePositionEx( 9, 0, 0, 200 )
    SetTilePositionEx( 13, 0, 0, 200 )



In Main_Loop near the end, after "ShowTile( 9, 1 )", i added:
        SetTilePositionEx( 2, 0, 0, 500 )
        SetTilePositionEx( 3, 0, 0, 500 )
        SetTilePositionEx( 4, 0, 0, 500 )
        SetTilePositionEx( 5, 0, 0, 500 )
        SetTilePositionEx( 6, 0, 0, 500 )
        SetTilePositionEx( 7, 0, 0, 500 )
        SetTilePositionEx( 8, 0, 0, 500 )
        SetTilePositionEx( 9, 0, 0, 500 )
        SetTilePositionEx( 13, 0, 0, 500 )


This will re-arrange depth of doors so that no bit gets in front of characters and that they don't appear in front of the texture, while putting the closed doors layers in front of the open one.
« Last Edit: 2024-08-13 01:01:34 by snouz »

snouz

  • *
  • Posts: 200
  • [FR_EN]
    • View Profile
Some more fixes:

Disable bad effects in Iifa trunk (there's an animation behind anyway)



Disable all "RunSPSCode(...)" in:
Iifa Tree/Inner Roots 1, 2 & 3
in Main Init & Main Reinit

Disable bugged smoke in Lindblum Plaza, before the forge


in Lindblum/Square
Remove these lines from Main_init and Main_reinit

    RunSPSCode( 2, 130, 1770, 0, 0 )
    RunSPSCode( 3, 130, 1772, 0, 0 )


    RunSPSCode( 2, 135, -3120, -1300, 2040 )
    RunSPSCode( 2, 140, 0, 0, 0 )
    RunSPSCode( 2, 145, 9000, 0, 0 )
    RunSPSCode( 2, 155, 150, 0, 0 )
    RunSPSCode( 2, 160, 16, 0, 0 )
    RunSPSCode( 2, 170, 0, 0, 0 )
    RunSPSCode( 2, 156, 1, 0, 0 )
    RunSPSCode( 3, 135, -3110, -1290, 2040 )
    RunSPSCode( 3, 140, 0, 0, 0 )
    RunSPSCode( 3, 145, 8000, 0, 0 )
    RunSPSCode( 3, 155, 150, 0, 0 )
    RunSPSCode( 3, 160, 16, 0, 0 )
    RunSPSCode( 3, 170, 0, 0, 0 )
    RunSPSCode( 3, 156, 2, 0, 0 )


Alexandria Pub floating glasses


Alexandria/Pub
In both glass_init remove everything except the first and last line.
In both glass_loop, remove everything except the first and 2 last lines


Clayra trumk chest angle



Clayra/Tree Trunk 6
in ChestA Init (the second one)
Before "return", add:
    SetPitchAngle( 10, 0 )
   

Small depth bug in Iifa roots


Iifa Tree/Roots 1
in Region13_Range
After SetFieldCamera( 1 ), add:
    SetTilePositionEx( 5, 0, 0, -50 )

Remove ugly shovels from dali windmill upstairs


Dali/Windmill 2F
remove from "mill_shovels_init":
    set VAR_GlobInt16_0 = 65267
    set VAR_GlobInt16_4 = 1318
    set VAR_GlobInt16_6 = 0
    set VAR_GlobInt16_2 = 258
    SetModel( 365, 93 )
    CreateObject( VAR_GlobInt16_0, VAR_GlobInt16_4 )
    TurnInstant( VAR_GlobInt16_6 )
    SetStandAnimation( 5959 )
    DisableShadow(  )
    SetPathing( 0 )
    MoveInstantXZY( VAR_GlobInt16_0, VAR_GlobInt16_2, VAR_GlobInt16_4 )
    set VAR_LocUInt8_1 = 6
   
   
remove from "mill_shovels_loop":
    if ( ( General_ScenarioCounter >= 6990 ) && ( General_ScenarioCounter < 11090 ) ) {
        MoveInstantXZY( -269, 338, 1318 )
        TurnInstant( 24 )
    } else {
        set VAR_LocUInt8_0 += VAR_LocUInt8_1
        TurnInstant( VAR_LocUInt8_0 )
        Wait( 1 )
    }
« Last Edit: 2020-08-12 10:15:09 by snouz »

Caledor

  • *
  • Posts: 214
  • [ITA]
    • View Profile
    • Facebook Page
Before/After Iifa Tree fix for reference (once again, amazing job)



Will edit post later with other comparisons once i test them ingame

snouz

  • *
  • Posts: 200
  • [FR_EN]
    • View Profile
Before/After Iifa Tree fix for reference (once again, amazing job)



Will edit post later with other comparisons once i test them ingame
It just removes the bad effects, but the smoke could still be reinforced with photoshop.
My project is also to remove the 3d objects of the shovels in the dali windmill (second floor), but capturing the images and adding them to the background to integrate them better.

Also, I removed the floating glass in Alex pub, but there are in fact 2 glasses, and I first managed to put them in the hands of each patron, but the glass is bottom up, and I cannot turn it up once it's attached to a hand, even using SetPitchAngle.
I could, however, angle some chests to integrate them better to backgrounds (Clayra Trunk...)

I need to put screens and formatting. Thanks for this one.

Btw Caledor, do you have any news from Lykon? He disappeared after release, and got no answer/connexion on steam from him. Is he ok?
« Last Edit: 2020-08-11 22:46:06 by snouz »

Caledor

  • *
  • Posts: 214
  • [ITA]
    • View Profile
    • Facebook Page
I just thought it was worth to showcase what was the result after that change, i'm going through them one by one. As for Lykon I just sent him a msg with a link here.

PS: i couldn't spot the difference in Dali Windmill and Iifa Tree/Roots 1, even though for the second i think i got what should happen: It's about the background below the elevator platform during the zoom in?
« Last Edit: 2020-08-12 00:01:50 by Caledor »

snouz

  • *
  • Posts: 200
  • [FR_EN]
    • View Profile
I just thought it was worth to showcase what was the result after that change, i'm going through them one by one. As for Lykon I just sent him a msg with a link here.

PS: i couldn't spot the difference in Dali Windmill and Iifa Tree/Roots 1, even though for the second i think i got what should happen: It's about the background below the elevator platform during the zoom in?
For the glasses, I had made the texture transparent, but noticed the model is used elsewhere, so it's better to remove the code. Same with Dali windmill, I have made the texture transparent in Moguri 8, but I don't know if the texture/model might be used elsewhere.
For the Iifa, here's the bug:

Model is in front of the field. Subtle...
« Last Edit: 2020-08-12 10:17:02 by snouz »

j.cogitation

  • *
  • Posts: 4
    • View Profile
For the glasses, I had made the texture transparent, but noticed the model is used elsewhere, so it's better to remove the code. Same with Dali windmill, I have made the texture transparent in Moguri 8, but I don't know if the texture/model might be used elsewhere.
For the Iifa, here's the bug:

Model is in front of the field. Subtle...

Quoting to try to get the attention of someone who knows what's up...

Do you know how to get Moguri 8 working with the latest steam release? Are you just telling steam not to update? How are you running it?

Also: Is there anywhere to access the experimental build you've got running with these fixes?

Tirlititi

  • *
  • Posts: 883
    • View Profile
I randomly found another one:
https://i.imgur.com/zhTaKo8.mp4

In vanilla (and PSX), there's no light effect on the statue and only the wings glow. Actually, in PSX (and surely Steam vanilla), there's a couple of glowing pixels on the statue's edge but the glow is behind the statue so it's almost completly hidden.

The Moguri Mod completly erases the glowing effect on the statue, even when it's put back on the foreground. Surely that's because of those edge remnants that were mistaken as annoyances.

It can be easily fixed by adjusting the layer's depth. Rather than scripting that depth adjustment, I find it better to adjust it in HW's background manager, now that it's a possibility.

snouz

  • *
  • Posts: 200
  • [FR_EN]
    • View Profile
Fix for Alexandria main place people disappearing

https://github.com/Albeoris/Memoria/issues/325

For each actor with _loop:
remove when present:
        if ( GetEntryPosX(xxx) > xxxx ) {
            SetObjectFlags( 14 )
        }

snouz

  • *
  • Posts: 200
  • [FR_EN]
    • View Profile
Frank jumping right into the hole:



In map 53, script function blank_pluto_knight_loop:
Function Blank_Pluto_Knight_Loop:

    switch 6 ( VAR_GlobUInt8_24 ) from 7 {
    case +0:
        Wait( 40 )
        SetObjectFlags( 7 )
        SetWalkSpeed( 45 )
        InitWalk(  )
        Walk( 250, 1200 )

Replace 250 with 330