Zaliteam-HalfLifeLadders icon

HalfLifeLadders

Climb ladders while holding two-handed scrap, auto-climb by walking forward (Half-Life style), and jump off mid-climb with Space.

Last updated a day ago
Total downloads 33
Total rating 0 
Categories Mods Client-side Tweaks & Quality Of Life AI Generated
Dependency string Zaliteam-HalfLifeLadders-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Half-Life Ladders (Two-Handed Climbing & Auto-Climb)

Climb any ladder while carrying two-handed scrap (engines, axles, bodies, etc.), auto-latch onto ladders by simply walking forward into them (Half-Life 1 style), and leap off ladders mid-climb with Space.


Player Guide (Simple Overview)

How It Works

  • Climb With Two-Handed Items: You no longer have to drop heavy two-handed scrap at the bottom of extension ladders, fire escapes, or facility shafts.
  • Walk-Up Auto-Climb: Walking (W / forward movement) toward a ladder automatically grabs and starts climbing it—no need to hunt for the [E] prompt (manual [E] interaction still works too).
  • Updated Prompt: Looking at any ladder shows Climb : [Walk / W] or [E].
  • Spacebar Jump-Off: Press Space while on a ladder to detach and push off backward/upward so you can hop onto ledges or bail quickly.
  • Client-Side: Only you need this mod installed to use it; climbing syncs through vanilla ladder triggers.

Configuration (BepInEx/config/com.khameli0n.halflifeladders.cfg)

Section Key Default Description
Ladders EnableTwoHandedLadders true Allows climbing all ladders while holding two-handed items.
Ladders EnableAutoLadderClimb true Automatically mounts ladders when walking forward into them.
Ladders LadderBoostForce 4.5 Horizontal push force applied when jumping off a ladder with Space.

Technical Details (For Developers)

  • Plugin GUID: com.khameli0n.halflifeladders
  • Target Framework: netstandard2.1 (BepInEx 5 / HarmonyX)
  • Side: Client-side (PlayerControllerB.IsOwner gated).

Harmony Patches (HalfLifeLadders.Patches.LadderPatches)

Target Method Type Behavior
PlayerControllerB.Update Prefix Reconfigures the currently hovered ladder trigger and periodically (1.5s interval) scans Object.FindObjectsOfType<InteractTrigger>() to enable two-handed climbing across all ladders (including spawned/extension ladders).
PlayerControllerB.Update Postfix Updates hover prompt text, intercepts Space/jump input during isClimbingLadder, and runs walk-up proximity detection to auto-mount ladders.
PlayerControllerB.SetHoverTipAndCurrentInteractTrigger Prefix & Postfix Applies ladder trigger flags before vanilla checks and updates cursorTip.text afterward.

Detection & Climbing Implementation

  • Ladder Identification (IsLadderTrigger): Matches any InteractTrigger where trig.isLadder == true, trig.name contains "ladder" (case-insensitive), or trig.hoverTip contains "Climb" (case-insensitive).
  • Trigger Patching (ConfigureLadderTrigger): Sets isLadder = true, twoHandedItemAllowed = true, oneHandedItemAllowed = true, specialCharacterAnimation = false, holdInteraction = false, and interactable = true.
  • Jump-Off (HandleLadderJumpOff): Checks Keyboard.current.spaceKey.wasPressedThisFrame, UnityInput.Current.GetKeyDown(KeyCode.Space), and playerActions.Movement.Jump.triggered. Calls CancelSpecialTriggerAnimations(), re-enables thisController, moves by (-transform.forward * LadderBoostForce + Vector3.up * 3.5f) * Time.deltaTime, and enforces a 0.55fs re-mount cooldown (jumpCooldownTime).
  • Walk-Up Auto-Mount (FindWalkUpLadderTrigger & MountLadder):
    • Active when not climbing, not in special animation/terminal/chat, forward input (moveInputVector.y > 0.1f or W) is held, and jumpCooldownTime / 0.4fs lastMountTime cooldowns have elapsed.
    • Checks hoveringOverTrigger within 2.2fm first, then Physics.OverlapSphere(origin, 1.35f, -1, QueryTriggerInteraction.Collide), requiring sqrMagnitude < 0.05f or horizontal Vector3.Dot(forwardDir, toTrigger.normalized) > 0.15f.
    • Temporarily caches and clears player.twoHanded and player.isInHangarShipRoom inside a try/finally block around ladderTrigger.Interact(player.thisPlayerBody) so vanilla's InteractTrigger validation accepts the mount.