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 one Lifetime Score and one spendable Credit for every eligible monster kill. Lifetime Score determines rank and never decreases. Shop purchases deduct Credits only. Data is committed immediately to Garry's Mod's SQLite database at garrysmod/sv.db.

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, and rank
  • 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 all connected players' Lifetime Scores and ranks

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.

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.

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> <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.Hoverpack*: hover delay, rise speed, AUX drain/recharge rates, and thruster sound settings
  • Progression.MonsterClasses: NPC classes that award points

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.7 MiB
Languages
Lua 88.9%
Python 4%
JavaScript 3.3%
CSS 2.7%
HTML 1.1%