Half-Life 2

Half-Life 2

81 ratings
Emergency Healing Function
   
Award
Favorite
Favorited
Unfavorite
type: assets
File Size
Posted
Updated
16.418 KB
23 Nov, 2024 @ 7:49am
23 Nov, 2024 @ 10:21am
6 Change Notes ( view )

Subscribe to download
Emergency Healing Function

Description
This is an experimental emergency healing function using a CFG file and a few spawned entities. The player will be able to use the suit's power to provide emergency healing to themselves when their HP is very low, giving them a better chance to survive and avoid getting killed by a single shot. However, it's not easy free HP, as it takes time to execute and freezes the player in place during the process, so it's not ideal in the middle of combat.

Because this alters a keybind (N) and spawns entities, I will say that you assume the risk of this breaking the game somehow if it doesn't play nicely with certain maps. But it's easy to uninstall, you simply have to unsubscribe and unbind the N key. The CFG file won't be around to rebind the key after it's been unsubscribed to.

This requires Script MultiLoader to work, so that it plays nicely with other script mods. Link is on the right side and should also pop up if you try to sub to this without subbing to that first.
SCRIPT ID: 11

So how does it work?
When you press the N key, the following happens:
  1. The N key is unbound temporarily
  2. Several entities are created
  3. The player's speed is frozen (and flashlight disabled, which is not intended but an unfortunate side effect of altering speed)
  4. The player can't move during the healing process, but they can look and shoot/swing
  5. The player will hear the suit speak, and their HP will be tested
  6. If HP is below 30, the suit will heal them 10 HP, then retest
  7. Once HP is 30 or above, the suit stops healing and takes a moment to recharge
  8. Upon recharge, the suit speaks that it's recharged, movement and flashlight is restored, and the N key is rebound
  9. Created entities are killed, and are remade every time EMS is used, to prevent duplicates

Caveats
The speedmod disables the flashlight; once speed is restored, so is the flashlight, but you have to press the flashlight keybind again. This wasn't intended, but you can imagine it as the suit power being rerouted to healing if you want.
The speedmod also freezes you in place in midair/midjump. Not intended, but can be amusing.
I don't know how it will work if you activate it while driving a vehicle or already frozen in a cutscene. Play it safe if this is a save file you care about.
This might act strangely if the healing process was underway and the player was killed during it. I'd recommend not quicksaving during - only before or after the process is done. If you do get killed partway and it messes up the keybind, typing "bind n QEMS" in console should fix it. Most importantly, don't use this emergency heal in combat, make sure you're in a safe spot first.

Can I see the full script and edit it?
Sure, you can do whatever you want with it. I'll post a discussion topic below that has the full script so you can alter it or use it in an offline CFG file.

You might find this useful if you want to make your own personal version with tweaks, such as how much health is restored, how long the freeze effect is, etc.

Credits
DaLazyRat on Gamebanana - I did not copy his script, I referenced his script as a base and built off of it. You can view his original script here: https://gamebanana.com/scripts/11871
Popular Discussions View All (1)
0
23 Nov, 2024 @ 8:11am
The Script
Qwazzy
10 Comments
clown 6 Apr @ 8:16am 
hl2 if the morphine actually injected into the bloodstrean
Qwazzy  [author] 9 Dec, 2024 @ 8:22am 
Yes, that's what I use at the end when I re-enable player movement. I could do it twice so they can use it while frozen in place but I don't see the need.
Obsidian Plague 8 Dec, 2024 @ 11:53pm 
you can fire an enable flashlight input to "!player" which should still let you use the flashlight
Qwazzy  [author] 28 Nov, 2024 @ 6:06pm 
I don't believe so, as it doesn't turn on sv_cheats to spawn entities.
. 28 Nov, 2024 @ 3:41pm 
does this disable achievements
esqueleto tactico 27 Nov, 2024 @ 3:48pm 
nvm I just needed to re enter the game, cool mod
esqueleto tactico 27 Nov, 2024 @ 3:43pm 
can you tell me how to install it? IDK what to touch and what not, and the mod description doesn't help me either with the install, it is a specific file and where it is?
A Bottle of Sriracha 27 Nov, 2024 @ 10:12am 
[MORPHINE, ADMINISTERED]:gordon:
Qwazzy  [author] 25 Nov, 2024 @ 6:20pm 
Are you referring to the “morphine administered” sound? That should be easy to do, yeah. Or am I misunderstanding?
georgegiblets 25 Nov, 2024 @ 3:59pm 
can you make a version that administers morphine :steamhappy: