Garry's Mod

Garry's Mod

475 ratings
[SEF] Status Effect Framework
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Roleplay, Scenic
File Size
Posted
Updated
3.717 MB
3 Jul, 2024 @ 4:02pm
1 Sep @ 1:20pm
46 Change Notes ( view )

Subscribe to download
[SEF] Status Effect Framework

In 1 collection by Aaron
Official SEF List
9 items
Description
Status Effect Framework

Bugs, ideas etc. post here on "Issues" tab: https://github.com/Aaronek10/SEF
Whole documentation which is up to date: https://github.com/Aaronek10/SEF/wiki

Support Server: https://discord.gg/d2m2Rgky66


Status Effect Framework (SEF) is an addon for Garry's Mod that allows Developers to apply various status effects to players, NPCs, and other entities. These effects can either buff or debuff the entity, altering their abilities and attributes.


DISCLAIMER!!!
Addon does nothing on it's own. Count it as library/expansion for other addons to work. You can still use commands like SEF_GiveEffect or SEF_GivePassive if you want to use included effects.





Built-in Status Effects
Name
Type
Description
Effect
Healing
BUFF
You are regenerating a certain amount of HP each 0.3 sec.
Regenerates health over time.
Health Boost
BUFF
Your max health has been increased by a certain amount of HP.
Increases the entity's maximum health.
Energized
BUFF
You are regenerating shield each 0.3 sec. [Max Armor: specified amount]
Regenerates armor over time up to a maximum value.
Broken
DEBUFF
Your health is capped at a certain amount of HP.
Limits the maximum health of the entity.
Exposed
DEBUFF
Received damage is doubled.
Increases the damage taken by the entity.
Endurance
BUFF
Received damage is reduced by 50%.
Reduces the damage taken by the entity.
Haste
BUFF
Your movement speed is increased by a certain amount of units.
Increases the movement speed of the entity.
Exhaust
DEBUFF
You are tired. Your speed can't be increased.
Limits the movement speed of the entity.
Hindered
DEBUFF
Your movement speed is decreased by a certain amount of units.
Decreases the movement speed of the entity.
Bleeding
DEBUFF
You are bleeding. You are losing a certain amount of HP each 0.3 sec.
Causes the entity to lose health over time.
Incapacitated
DEBUFF
You are unable to use any weapons or tools.
Prevents the entity from using weapons or tools.
Tenacity
BUFF
You've become immune to negative effects. Debuffs are 75% shorter.
Reduces the duration of debuffs by 75%.
Bloodlust
BUFF
You are hungry for blood! Damage you deal is increased by a certain percentage. Percentage of dealt damage is received as healing.
Increases damage dealt and converts a percentage of damage dealt into health.
Stunned
DEBUFF
You are unable to move or do any action.
Prevents movement and actions.
Wither
DEBUFF
You are losing a certain amount of HP each specified amount of seconds.
Causes the entity to lose health over time.
Discharge
DEBUFF
You are losing a certain amount of shield each specified amount of seconds.
Causes the entity to lose shield over time.
Poison
DEBUFF
You are losing a certain amount of HP each 0.5 sec. You can't heal.
Causes the entity to lose health over time and prevents healing in anyway.
Blindness
DEBUFF
Your vision is severely impaired.
Reduces the entity's vision, making it difficult to see or aim.




Developer Functions


ApplyEffect
Usage: entity:ApplyEffect(effectName, time, ...)
Description: Applies a specified effect to the entity for a given amount of time with optional additional arguments.


RemoveEffect
Usage: entity:RemoveEffect(effectName)
Description: Immediately removes a specified effect from the entity.


SoftRemoveEffect
Usage: entity:SoftRemoveEffect(effectName)
Description: Softly removes a specified effect from the entity, allowing for potential cleanup actions.

ApplyPassive
Usage: entity:ApplyPassive(passiveName)
Description: Applies passive which is permament (won't be removed on player's death).

RemovePassive
Usage: entity:RemovePassive(passiveName)
Description: Removes passive from entity.

HaveEffect
Usage: entity:HaveEffect(effectName)
Description: Checks if the entity currently has the specified effect applied.


GetTimeLeft
Usage: entity:GetTimeLeft(effectName)
Description: Returns the remaining time left for the specified effect on the entity.
If you want to create own status effect, here's code how to add your effect so StatusEffects list. table.Merge(StatusEffects, { EffectName = { --Name and ID of Effect Icon = "SEF_Icons/warning.png", --Icon on HUD and displays Desc = "" --Optional Type = "DEBUFF", --Type Effect = function(ent, time) --Effect on entity/player, function can be expanded by additional arguments end, HookType = "", --Hook name HookFunction = function() end -- What function should be added to set HookType. } })


ConCommands


SEF_GiveEffect

Usage: SEF_GiveEffect <effectName> <playerName> <time> [<arg1> <arg2> ...]
Description: Command to apply an effect to a specified player for a given amount of time with optional additional arguments.

SEF_GivePassive

Usage: SEF_GivePassive <passiveName> <playerName>
Description: Command to apply a Passive to a specified player.
SEF_RemovePassive
Usage: SEF_RemovePassive <passiveName> <playerName>
Description: Command to remove Passive from a specified player.


ConVars

SEF_StatusEffectX/Y
Usage: SEF_StatusEffectX <value> / SEF_StatusEffectY <value>
Description: Sets X for HUD Display of active effects

SEF_ScaleUI
Usage: SEF_ScaleUI 1

Description: Changes UI scale.

SEF_StatusEffectDisplay 0/1
Description: Shows active effects on NPCs, Players or Nextbots
127 Comments
Turns out my issue was a speed changer addon but i couldn't find it so i just assumed it was a mod issue or a weapon base
Aaron  [author] 22 Sep @ 12:41pm 
Particles is up to dev

Hidden icon/hud can be added in the future
ɅµЋƵƵ 22 Sep @ 12:36pm 
Will this ever support hidden effects? Like having SEF handle the effects serverside but not display an icon / particles?
Aaron  [author] 21 Sep @ 9:40pm 
So everything works as intended
200 to 240 while walking and using
Aaron  [author] 21 Sep @ 3:12pm 
How much haste effect adds HU and for how long? Can you show that?
mb i guess i forgot how source works lol
ignoring everything i said about it being slower;
the speed effect still applies correctly it just ends really quick and i have no idea why.
Aaron  [author] 21 Sep @ 2:56pm 
Default values should be ~200 when walking and ~400 when sprinting
Aaron  [author] 21 Sep @ 2:55pm 
Uhm, SEF operates on Hammer Units (HU) which all Source games uses to determine the velocity, positions etc.

Haste effect adds X amount of HU to both Walk Speed and Run Speed.

Your HUD doesnt reflect that due to value being converted to Km/h, which is not a good way to measure speed.

Use cl_showpos 1 to show your position and your current velocity and measure change here
Aaron  [author] 21 Sep @ 2:02pm 
Would be nice