Filtering by a Player's Health

Discussion in 'Mapping Questions & Discussion' started by Da Spud Lord, Dec 2, 2017.

  1. Da Spud Lord

    aa Da Spud Lord The smartest potato you'll never eat

    Messages:
    421
    Positive Ratings:
    329
    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.
     
  2. Fragancia

    Fragancia L2: Junior Member

    Messages:
    81
    Positive Ratings:
    29
    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.
     
    • Agree Agree x 1
  3. henke37

    aa henke37

    Messages:
    1,790
    Positive Ratings:
    402
    Somehow I doubt they'd listen...
     
    • Agree Agree x 1
  4. DrSquishy

    DrSquishy L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    74
    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
     
    • Agree Agree x 1
  5. Egan

    aa Egan

    Messages:
    1,295
    Positive Ratings:
    1,466
    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.
     
  6. Da Spud Lord

    aa Da Spud Lord The smartest potato you'll never eat

    Messages:
    421
    Positive Ratings:
    329
    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?
     
  7. Egan

    aa Egan

    Messages:
    1,295
    Positive Ratings:
    1,466
    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.
     
  8. Da Spud Lord

    aa Da Spud Lord The smartest potato you'll never eat

    Messages:
    421
    Positive Ratings:
    329
    I am looking to set custom values for how much to heal the player.
     
  9. Yrr

    aa Yrr An Actual Deer

    Messages:
    977
    Positive Ratings:
    1,822
    isnt there like SetHealth or something
     
  10. Da Spud Lord

    aa Da Spud Lord The smartest potato you'll never eat

    Messages:
    421
    Positive Ratings:
    329
    AddHealth or something like that would be very preferable.
     
  11. DrSquishy

    DrSquishy L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    74
    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?
     
  12. Da Spud Lord

    aa Da Spud Lord The smartest potato you'll never eat

    Messages:
    421
    Positive Ratings:
    329
    It could work, but players close to full health could actually lose HP in this process rather than gain HP.
     
  13. DrSquishy

    DrSquishy L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    74
    Perfect. Punishing those bastard 124 HP scouts who swoop in and steal your afterburn extinguishing healthpack when you're on 8 HP
     
    • Funny Funny x 1
    Last edited: Dec 9, 2017
Tags: