This visual modification aims to give feedback when taking damage or beeing shot at aside from the health bar. The players screen will turn red on any damage impact if so configured and is scaled with the severity of the damage or the current health relative to the maximum health depending on the enabled features.
This script is highly configurable:
-------------------------------------------------------------------------------------------------------------
--CONFIG--
-------------------------------------------------------------------------------------------------------------
config = {}
--Pulsating screeneffect as a permanent health indicator:
config.activatepulsatingindicator = true
--Accute health indicator:
config.activateaccutehealthindicator = true
--Static screeneffect as a permanent health indicator:
config.activatestatichealthindicator = true
--Timecycle modifier to use for screen effect:
-- https://pastebin.com/kVPwMemE
config.tcmEffect = "damage"
--The timecycle modifier index to check for:
-- First set the config.tcmEffect then start the resource
-- and read the index from the client console and insert it here.
config.tcmIndex = 58
--Maximum effect strength:
config.maxeffectstrength = 0.9
-------------------------------------------------------------------------------------------------------------
--STATIC HEALTH INDICATOR
-------------------------------------------------------------------------------------------------------------
--At what percantage of health (minus deadhealth*) should the static effect start? (0.0 - 1.0):
config.percentagestaticeffecthealthfraction = 1.0
--Effect strength multiplier for static health indicator:
config.staticindicatorstrengthmultiplier = 0.3
-------------------------------------------------------------------------------------------------------------
--ACCUTE / IMPACT DAMAGE INDICATOR
-------------------------------------------------------------------------------------------------------------
--At what percantage of health (minus deadhealth*) should impact effects start? (0.0 - 1.0):
config.percentageimpacteffecthealthfraction = 1.0
--Adds a screeneffect ontop of the bloody edges.
config.impacteffectboosteffect = false
--Effect strength multiplier for damage impacts:
config.impacteffectstrengthmultiplier = 14.0
--Value between 0.0 and 1.0 for how fast the screen effect fades away after a damage impact:
config.accutedamagerecoveryrate = 0.02
-------------------------------------------------------------------------------------------------------------
--PULSATING SCREENEFFECT
-------------------------------------------------------------------------------------------------------------
--At what percantage of health (minus deadhealth*) should the pulsating effect start? (0.0 - 1.0):
config.percentagepulsatingeffecthealthfraction = 0.49
--Adds a screeneffect ontop of the bloody edges:
config.pulsatingboosteffect = true
-- At what percentage the screeneffect starts playing:
config.effectthreshold = 0.3
--Variable interval for pulse indicator depending on health. (lower value -> faster):
config.minpulseinterval = 30
config.maxpulseinterval = 133
--Effect strength multiplier for pulsating effect:
config.pulsatingmultiplier = 0.3
--Heartbeat audio when screen is pulsating:
config.pulsatingheartbeataudio = true
--Heartbeat volume:
config.pulsatingheartbeatvolume = 0.8
--Pulse recovery rate multiplier:
config.pulserecoveryratemultiplier = 1.5
-- *: Players usally die at a health below 100, not 0. That value is subtracted in the code to get a better relative
-- value towards the maximum health.
-------------------------------------------------------------------------------------------------------------
--END CONFIG--
-------------------------------------------------------------------------------------------------------------
config.initialized = true
The default values are tested to represent the player status as accurate as possible. Getting shot at f.e. will deliver a noticeable “punch” and getting hit with high damage weapons like a shotgun will almost always turn the entire screen red.
I highly recommend combining this with negbooks CStyle Damage Indicator.
Demonstration videos:
Download links:
Changelog v1.3:
-
Added the option to change the main screen effect.
-
Added some presets for the config file.
-
Fixed the main screen effect not working in first person for the default setting.
Changelog v1.2:
-
Added an optional secondary screen and audio effect (“RaceBoost”) with configurable health threshold.
-
Added a configurable heartbeat soundeffect with dynamic playback speed and volume.
-
Adjusted default values for the config.
-
Fixed instances of effects playing when dead or afterwards.
Changelog v1.1:
-
Added option to all features to use the effect only below a certain health percentage.
-
Fixed issue where effect may still be applied despite other resources trying to apply effects.
Changelog v1.0:
-
Added an option to turn off/on the impact indicator.
-
Added a static health indicator.
-
Adjusted default values to account for added variables.
-
Fixed issue where script would stop working on resource restart without rejoining the server.
Changelog v0.95:
-
Seperated code through multithreading.
-
Added a buffer for when sustaining constant damage to make transitions smoother (f.e. while beeing on fire).
-
Improved compatibility by not applying screen effects when another resource is using the same function:
SetTimecycleModifier(
modifierName --[[ string ]]
)
Known issues:
- None.
To-do list:
- Fixing issues. (Leave a comment if you encounter any!)