deathride58-Dislodge_Key icon

Dislodge Key

Prevents keys from immediately reinserting when grabbed, making Container Yard playable in Patch 6

Last updated 4 days ago
Total downloads 272
Total rating 1 
Categories Code Mods
Dependency string deathride58-Dislodge_Key-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

LavaGang-MelonLoader-0.7.0 icon
LavaGang-MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono

Preferred version: 0.7.0

README

Dislodge Key

Container Yard in Patch 6 but actually playable (Yes, this is Patch 6)

This is a mod that fixes a bug in Patch 6 that makes all key receivers immediately re-insert their keys when attempting to eject their key. Very simple! Very straight-forward!

In laymen's terms, this allows you to pick up the void core in Container Yard (which, internally, is just a key), allowing you to get the Container Yard achievement legitimately on Patch 6.

Known issues

Some key receivers will eject their key in unusual or unexpected directions when grabbed, potentially reinserting the key. You can avoid reinsertion by pulling in the direction that the receiver ejects in when you grab the key.

If any arbitrary object is swiped in a key receiver's interaction zone while the key is still within it, then the key will be reinserted. This is, to be fair, an incredibly hyperspecific edge case, but is worth a mention regardless.

Technical details

This mod hooks into both KeyReceiver and KeycardReceiver, and does the same thing for both.

Additionally, this mod makes the assumption that if a key is not meant to be taken out (ie: the correct keycard is placed into a keycard reader), then OnMagazineGrabbed will never be called when you attempt to grab the key. In vanilla content, this is always the case.

When a key is grabbed, OnMagazineGrabbed gets called. In vanilla, this immediately sets the KeyReceiver's state to Empty, causing the key to immediately reinsert itself on the next frame due to OnInteractibleHostEnter being called, which handles the re-insertion logic.

With this mod, OnMagazineGrabbed will set the KeyReceiver's state to Ejecting, which is the condition under which OnInteractibleHostEnter will immediately return.

When OnInteractibleHostExit is called (which occurs when you take the key outside of the trigger box), this mod's code sets the KeyReceiver's state to Empty, allowing the receiver to accept the key again.

Fusion compatibility has not been tested. Quest compatibility also not tested.