Skip to content
 
 

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UM Ledge Climb

Grab and climb ledges while jumping or falling
Fork of Wuabooo/wuabo_ledgeclimb by WuaboFX

What it does

GTA already lets you climb some ledges. This makes it work while you're in the air, so you can jump a gap, drop off a roof, or fall down a wall and catch the edge on the way past.

While you're airborne it runs two checks every frame:

  1. Look around you for a wall.
  2. Drop a probe down the front of that wall to find the top of it.

If the top surface is within reach and flat enough, it grabs.

Install

Drop the folder in your resources and add this to your server.cfg:

ensure um_ledgeclimb

Client side only. No dependencies and no server script.

Config

Everything lives in config.lua. Bad values get clamped or fall back to the default instead of breaking the resource, so you can't really wreck it by typing the wrong thing.

Key Default What it does
enabled true Master switch
maxReach 1.35 Highest ledge you can grab, in metres above your feet
minReach 0.0 Lowest ledge you can grab. Negative works and grabs earlier on the way down
wallDistance 0.8 How far out to look for a wall
wallProbeHeight 0.2 Height of the lowest wall probe. See below, this one matters
grabCooldown 500 Minimum gap between grabs, in ms
minSurfaceNormalZ 0.7 How flat the top has to be. 1.0 is dead level, 0.0 is vertical
climbFast false Launch force flag passed to TaskClimb
idleInterval 0 Loop wait while on the ground. Leave at 0
postGrabDelay 500 Pause after a grab so the animation can start
climbVerifyDelay 150 How long to wait before checking the climb actually took
synchronousTrace true Same frame probe. false uses the older async one
searchAllDirections true Sweep all around you instead of only where you face
autoFace true Turn toward the ledge before climbing
debug false Start with the overlay on. Leave this off on a live server

wallProbeHeight

This is the one that decides how fast the grab feels.

The wall probe is level, so it can't touch a wall until it has dropped below the top of that wall. Set it to 0.7 and you have to fall 0.7m past the edge before anything can happen, which feels sluggish. Set it low and it catches the edge almost as soon as you go past. Two more probes are swept above it automatically so tall walls still get picked up.

Too low and it starts catching kerbs and steps, so 0.2 is a decent middle.

Debug and tuning

/ledgeclimb_debug draws both probes in the world and shows what the script is seeing. The probes keep running while you stand still, so you can walk up to a ledge and watch it react.

  • Grey or dim red line: probe found nothing
  • Cyan line and sphere: found a wall, that's where the down probe starts
  • Red line and sphere: found a top surface but rejected it
  • Green line and sphere: good, this will grab

The readout tells you the measured ledge height, the surface angle, and why the last check passed or failed.

/ledgeclimb_menu puts the settings on screen so you can tune with the arrow keys instead of typing commands mid jump.

  • Up and down to move
  • Left and right to change the value
  • Enter to print the current values to console

When it feels right, press Enter, open F8, and paste the block it prints over the Config table in config.lua. Nothing you change at runtime is saved.

Commands

Command What it does
/ledgeclimb_debug Toggle the overlay
/ledgeclimb_menu Toggle the tuning menu
/ledgeclimb_set <key> <value> Change one value for this session
/ledgeclimb_dump Print current values as a config block
/ledgeclimb_reload Throw away runtime changes

These are client side and unrestricted, so any player can run them on their own client. It only affects them. If you'd rather they couldn't, delete the RegisterCommand calls at the bottom of client/main.lua and use the exports instead.

Exports

exports.um_ledgeclimb:setEnabled(false)
exports.um_ledgeclimb:setEnabled(true)
exports.um_ledgeclimb:isEnabled()
exports.um_ledgeclimb:setDebug(true)
exports.um_ledgeclimb:reloadConfig()

Handy for turning it off during a minigame or a cutscene.

What's different from the original

Detection side:

  • Shape test results are polled properly instead of being read before they're ready
  • The wall probe keeps its full reach when the ped is pitched over, which is what happens the whole time you're falling
  • The probe runs level instead of sloping upward, and sweeps three heights so it catches the edge much sooner
  • It looks all around you, not just where you're facing, so jumping backwards off a roof still works
  • Surface angle is checked, so sloped roofs and rockfaces don't count as ledges
  • Probes ignore peds, ragdolls, water, glass and foliage

Behaviour:

  • A climb the game refuses no longer eats the full cooldown
  • More state guards, so it won't fire while dead, swimming, cuffed, already climbing or parachuting

Plus the debug overlay, the tuning menu, the exports and config validation.

Credits

Original by WuaboFX, Wuabooo/wuabo_ledgeclimb. The detection approach is his, this fork just tightens it up.

About

Allows players to grab and climb ledges while jumping or falling

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages