GR1M Docs

Skills

Server-authoritative skill trees for Qbox and QBCore: 15 categories, XP, skill points and perks.

v3.0.0Needs ox_lib, oxmysql

Features:

Clean-room implementation. Executable code is the source of truth; this README matches current registration and config.

Deployment default: Config.Deployment.mode = 'live' (authoritative XP + effects). Shadow is available for a trial period that records projected XP without changing anything.


#Current categories (15)

The scripts named below are optional integrations. Each category works on its own with GR1M's built-in trackers; when a named script is running, its actions also give XP and its perks apply. To hide a category, give it a visibility rule in config/categories.lua (for example a permission nobody holds).

CategoryStateNotes
AthleticsAvailableMovement trackers + gym actions + stamina recovery
CombatAvailableBuiltin aim/sway/melee + holster consumer
DrivingAvailableBuiltin control/flip/engine + lc_fuel where configured
AviationAvailableBuiltin aircraft control + protection
LarcenyAvailableLockpick + ProjectX robbery + bablo chop consumers
HackingAvailableGR1M_Carkeys timer/strikes/alert consumers
FishingAvailableDepends on pug-fishing for full effect honesty
MedicalAvailableJob-gated (ambulance); wasabi_ambulance_v2 bridges + fatigue builtin
PolicingAvailableJob-gated (police / bcso / sasp / marshals); wasabi_police + kartik-evidence consumers
MechanicsAvailableGR1M_Mech bay effects + GR1M_Parts buy discount
CraftingAvailableGR1M_Craft artisan effects; mining via r1z_mining; GR1M_Parts sell bonus
CookingAvailableenvi-restaurants quality/yield/hygiene remaps
DistillingAvailableGR1M_Distillery mash, still, cut warning, bottling windows + bonus bottle roll
SurvivalAvailableHunting/camping + GR1M_Zombies noise/loot hooks
Zombie SlayerAvailableXP from GR1M_Zombies kills (also Combat XP); damage, headshot, Tank/Witch, cripple, toughness, bite resist, antibodies, stealth and loot hooks in GR1M_Zombies

Most categories use visibility = always. Medical and policing hide from the console unless the player holds a matching job. Medical / policing / mechanics still gate XP via xpAccess (job + duty). Off-duty job holders still see the tree. Job/duty changes refresh an open console.

A category's XP and perks need the resources named in its row; the rest of the categories work without them. Add your own activities in config/integrations.lua and call exports.GR1M_Skills:RecordActivity from your scripts.


#Deployment modes

ModeXP / ledgerUnlocks / respecEffectsNotes
shadowProjected ledger (shadow / projected series)Rejected / non-mutatingNeutral / non-authoritativeDual-record with legacy adapters where present
live (default)Applied durable XPMutating (when not frozen)AuthoritativeNormal operation
rollbackFreeze = trueIntake continues as rollback / projected-rejectMutations blockedFrozen / neutral per implementationEmergency; restore legacy writers only after freeze confirmed

Switching modes is never automatic; change Config.Deployment.mode and restart.


#Activity and XP model

Preferred API: exports['GR1M_Skills']:RecordActivity(source, category, actionId, context)

Restricted compatibility: AddXP(source, category, amount, reason) — allowlist gr1m_skills, ca_skills only. ca_skills is further blocked when live or rollback-frozen. Prefer RecordActivity.

Movement XP uses client samples with server plausibility clamps and vehicle-class allow/deny lists.


#Points and unlocks


#Effects

Effect dispositions (Phase 4):

Remaps currently: cooking prep/fire/tolerance/ingredient-saver; fishing rod/net; hacking preview/gear/reward; medical diagnose/transport; policing dispatch; crafting tool-preservation; survival tracking/traps (zombie noise/loot, not hunting).

Hacking effects apply in GR1M_Carkeys only. op-crime / robberies_creator panel hacks award XP (crime_hack / panel_hack) and do not consume hack timers.

GR1M_Parts applies parts_sell_bonus (crafting) and parts_buy_discount (mechanics) to community-shop unit prices on the server. The NUI shows those adjusted prices. Sell is clamped so it cannot meet or exceed that player's skilled buy price. Selling or buying does not award XP (craft_complete already paid when the part was made).

Modifier conflict gates prevent blind 1.0 restores when contested. Carry weight uses the server weight broker and requires ox_inventory for carry nodes.

Basic physical effectiveness degradation remains active (Config.Degradation.enabled = true) for athletics/combat/driving/aviation. XP, levels, points, and unlocks never decay. The unused Config.Degradation.rules table and its docs were removed; only the fields read by server/degradation.lua apply.


#Framework and identity


#Inventory and modifiers


#Migration (two distinct systems)

#Schema / legacy character migration

skills_migrate preview|report|apply CONFIRM

Offline characters; schema v3; not tree-versioning.

#Tree-version migration

skills_tree_migrate …

Preview / apply / review / resolve; journal; unlock archive; migration credit; idempotent identity. Separate from schema migrator.


#Telemetry and retention

Admin: skills_ops status|pace|action|limits|retention|ledger|aggregate


#Public API (server exports)

Registered in server/api.lua (resource name as started, typically GR1M_Skills):

ExportRole
RecordActivityPreferred XP intake
AntiFarmGate / AntiFarmCommit / AntiFarmCheckActor / AntiFarmRecordActorAntifarm
RegisterEffectConsumer / GetEffectConsumerSnapshot / AcknowledgeEffectAppliedConsumer registry
RegisterCarryWeightContribution / ClearCarryWeightContributionWeight broker
GetFrameworkLifecycle / GetDeploymentMode / IsAuthoritativeLifecycle / mode
GetCategoryProgress / GetCategoryXP / GetEffects / RollEffectQueries / rolls
HasUnlockedSkill / GetSkillRank / GetEffectiveSkillRankOwnership
GetSkillEffect / GetEffectValue / GetDurabilityEffects
AddXPDeprecated allowlisted grant
AddSkillPoints / ResetSkillsAdmin mutation allowlist
RegisterExternalCategory / RegisterSkillEffectHandler / RegisterVisibilityHandler / RegisterUnlockHandlerExtension
ReportIntegrationHealthHealth

HasUnlockedSkill is effective ownership (GetEffectiveRank > 0): disabled, pending-migration, and unoffered nodes return false. GetSkillRank stays the raw stored rank. GetCategoryXP returns { xp, level, intoLevel, nextLevelXp } — do not treat it as a number.

Client exports: RegisterClientEffectHandler, GetClientEffectValue, GetDeploymentMode, IsAuthoritative, GetClientOwnershipHealth, SetModifierLayer, ClearModifierLayer, GetResolvedModifier, GetModifierHealth.


#Tree builder (admin NUI)


#Operator commands

CommandPurpose
/skills or F7Open NUI (Config.OpenCommand / OpenKeybind)
skills_grantxp / skills_grantpoints / skills_reset / skills_debugAdmin progression
skills_ops …Telemetry / pace / retention / ledger / aggregate
skills_payment_opsUnresolved payment journals (read-only)
skills_migrate …Schema / legacy migration
skills_tree_migrate …Tree-version migration

Permission: ACE gr1m_skills.admin (or framework group fallback). Console (source 0) allowed.


#Requirements

#Install

  1. Place resource as GR1M_Skills.
  2. Optional: import sql/gr1m_skills.sql (auto-schema also runs on start).
  3. Ensure order: oxmysql → ox_lib → framework → ox_inventory → the resources that report XP → GR1M_Skills.
  4. add_ace group.admin gr1m_skills.admin allow
  5. Default mode is live; use shadow for a trial run.

#Configuration entry points

FilePurpose
config/config.luaCurve, XP, deployment, migration, respec, admin, builder, effects baselines
config/telemetry.luaTelemetry + retention safe defaults
config/lifecycle.luaFramework provider lifecycle
config/categories.luaCategories
config/trees/*.luaTrees
config/effects.lua / effects_phase4.luaCatalog + dispositions
config/integrations.luaActivities + allowlists
config/antifarm.luaCaps
config/tree_migrations.luaTree migration registry mode

#Known limitations