GR1M Docs

Minigames

Free shared minigames used by GR1M resources (and yours). The first game is a first-person layered lockpick (analog cylinder give, bind tracking, pick strain).

v1.3.0Needs ox_lib

This resource does not unlock doors or consume items. Callers await a boolean and apply their own rewards.

#Timing bar and rummage

#Tattoo needle

#Install

Start after ox_lib:

ensure ox_lib
ensure GR1M_Minigames

#Dependencies

#Exports

-- Preferred
local ok = exports['GR1M_Minigames']:Start('lockpick', {
    difficulty = 'medium', -- easy | medium | hard | master, or 1-5
    attempts = 3,          -- optional override
})

-- Alias matching the old lockpick resource (not wired to doors yet)
local ok = exports['GR1M_Minigames']:startLockpick(3)

exports['GR1M_Minigames']:IsEnabled()

Start returns true only when the cylinder turns. Fail, snap, cancel, and death all return false.

#Difficulty

KeyBindTrackingPicksNotes
easywidestatic5Full give is generous
mediummediumslight follow3Default
hardtightfollows plug2Worn wobble
mastertinyfollows + jitter1Fast strain

Tune in config/shared.lua.

#Lockpick art

Layered PNGs live in web/img/lockpick/ and share pivots in layout.json. The pick is one true-alpha image whose tip sits in the keyhole; the handle orbits that pivot. Rebuild with:

python tools/build_lockpick_layers.py

#Adding later minigames

Keep lockpick in web/js/lockpick.js. New games get their own JS module; Lua Start(name, opts) already keys off name.

Medical

Design source: the approved mockup gr1m-procedures.html (v3). Games are drawn on canvas in the same dark clinical look. The games only report what happened; GR1M_Medical applies every medical effect server side.

#Client exports

-- Blocks until the game ends. name: 'surgery' | 'cpr' | 'iv' | 'defib' | 'splint' | 'anaesthesia'
local result = exports.GR1M_Minigames:Start(name, opts)

Common opts:

Per game opts:

result table (always has success boolean, cancelled boolean):

exports.GR1M_Minigames:Spectate(name, state, info)  -- show/update the spectator view (patient's screen)
exports.GR1M_Minigames:StopSpectate()
exports.GR1M_Minigames:Feed(session, data)          -- live input from a teammate, e.g. { depth = 62 } or { suction = true }
exports.GR1M_Minigames:Cancel()

#Client events fired by GR1M_Minigames (local TriggerEvent)

#Spectator view

Spectate shows a passive version of the same game (no input) in a picture-in-picture panel bottom right, fed by the state snapshots relayed through the server. GR1M_Medical wraps it with the patient's state line and narration feed, and applies the blur / darkness (asleep, unconscious) itself through info: { state = 'GENERAL ANAESTHETIC', blur = 7, dark = 0.6, feel = '...' }.

#Implementation notes and additions (v1.1.0)

Files: client/medical.lua, web/js/medical-*.js (core + one file per game), web/css/medical.css. Start('lockpick', …) still returns a boolean; every medical name returns the result table. Escape cancels (cancelled = true); after the end banner shows, Escape just closes early with the real result.

Additions to the contract above: