Skills
Server-authoritative skill trees for Qbox and QBCore: 15 categories, XP, skill points and perks.
Features:
- Per-category XP and skill points
- Tree unlocks (prerequisites, blockers, multi-rank)
- Server-owned action registry (
RecordActivity) - Transactional unlock / respec mutations
- Effect resolution and capability-gated nodes
- Tree-version migrations with migration credit
- Telemetry, pace reporting, and operational tooling
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).
| Category | State | Notes |
|---|---|---|
| Athletics | Available | Movement trackers + gym actions + stamina recovery |
| Combat | Available | Builtin aim/sway/melee + holster consumer |
| Driving | Available | Builtin control/flip/engine + lc_fuel where configured |
| Aviation | Available | Builtin aircraft control + protection |
| Larceny | Available | Lockpick + ProjectX robbery + bablo chop consumers |
| Hacking | Available | GR1M_Carkeys timer/strikes/alert consumers |
| Fishing | Available | Depends on pug-fishing for full effect honesty |
| Medical | Available | Job-gated (ambulance); wasabi_ambulance_v2 bridges + fatigue builtin |
| Policing | Available | Job-gated (police / bcso / sasp / marshals); wasabi_police + kartik-evidence consumers |
| Mechanics | Available | GR1M_Mech bay effects + GR1M_Parts buy discount |
| Crafting | Available | GR1M_Craft artisan effects; mining via r1z_mining; GR1M_Parts sell bonus |
| Cooking | Available | envi-restaurants quality/yield/hygiene remaps |
| Distilling | Available | GR1M_Distillery mash, still, cut warning, bottling windows + bonus bottle roll |
| Survival | Available | Hunting/camping + GR1M_Zombies noise/loot hooks |
| Zombie Slayer | Available | XP 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
| Mode | XP / ledger | Unlocks / respec | Effects | Notes |
|---|---|---|---|---|
shadow | Projected ledger (shadow / projected series) | Rejected / non-mutating | Neutral / non-authoritative | Dual-record with legacy adapters where present |
live (default) | Applied durable XP | Mutating (when not frozen) | Authoritative | Normal operation |
rollbackFreeze = true | Intake continues as rollback / projected-reject | Mutations blocked | Frozen / neutral per implementation | Emergency; 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)
- Actions are registered in
config/integrations.lua(Integrations.activities) - Category, duration policy, difficulty, and risk are server-owned
- Caller duration/quality ignored unless
allowCallerDuration/allowCallerQualityon the action - Idempotency keys validated server-side
- Token bucket + category cooldown + antifarm caps apply
- In shadow, outcomes are projected; in live, applied
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
- Levels grant per-category points (
PointsPerLevel) - Trees: AND/OR requires, blockers, multi-rank, tier budgets
- Unavailable nodes (missing consumers) cannot be purchased; NUI shows unavailable
- Unlock / respec are transactional (payment journal + mutation receipts)
- Migration credit for tree edits (credit-only refunds; no double-refund via spent reduction). Point debt is retired (full wipe / no legacy migration).
- Shadow rejects normal unlock/respec mutations
#Effects
Effect dispositions (Phase 4):
- builtin_verified / external_verified — wired consumers that match the effect label
- partial_honest — bonus applies, remapped onto a nearby knob (still purchasable)
- disabled_missing_consumer — node unavailable; not advertised as working
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
- Provider:
Config.Lifecycle.Framework/Config.Framework = 'auto'(qbx_core then qb-core) - Startup grace, provider loss → frozen mutations, character reload after recovery
- Duplicate citizen-ID protection
- Standalone: reduced gates (no money/job/gang) if intentionally used
#Inventory and modifiers
RegisterCarryWeightContribution/ clear — resource-namespaced- Base validation + composition; restore exact base when GR1M contribution clears
- Client modifier layers with conflict health; conditional profile/vehicle restoration
#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
- Extends daily
activity_metrics; adds hourly aggregates and player-hour sessions - Ledger aggregation receipts prove per-row coverage before any delete
- Pace: XP/online, XP/eligible (medical/police duty), XP/active, actions/online; p10/p50/p90 or refuse if population truncated
- Telemetry gaps after unclean restart;
data_completeflags - Retention defaults:
enabled = false,policy = 'retain_only',dryRunOnStartup = true— install deletes nothing - Historical uncovered ledger rows retained until
skills_ops aggregate backfill
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):
| Export | Role |
|---|---|
RecordActivity | Preferred XP intake |
AntiFarmGate / AntiFarmCommit / AntiFarmCheckActor / AntiFarmRecordActor | Antifarm |
RegisterEffectConsumer / GetEffectConsumerSnapshot / AcknowledgeEffectApplied | Consumer registry |
RegisterCarryWeightContribution / ClearCarryWeightContribution | Weight broker |
GetFrameworkLifecycle / GetDeploymentMode / IsAuthoritative | Lifecycle / mode |
GetCategoryProgress / GetCategoryXP / GetEffects / RollEffect | Queries / rolls |
HasUnlockedSkill / GetSkillRank / GetEffectiveSkillRank | Ownership |
GetSkillEffect / GetEffectValue / GetDurability | Effects |
AddXP | Deprecated allowlisted grant |
AddSkillPoints / ResetSkills | Admin mutation allowlist |
RegisterExternalCategory / RegisterSkillEffectHandler / RegisterVisibilityHandler / RegisterUnlockHandler | Extension |
ReportIntegrationHealth | Health |
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)
- LIVE TREES — open shipped
config/trees/*.luadefinitions, edit nodes in the props panel, APPLY TO CONFIG writes the file viaSaveResourceFile, bumps version, hot-registers the tree, and appends Phase 6 migrations as needed. Requires reconnect/ensureonly if clients miss the state patch. - DRAFTS — experimental trees with non-colliding ids (cannot overwrite config tree ids).
- Effect palette — only currently offered effects (
builtin_verified/external_verified/partial_honestwith required resources started). Fantasy / disabled types cannot be added or saved. - Crafting artisan effects require
GR1M_Craftstarted. Mining effects still requirer1z_mining.craft_tool_preservationremaps onto material-saver rolls inGR1M_Craft(no separate tool-wear path).
#Operator commands
| Command | Purpose |
|---|---|
/skills or F7 | Open NUI (Config.OpenCommand / OpenKeybind) |
skills_grantxp / skills_grantpoints / skills_reset / skills_debug | Admin progression |
skills_ops … | Telemetry / pace / retention / ledger / aggregate |
skills_payment_ops | Unresolved 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
ox_lib,oxmysql(fxmanifest dependencies)qbx_coreorqb-core(auto)ox_inventoryfor carry-weight nodes and item costs (recommended)- External consumer resources as configured in
config/integrations.lua/config/effects.lua
#Install
- Place resource as
GR1M_Skills. - Optional: import
sql/gr1m_skills.sql(auto-schema also runs on start). - Ensure order: oxmysql → ox_lib → framework → ox_inventory → the resources that report XP → GR1M_Skills.
add_ace group.admin gr1m_skills.admin allow- Default mode is
live; useshadowfor a trial run.
#Configuration entry points
| File | Purpose |
|---|---|
config/config.lua | Curve, XP, deployment, migration, respec, admin, builder, effects baselines |
config/telemetry.lua | Telemetry + retention safe defaults |
config/lifecycle.lua | Framework provider lifecycle |
config/categories.lua | Categories |
config/trees/*.lua | Trees |
config/effects.lua / effects_phase4.lua | Catalog + dispositions |
config/integrations.lua | Activities + allowlists |
config/antifarm.lua | Caps |
config/tree_migrations.lua | Tree migration registry mode |
#Known limitations
- All 15 categories are purchasable when their required consumer resources are started
- Material Literacy, Reclamation, Parts Control, and Shop Foreman also require
GR1M_Partsstarted (mixed-effect nodes hide if any bound consumer is down) - Escrowed / external integrations may be absent on a given server (nodes then hide)
- Hacking minigame bonuses do not apply to
op-crimeorrobberies_creatorhacks (XP only) - Electron AC / FXServer resmon are accepted risk for test feel-in — not claimed “compatible”
- Retention stays disabled by default; do not enable against production without review
- Idle “0.00 ms” is not a guaranteed SLA
GR1M