Making Payload Killable

Mexican Apple Thief

L3: Junior Member<br>LEAD FARMER
Aug 23, 2008
345
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-:.
 

Mexican Apple Thief

L3: Junior Member<br>LEAD FARMER
Aug 23, 2008
345
60
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

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.
 

Fearlezz

L10: Glamorous Member
May 4, 2008
787
476
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.
 

ikem

L6: Sharp Member
Dec 8, 2008
268
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
 

Fraz

Blu Hatte, Greyscale Backdrop.
aa
Dec 28, 2008
944
1,152
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
 

Zeewier

L9: Fashionable Member
Sep 20, 2008
619
262
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 :(
 
Last edited:

Mexican Apple Thief

L3: Junior Member<br>LEAD FARMER
Aug 23, 2008
345
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:

Zeewier

L9: Fashionable Member
Sep 20, 2008
619
262
*checks in hammer*
prop_physics_override (the entity valve uses for the payload model) has an Health property!
 

Mexican Apple Thief

L3: Junior Member<br>LEAD FARMER
Aug 23, 2008
345
60
*checks in hammer*
prop_physics_override (the entity valve uses for the payload model) has an Health property!

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
 

Mexican Apple Thief

L3: Junior Member<br>LEAD FARMER
Aug 23, 2008
345
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?
 

Zeewier

L9: Fashionable Member
Sep 20, 2008
619
262
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)
 

Zeewier

L9: Fashionable Member
Sep 20, 2008
619
262
90% of the total amount of health ;)

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