2026-09-06 14:38:17 +02:00
2026-09-06 14:38:17 +02:00
2026-09-06 14:38:17 +02:00
2026-09-06 14:38:17 +02:00
2026-09-06 14:36:26 +02:00
2026-09-06 14:38:17 +02:00

garrysmod-coop

Persistent progression and rewards shop

Players earn Lifetime Score and spendable Credits for eligible monster kills; harder enemies award more. Lifetime Score determines rank and never decreases. Every ten connected minutes also awards five Credits. Shop purchases deduct Credits only. Changes remain in memory during active play and are written to Garry's Mod's SQLite database at garrysmod/sv.db only when the server is empty or shutting down, avoiding gameplay stalls from synchronous SQLite I/O.

Dying deducts up to five Credits, stopping at zero. It never deducts Lifetime Score and therefore cannot lower a player's rank.

Player controls:

  • F3, chat !shop, or client console coop_shop: open the rewards shop
  • Chat !points: print personal Score, Credits, rank, and total playtime
  • Chat !musicmute or client console coop_music_mute: toggle purchased server music locally
  • Client console coop_music_volume 0.0 through coop_music_volume 1.0: set music volume
  • With Hoverpack enabled, jump normally and continue holding Space to hover
  • Hold TAB: compare connected players' Lifetime Scores, ranks, and total playtime

The shop contains persistent Half-Life 2 player models and permanent bonus weapon unlocks. Only one bonus weapon is equipped at a time. It also contains a Music category. Buying a song unlocks it permanently; selecting Play broadcasts it to all connected players. One song can play at a time, with a short cooldown afterward. Each player can mute or adjust the music locally.

The permanent weapon catalogue contains all thirteen spawnable weapons from the gamemode's CO-OP Q-menu category: Glock, P228, USP, Five-Seven, MAC-10, MP5, Pump Shotgun, FAMAS, AK-47, M4A1, Desert Eagle, Automatic Shotgun, and M249. The separate Workshop novelty weapons remain available at their higher prices.

Music entries may set spatial = true plus minimumDistance and maximumDistance. Spatial music follows the buyer's character while they move and fades over distance. Supply spatial audio as 44.1 kHz mono MP3 or WAV for reliable in-game positioning.

The Behaviours category contains persistent, toggleable player abilities. The Hoverpack costs 500 Credits by default and is enabled immediately after buying it. A short Space press remains a normal jump; holding Space for 0.3 seconds in the air maintains altitude and rises slowly. Releasing Space stops thrust and restores normal gravity. Pressing and holding Space again can restart thrust while still airborne. Thrust consumes the standard AUX power meter and stops at zero. After a 1.25-second pause with Space released, AUX recharges while waiting and recharges faster while walking; active sprinting does not receive the extra hoverpack recharge. Its built-in looping thruster sound follows the player and is audible to nearby players.

God Mode is a non-permanent Behaviour purchase. Each activation costs 1,000 Credits by default and immediately grants 90 seconds of server-enforced damage immunity. It creates no ownership record. Attempting to activate it while it is already running reports the remaining time and does not spend Credits.

A cheaper 30-second God Mode is available for 400 Credits by default. It follows the same rules and does not stack with an already active God Mode timer.

The Player Trails category contains permanent trail unlocks with one equipped at a time. The included choices use Garry's Mod's built-in LOL, love, plasma, electric, laser, and smoke materials, so they require no extra downloads. The rainbow plasma trail cycles colour continuously. Equipping No Trail disables the effect without removing purchased trails.

The Entities category contains consumable deployables. Aim at a clear floor and purchase one to spawn it there. Default prices are 10 Credits for a Bouncy Ball, 20 for a cyan Glowstick, 25 for a Health Kit, 35 for a Suit Battery, 60 for an Explosive Barrel, 125 for a five-second 250-damage TNT charge, and 150 for the red damage-triggered Nuke Pack TNT. The red charges can chain-react. These are not permanent unlocks; every spawned item is a separate purchase.

The Helping NPCs category contains consumable Resistance reinforcements. Default prices are 175 Credits for a Rebel, 275 for a Rebel Paramedic, 325 for Barney, 350 for Alyx, 400 for Father Grigori, and 500 for a friendly floor turret. Their kills never award Score or Credits. Per-player active-spawn limits remove the oldest purchases when exceeded, and remaining purchases are removed when their buyer disconnects.

The server checks all kills, balances, live prices, ownership, equipment, and music playback. A purchase request contains only the item type and ID: clients cannot award points, submit a purchase price, or debit their own Credits.

Administrators get an Admin Prices tab in the F3 shop. Select an item, enter a non-negative Credit price, and save it. The server permission-checks and persists the change in SQLite, then broadcasts the new catalogue to all connected clients. For testing, an administrator who cannot afford an item is allowed to unlock it without a Credit charge; the server reports the shortfall and Credits remain at their current non-negative value. Set Progression.AdminShopTestingBypass to false to disable this behavior. The equivalent server/admin console command is:

coop_setprice <model|weapon|music|behaviour|trail|entity|helper> <item_id> <credits>

For example: coop_setprice music song_id 500. The maximum accepted price is 100,000,000 Credits. Existing owners retain their unlocks when a price changes.

Configuration is in gamemode/progression_shared.lua:

  • Progression.Ranks: rank names and Lifetime Score thresholds
  • Progression.Models: player-model catalogue and prices
  • Progression.Weapons: bonus-weapon catalogue and prices
  • Progression.Music: music catalogue, default prices, paths, and durations
  • Progression.Behaviours: toggleable ability catalogue and default prices
  • Progression.Trails: player-trail materials, colours, properties, and prices
  • Progression.Entities: consumable entity catalogue, spawn settings, and prices
  • Progression.Helpers: friendly NPC catalogue, equipment, variants, and prices
  • Progression.ShopSpawnDistance and Progression.Purchased*Limit: safe spawning distance and per-player cleanup caps
  • Progression.Hoverpack*: hover delay, rise speed, AUX drain/recharge rates, and thruster sound settings
  • Progression.Playtime*: in-memory update rate, reward interval, and Credits
  • Progression.MonsterClasses: NPC classes and their Score/Credit rewards

Catalogue prices are initial defaults. Once seeded, live prices come from the custom_coop_shop_prices SQLite table so in-game edits survive crashes and restarts.

Music files are not bundled with this repository. Every server owner must supply the audio files referenced by their Progression.Music entries, place them under garrysmod/sound/, and reconnect clients so the server can send them. The gamemode automatically registers every configured file with resource.AddFile. Keep locally supplied audio outside the gamemode source tree and distribute or back it up separately.

Player-spawned NPCs and unknown/friendly NPC classes do not award points.

S
Description
No description provided
Readme GPL-3.0
6.8 MiB
Languages
Lua 100%