Skip to content

Don't show Master Sword before obtaining it in MS Shuffle#3880

Closed
Patrick12115 wants to merge 14 commits intoHarbourMasters:developfrom
Patrick12115:NoMS
Closed

Don't show Master Sword before obtaining it in MS Shuffle#3880
Patrick12115 wants to merge 14 commits intoHarbourMasters:developfrom
Patrick12115:NoMS

Conversation

@Patrick12115
Copy link
Contributor

@Patrick12115 Patrick12115 commented Jan 26, 2024

As the title says, this uses gfx patching to hide the Master Sword and Sheath if you have not yet found a sword while playing with Master Sword shuffle on.

DOES NOT WORK WITH CUSTOM MODELS

Capture
Capture2
Capture3
Capture4

Build Artifacts

}

void RegisterPatchNoMSHandler() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([]() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to patch these less often e.g on scene init/file load? or does it need to be on update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do it that way, when you get MS it doesn't update, so you would still not see it until you did a scene change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no way to call the unpatching when you get the master sword?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I'm sure there is. I just don't know it. I still barely understand hooks in general

Copy link
Contributor

@Malkierian Malkierian Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to register an OnItemReceive hook and check for ITEM_SWORD_MASTER to get that trigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for the unpatching, but then doesn't work for the original patching out the MS.

@Pepper0ni
Copy link
Contributor

I'll give this a test when the conflicts are fixed

Copy link
Contributor

@Pepe20129 Pepe20129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be VBified + changed to not use OnGameFrameUpdate but I think it's a good idea to merge now and improve later as this has been open for a long time.

@Patrick12115
Copy link
Contributor Author

Patrick12115 commented Oct 28, 2024

This should probably be VBified + changed to not use OnGameFrameUpdate but I think it's a good idea to merge now and improve later as this has been open for a long time.

I made it to where it's only conditionally using OnGameFrameUpdate, whenever the B button is changed and added handling if you have fishing rod on B

Copy link
Contributor

@Pepper0ni Pepper0ni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Malkierian
Copy link
Contributor

If this doesn't work with custom models, is there something setup to prevent attempting to patch when alt versions of the applicable assets are loaded?

@Patrick12115
Copy link
Contributor Author

Yes, there is already previously added failsafes in ResourceMgr_PatchGfxByName that prevents any patching to Alt Assets because the DL's usually don't match up properly for Alt Assets for things like cosmetic editor. It was the failsafe put in to prevent the crashing when you would have a cosmetic changed and then try to load an Alt asset issue that we had for a bit a while back. However the custom equipment DL will be able to handle hiding the sword and sheath for future mods that use that system, just cannot work with existing mods.

@aMannus
Copy link
Contributor

aMannus commented Jan 11, 2025

I want to get this in, but would like to have it behind shipinit and maybe hookify the code left in the vanilla code with a VB_Should or something. I've spoken to Pat and said I might take a look at this myself sometime soon.

@aMannus aMannus added this to the 9.0.0 milestone Jan 11, 2025
@aMannus
Copy link
Contributor

aMannus commented Feb 4, 2025

Closing in favour of #4989

@aMannus aMannus closed this Feb 4, 2025
@Patrick12115 Patrick12115 deleted the NoMS branch October 21, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants