Filtering by a Player's Health

  • Site Migration: See bugs? Report them here. Want something changed or have an idea? Suggest it here.

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
Is it possible to filter a trigger by the activating player's current health? I need to create custom healthkits for my joke map for the purpose of gameplay and balance, which I am attempting to do with a trigger_hurt set to a negative value and a healthkit prop. Like normal healthkits, these healthkits are set to disable for 10 seconds after being picked up. Problem is, players on full health can pick up the healthkit. I need a way to prevent players at max health from disabling the healthkit.
 

Fragancia

L2: Junior Member
Feb 22, 2013
91
L4D2 has something like that but nothing in tf2 that can check players health and activate I/O based on it.
You're out of luck unless you make a sourcemod plugin to do what you want.
If you really want something like that in tf2, send the TF team an e-mail about it.
 

henke37

aa
Sep 23, 2011
2,075
Somehow I doubt they'd listen...
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,268
The best I could find was using a filter_tf_condition to disable the healthpack or something, but there doesn't seem to be any condition for low health sadly. You could set it to being enabled only for afterburn, or bleeding. People would love that pack, unless you're low health and NOT burning or bleeding :p
 

Egan

aa
Feb 14, 2010
1,352
You could use the entity: tf_bonus_duck_pickup

Keyvalues / IO: https://i.imgur.com/I8r2HTy.png
Which you may have to make with smartedit turned off, or make the IO in another entity and then Copy/Paste them onto this entity.

The entity should have no gamemode function outside of halloween, making it probably pretty ideal for fake pickups that players can pick up even at full ammo / health.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
You could use the entity: tf_bonus_duck_pickup

Keyvalues / IO: https://i.imgur.com/I8r2HTy.png
Which you may have to make with smartedit turned off, or make the IO in another entity and then Copy/Paste them onto this entity.

The entity should have no gamemode function outside of halloween, making it probably pretty ideal for fake pickups that players can pick up even at full ammo / health.
That's cool, I'll keep that entity in mind for any future projects, but I'm looking for packs that players can't pick up when at full health (Idc about ammo). Is there a way to do that?
 

Egan

aa
Feb 14, 2010
1,352
What is it you would like to do with the healthkit that you couldn't use a healthkit with added IO for?

If it is to harm the player on pickup interaction, you could maybe simply use the player input of 'BleedPlayer x' where x is the number of seconds (the amount of damage over time) to hurt the player for. or IgnitePlayer which is similar.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
I am looking to set custom values for how much to heal the player.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,268
AddHealth or something like that would be very preferable.
A tricky idea could be having a damage block using generic damage activate just after a healthpack is picked up, lasting a second but takes away a certain amount of health so you can have a certain amount left (say you have a full health pack, you use a tf_class_filter to take away a particular amount of health per class)
Only problem I can see with this is A: setting it up for every healthpack and
B: someone waiting for a healthpack could accidentally kill themselves, unless a way is found to disable it(maybe a trigger on the pack, re enabling it after the amount of time the healthpack comes back, and it would start enabled anyways, meaning that would work)

Could this idea work or is it a far fetched fantasy?
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,341
It could work, but players close to full health could actually lose HP in this process rather than gain HP.
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,268
It could work, but players close to full health would actually lose HP in this process rather than gain HP.
Perfect. Punishing those bastard 124 HP scouts who swoop in and steal your afterburn extinguishing healthpack when you're on 8 HP
 
Last edited: