Clazex / HollowKnight.GodSeekerPlus

A Hollow Knight mod to enhance your Godhome experience
MIT License
21 stars 6 forks source link

Bug: Dreamnailing to P5 loads `GG_Atrium_Roof` but then an extra `GG_Atrium` #30

Closed royitaqi closed 2 years ago

royitaqi commented 2 years ago

I was playing around with modding and observed the following (weird?) extra loading of GG_Atrium when dreamnailing to p5 the first time. A second dreamnailing to p5 doesn't have this extra GG_Atrium.

See the last part of the following log:

[INFO]:[API] - Starting mod loading
[INFO]:[API] - Loading Global Settings
[INFO]:[API] - Deleting modlogs older than 7 days ago
[INFO]:[UltimatumRadiance] - Initializing
[INFO]:[GodhomeWinLossTracker] - Initializing
[INFO]:[GodhomeWinLossTracker] - Loading Global Settings
[INFO]:[GodSeekerPlus] - Initializing
[INFO]:[GodSeekerPlus] - Loading Global Settings
[INFO]:[Osmi] - Initializing
[INFO]:[Satchel] - Initializing
[INFO]:[SFCoreMod] - Initializing
[INFO]:[API] - Creating mod preloads
[INFO]:[UltimatumRadiance] - Initalizing.
[INFO]:[GodhomeWinLossTracker] - Initializing mod
[INFO]:[GodhomeWinLossTracker] - Message on bus: Bus event: initialized
[INFO]:[GodhomeWinLossTracker] - Initialized
[INFO]:[API] - Preloaded reflection in 3411ms
[INFO]:[API] - Finished loading mods:
[INFO]:[API] - Modding API: 1.5.78.11833-71
[INFO]:[API] - UltimatumRadiance : 1.2.0.0
[INFO]:[API] - GodhomeWinLossTracker : 0.0.5
[INFO]:[API] - GodSeekerPlus : 0.20.0
[INFO]:[API] - Osmi : 0.1.3
[INFO]:[API] - Satchel : 0.8.1-4630a7
[INFO]:[API] - SFCore : 1.5.3.2-c9e218
[INFO]:[API] - 
[INFO]:[Ultimatum Radiance] Added AbsFinder MonoBehaviour
[INFO]:[GodhomeWinLossTracker] - OnSceneLoad: GG_Atrium
[INFO]:[GodhomeWinLossTracker] - // loaded into Godhome middle bench

[INFO]:[GodhomeWinLossTracker] - // right before dreamnailing to p5 #1
[INFO]:[GodhomeWinLossTracker] - OnSceneLoad: GG_Atrium_Roof
[INFO]:[GodhomeWinLossTracker] - OnSceneLoad: GG_Atrium <--- Why does this one appear?
[INFO]:[GodhomeWinLossTracker] - // TK appear in front of p5

[INFO]:[GodhomeWinLossTracker] - // right before dropping down to p1-4
[INFO]:[GodhomeWinLossTracker] - OnSceneLoad: GG_Atrium

[INFO]:[GodhomeWinLossTracker] - // right before dreamnailing to p5 #2
[INFO]:[GodhomeWinLossTracker] - OnSceneLoad: GG_Atrium_Roof
[INFO]:[GodhomeWinLossTracker] - // TK appear in front of p5

I'm working on workarounds so this doesn't block me.

More context: The reason I ask is that I'm writing a mod and it depend on the last scene name to decide which pantheon the player is going into. GG_Atrium_Roof = p5, but if GG_Atrium is loaded after GG_Atrium_Roof and before boss fight, my logic breaks up.

Clazex commented 2 years ago

Might because I didn't check for multiple collision

For your mod you can hook On.BossSequenceController.SetupNewSequence to get pantheon info

Clazex commented 2 years ago

btw for here you can use BossSceneController.IsBossScene

royitaqi commented 2 years ago

I have implemented some workaround, so this is no longer blocking me. Feel free to close the issue or keep it open if you plan to do more work.

Thx for the pointers above. I will look at them when I get a chance.

royitaqi commented 2 years ago

BTW, noticed this issue again. See https://github.com/royitaqi/HollowKnight.GodhomeWinLossTracker/issues/74

And I found a fix, which is to hook GameManager_BeginScene instead of ModHooks.BeforeSceneLoadHook.