Configuration
Configure orbit-dynamichud-stress speed, weapon, job, blur, and effect settings.
Configuration
All public stress behavior lives in resources/[orbit]/orbit-dynamichud-stress/config.lua.
Stress is stored from 0 to 100. The client can add stress from speeding and weapon usage, while server events can add or remove stress from other integrations.
Keep one stress authority
Avoid running multiple resources that independently gain, relieve, or overwrite the same stress state. Integrate other gameplay through the documented events or replicated state value.
File map
Core settings
Prop
Type
Config.Stress.stressSpeedFormat = 'kmh'
Config.Stress.minForSpeeding = 1000
Config.Stress.minForSpeedingUnbuckled = 50stressSpeedFormat decides whether the thresholds are read as KMH or MPH. minForSpeeding is used while the player is buckled, and minForSpeedingUnbuckled is used while unbuckled. The default buckled value is very high, which effectively makes normal buckled speeding much less likely to add stress.
Config.Stress.chance = 0.1
Config.Stress.whitelistedWeapons = {
'weapon_petrolcan',
'weapon_hazardcan',
'weapon_fireextinguisher',
}chance is a decimal chance from 0 to 1. For example, 0.1 means a 10 percent chance per eligible shot. Weapons in whitelistedWeapons never add weapon stress.
Config.Stress.minForShaking = 50
Config.Stress.blurIntensity = {
[1] = { min = 50, max = 60, intensity = 1500 },
[2] = { min = 60, max = 70, intensity = 2000 },
[3] = { min = 70, max = 80, intensity = 2500 },
[4] = { min = 80, max = 90, intensity = 2700 },
[5] = { min = 90, max = 100, intensity = 3000 },
}minForShaking is the first stress value where effects can run. Each blurIntensity range controls how strong blur can be for that stress band. Each matching effectInterval range controls how often the effect can repeat.
Config.Stress.whitelistedJobs = {
'police'
}Whitelisted jobs skip server-side stress gain from hud:server:GainStress. They can still have their state changed directly by custom code that writes to Player(source).state.stress.
Framework setup
Whitelisted jobs should match the ESX job names returned by orbit-lib.
Whitelisted jobs should match PlayerData.job.name.
The stress logic is adapted from the QBX HUD stress system and keeps the same state-bag style integration.
Whitelisted jobs are based on the job data returned by Config.Standalone.fetchJob in orbit-lib, or the Config.Standalone.defaultJob fallback.
Apply and verify
- Save
config.luaand restart the stress resource. - Confirm the local replicated stress state initializes between
0and100. - Test speeding once buckled and once unbuckled with the configured speed unit.
- Test one eligible and one whitelisted weapon.
- Test
hud:server:GainStressas both a whitelisted and non-whitelisted job. - Move through each effect range and tune one blur or interval band at a time.
- Test relief through the documented event or one configured usable item.