Making Payload Killable

Discussion in 'Mapping Questions & Discussion' started by Mexican Apple Thief, Feb 13, 2009.

  1. Mexican Apple Thief

    Mexican Apple Thief L3: Junior Member<br>LEAD FARMER

    Messages:
    345
    Positive Ratings:
    60
    So my basic intentions are to make a payload map in which Red is able to destroy the payload by shooting it. I know you can do this while compiling it with health but I want to avoid that as I have absolutely no idea how to do anything at all with models.

    The only method I've tried so far is parenting a damage activated func_button to it which would add one to a math counter every time it's shot. Once it reached 1,000 it would output an end round to the game rules entity.

    This proved to be a very effective way to crash the game.

    So if anyone happens to know another way to do this I'll be very grateful because you'll be saving me from having to... learn stuff D-:.
     
  2. MangyCarface

    aa MangyCarface Mapper

    Messages:
    1,616
    Positive Ratings:
    1,275
    In practice it doesn't work; everyone on RED goes soldier and spams the shit out of it from far away
    Check pl_strider for the actual way to do this
     
    • Thanks Thanks x 1
  3. Mexican Apple Thief

    Mexican Apple Thief L3: Junior Member<br>LEAD FARMER

    Messages:
    345
    Positive Ratings:
    60
    I think I could probably fix that with a good layout. I was planning on having cover around it so you either have to get close or up high, and the perches will be made to be useless one the payload passes.

    Thanks for the tip, I forgot about strider, I'll decompile it whe I get home.
     
  4. zornor

    zornor L4: Comfortable Member

    Messages:
    195
    Positive Ratings:
    23
    func_breakable
     
  5. Fearlezz

    Fearlezz L10: Glamorous Member

    Messages:
    787
    Positive Ratings:
    240
    Okay this is how you do it;
    Along with your func_tracktrain, put a func_breakable. cover it with nodraw texture and then set the setting as you wish. Go to outputs for the func_breakable and put this:

    OnBreak > cartmodelname > Kill
    OnBreak > tracktrainname > Kill
    OnBreak > particleexplosionname > StartParticle
    ect

    In other words, you want the explosion to happen on break. Its not much harder then that.
     
    • Thanks Thanks x 1
  6. ikem

    ikem L6: Sharp Member

    Messages:
    268
    Positive Ratings:
    34
    could be a interesting map if u had that feature. things u would need

    - a health bar on the payload model
    - playload to have ALOT of health

    imo that would be a little more realistic and get red on offense :D

    would be fun
     
  7. Fraz

    aa Fraz Blu Hatte, Greyscale Backdrop.

    Messages:
    944
    Positive Ratings:
    564
    What would be better, and would make engineers have more use for BLU on pl maps is make them able to fix it (I know this is probably impossible but still it would be awsome)

    ~M
     
  8. Zeewier

    Zeewier L9: Fashionable Member

    Messages:
    619
    Positive Ratings:
    130
    Working Solution:
    For the Payload model: (make sure you use a brush (the func_tracktrain) that allows bullets to pass to damage the model)

    Values:
    Health: 10000 (the health of the payload cart)
    Outputs:
    OnHealthChanged -> InValue to a math_remap entity

    For the Remapper:
    Values:
    Minimum Valid Input: 0
    Maximum Valid Input:1
    Output Value when Input is min: 0
    Output Value when Input is max: 100
    Outputs:
    OutValue-> InValue to a logic_case
    OutValue -> InValue to the counter in this download: http://forums.tf2maps.net/showthread.php?t=4696

    For the logic_case:
    Values:
    Case 01: 0
    Outputs:
    OnCase01 -> RoundWin to a game_round_win entity.

    You will probably need some extra tweaks, but this should work :)
    Note: I made this without hammer open so some entity names/valvues/outputs might be a little different

    It's not possible to heal it as engy yet :(
     
    • Thanks Thanks x 1
    Last edited: Feb 14, 2009
  9. Mexican Apple Thief

    Mexican Apple Thief L3: Junior Member<br>LEAD FARMER

    Messages:
    345
    Positive Ratings:
    60
    Health isn't in the normal properties for the model. I added it in but it doesn't seem to affect anything. It ends the game after one shot.

    Otherwise works great, I'm going to tinker with it a little longer.

    The func_breakable worked right in terms of health, however it was making the game crash when you got too close to it.

    EDIT: Actually it's not the func_breakable's fault, it's something I can't figure out right now.
     
    Last edited: Feb 14, 2009
  10. Zeewier

    Zeewier L9: Fashionable Member

    Messages:
    619
    Positive Ratings:
    130
    *checks in hammer*
    prop_physics_override (the entity valve uses for the payload model) has an Health property!
     
  11. Mexican Apple Thief

    Mexican Apple Thief L3: Junior Member<br>LEAD FARMER

    Messages:
    345
    Positive Ratings:
    60
    They use that? Huh, the guide told me to use a dynamic. Well that should be helpful, though I already finished getting the breakable to work.:p
     
  12. Mexican Apple Thief

    Mexican Apple Thief L3: Junior Member<br>LEAD FARMER

    Messages:
    345
    Positive Ratings:
    60
    So does the OnHealthChanged > InValue output send the current health, or how much health was lost? And if it's how much was lost, is a positive or negative number?
     
  13. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,768
    Positive Ratings:
    5,508
    If you enable developer 2 in-game you'll get a spew of all entity events in the map. Then you can see what kind of data OnHealthChanged is sending. :)
     
    • Thanks Thanks x 1
  14. Zeewier

    Zeewier L9: Fashionable Member

    Messages:
    619
    Positive Ratings:
    130
    i can also tell you: it's this way 0.9 is 90% and 0.356 is 35,6% (that's the output it gives)
     
  15. Mexican Apple Thief

    Mexican Apple Thief L3: Junior Member<br>LEAD FARMER

    Messages:
    345
    Positive Ratings:
    60
    90% of what?

    Whatever weapon I use the values are always just below 100. :S
     
    Last edited: Mar 1, 2009
  16. maxtraxv2

    maxtraxv2 L3: Member

    Messages:
    103
    Positive Ratings:
    3
    read the bottom part
     
  17. Zeewier

    Zeewier L9: Fashionable Member

    Messages:
    619
    Positive Ratings:
    130
    90% of the total amount of health ;)

    So when max health is 1000 it will give .9 when its at 900 health