Skip to content

fix: G2 locked doors and chests open with their key again, and lock picking works in G2 - #537

Merged
JaXt0r merged 1 commit into
developfrom
fix/g2-lock-sounds
Nov 22, 2026
Merged

JaXt0r merged 1 commit into
developfrom
fix/g2-lock-sounds

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

In Gothic 2, a locked door or chest opens with its key again, and lock picking works.

  • VmService: the lock pick sound names (PickLockSuccess/Failure/Broken/UnlockSoundName) no longer throw when the
    game has no _STR_SOUND_PICKLOCK_* symbol. G2 has none, so its SFX instances PICKLOCK_SUCCESS, PICKLOCK_FAILURE,
    PICKLOCK_BROKEN and PICKLOCK_UNLOCK are used. G1 is unchanged.

Why

Playtest 2026-11-22 (G2 Night of the Raven, PCVR build from develop): with the key in the backpack or in the hand,
touching the locked chest in Xardas' tower did nothing (no comment, no opening). Without the key the hero said
"$PICKLOCKORKEYMISSING", so only the key path was broken. The session log shows why:

[MobLock] Key 'ITKE_XARDAS' in the inventory opens ''.
[VrLockTouchService] Lock touch check failed: System.NullReferenceException
  at Gothic.Core.Services.Vm.VmService.get_PickLockSuccessSoundName ()
  at Gothic.VR.Adapters.Vob.LockPicking.VRContainerDoorPickingInteraction.OnEmptyHandTouched (...)
[Lock] Key unlock: 'ITKE_XARDAS' matched.
NullReferenceException: Object reference not set to an instance of an object

The sound is played before LockPickComboFinished and UnlockAndPushOpen, so the exception stopped the unlock.
The same getters are used on every lock pick step, so picking a lock threw in G2 too. The experimental branch had this
fix (9debdbd); only its hand roll part reached main. No issue exists for it.

How to test manually

  • G2: Xardas' tower at the start, the locked chest upstairs, with ITKE_XARDAS in the backpack: touch the
    chest with an empty hand - unlock sound, the lid opens.
  • G2: same with the key held in the hand and pushed into the chest.
  • G2: a chest with a lock pick combination (e.g. in the bandit camp near Xardas) - picking plays the
    success/failure/broken sounds and opens the lock, no NullReferenceException in the log.
  • G1: lock picking a chest in the Old Camp still plays the G1 sounds.

Save/load

No new state. An unlocked chest/door is saved as before (IsLocked = false on the VOB).

Known gaps / follow-ups

  • Compiled in the Editor together with the other fixes from the same playtest (EditMode tests 87/87), not play tested yet.
  • key $PICKLOCKORKEYMISSING not (yet) implemented (LogCat Misc) is still logged; the SVM line plays anyway.

AI usage

Claude found the cause in the user's session log and ported the fix from the experimental branch. The user found the
bug in a playtest.

…icking works in G2

G2 has no _STR_SOUND_PICKLOCK_* symbols. The sound name getters called GetString(0) on null, the
NullReferenceException stopped the unlock before LockPickComboFinished, so a key (in the backpack or in the
hand) never opened the lock and every lock pick step threw. G2 uses its SFX instances PICKLOCK_SUCCESS/
FAILURE/BROKEN/UNLOCK instead, like the experimental branch did (9debdbd).
@JaXt0r
JaXt0r merged commit fde0bad into develop Nov 22, 2026
1 check passed
@JaXt0r
JaXt0r deleted the fix/g2-lock-sounds branch November 22, 2026 14:07
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.

2 participants