[Resource] The Passtime Entites!

14bit

L14: Bit Member
aa
Oct 5, 2014
642
2,066
NOTE! This will be updated as time goes on! Feel free to suggest things and I might add them!

Most of this information has not been tested recently, most of it being done around 8/19/15.

Special thanks to MugWench for figuring out some of this!

New Point Entities:

passtime_logic
  • Handles HUD, Ball respawning time
  • Outputs for ball events (picked up by team, spawned, etc.)
  • You need to send it TimeUp when the round timer reaches zero.
  • You can force it to spawn a ball by sending it SpawnBall.
  • You can send it signals for JumPadUsed and SpeedBoostUsed. Untested, but appears to be used to disable the jumpads right after they fire for a short bit. This is just speculation.
  • SpawnBall can be used to get rid of the ball and start the countdown to respawn the ball, it doesn't spawn it immediately. (Useful in combination with trigger_passtime_ball to respawn it after going off of cliffs or something)
  • Issues can arise with this as firing it won't cancel previous fires.
  • It has a keyvalue called "Section" and an associated input called "SetSection." Use is unknown at this time, and the decomplied version of pass_warehouse doesn't seem to use it.
  • Section breaks the HUD if it's not zero.
  • If you send it SetSection, the game immediately crashes.
info_passtime_ball_spawn
  • This is the ball's spawn location!
  • Multiple ball spawners don't give you more balls.
  • Fires OnSpawnBall
  • Automatically places start point on HUD properly (i.e. closer to one side actually puts it closer)
  • Spawns IMMEDIATELY (you need to make a box so players can't get it during setup)
  • Start disabled doesn't work (as far as I can tell)
  • Team just sets the starting team.
  • SetTeam does not appear to function at all.
  • NOTE! You can't pick up the ball unless the map's prefix is pass_. It will still spawn if it isn't, though.

New Brush Entities:

trigger_catapult
This was in Portal 2!
  • To fire the ball, the "Physics Objects" flag must be set!
trigger_passtime_ball
  • Trigger that detects the ball. Has OnBallEnter/Exit as well as generic StartTouchingAll and others.
func_passtime_goal
  • Team is what team can score here!
  • Any team goals (i.e. team set to any) don't work.
  • You can say how many points are given for scoring at a particular goal
  • By default, you can only score by throwing it in, but there is a flag to let carried balls score
  • If set so that ball carriers can score, you can still throw it in.
  • BUT if you set "DO NOT let the ball score here" flag, you can't throw it in.
  • Together, you can make goals that can only be scored on by running into them!
  • You can set a flag to make the goal an instant win instead of giving points with a flag
  • Has a fancy visual effect!
  • Non-integer score values are rounded down to the nearest integer.
  • Multiple goals for a team completely breaks the HUD.
  • Multiple brushes tied to the same goal work fine, except for the fancy goal target. It stays at the entity's origin.
  • Setting Points to 0 will reset the ball properly and award no points. You do get capture crits.
func_passtime_no_ball_zone
  • You drop the ball if you try to walk through it.
  • If you try to pick up the ball while in it, nothing happens. (It stays on the ground)
  • Cannot be enabled/disabled
func_passtime_goalie_zone
  • As far as I can tell in my tests, it doesn't do anything. :confused:
  • They are placed around the goal zones in pass_warehouse, so they probably do something.
My map won't work!
You must have all of the following, or the map will crash/not load:
  • team_round_timer
  • passtime_logic
  • info_passtime_ball_spawn.
MugWench recommends these settings for your team_round_timer:
  • "Setup timer length" to 15
  • Configure an output like so: OnFinished <passtime_logic's name you gave it> TimeUp
  • "Show timer in HUD" must be enabled, or the map will crash.

For the game to be played you'll also need goals and noball areas, but you need these to prevent crashes.

The Ball Itself:

The dynamic entity that is the Jack (that's the name of the ball) is conveniently named passtime_ball, and you can spawn them with ent_create. Ones not spawned by the info_passtime_ball_spawn can't be picked up, and do not trigger trigger_passtime_ball s and cannot score in goals. They also do not have the white ring around them that the "real" ones have. They can, however, still be shot around.

Interactions with trigger_teleport
  • The ball can be teleported with trigger_teleports if they have the "Physics Objects" flag checked.
  • If a ball is thrown into the trigger_teleport, it teleports to the target and loses all velocity.
  • If you are holding the Jack and enter a trigger_teleport that only affects the Jack, it remains in your hand.
  • If you are holding the Jack while inside of a trigger_teleport that only affects the Jack and you try to throw it, the Jack is immediately teleported to the target, but retains the velocity of the throw!

The Jack bounces off of all clip brushes, including PlayerClip.

Ball Team Claiming

The ball can be in one of three states: Claimed for Red, Claimed for Blue, or Neutral.
A neutral ball cannot be scored.
A claimed ball can be scored for the claimed team.


A ball can only switch states through 4 ways:
  1. If a player picks it up it will become claimed by that team.
  2. If the ball is scored it will return to Neutral and start the respawn sequence.
  3. If the ball touches a GROUND OR FLOOR SURFACE it will become Neutral. ( This does not include walls.)
  4. If the player carrying the ball enters a func_passtime_no_ball_zone it will IMMEDIATELY return to Neutral.
If you throw the ball, you cannot catch it until it turns Neutral again. Teammates and enemies can catch it, however. (You can't pass to yourself.)

There is no time limit for possession, but you can steal from your own team after a while. If you drop the ball into the void, it will never lose its claimed status. (Also you can't pick the ball up if its in the void due to angry vphysics gods.) If it is neutral, however, it will respawn like normal.

Since trigger_catapult prevent the ball from actually TOUCHING the ground surface, you can throw a ball at them without it losing its claimed state. This means boosting to the goal is possible.

What if it goes in a death pit?
There are a couple ways of dealing with this.

First, you can respawn the ball:
  1. Create a trigger_passtime_ball in the pit
  2. Use it to fire SpawnBall on the passtime_logic entity. This will get rid of the ball and get start the countdown by the announcer, then the ball will respawn at the center.
I don't like this method as it breaks gameplay flow and you have to wait for it to respawn.

The next method is to use a trigger catapult to launch it back into play space.
  1. Make a trigger_catapult set to affect only physics objects.
  2. You can also use a filter_activator_class set to filter for passtime_ball if you want.

This one would work well, but the next is my favorite.

Use a teleporter!
  1. Create a trigger_teleport with the "Physics Objects" flag checked.
  2. Use a filter_activator_class set to filter for passtime_ball to make sure only the ball is teleported.
  3. Link the telporter to an info_target somewhere near the edge of the pit.
  4. Optional step: put a trigger_catapult the only affects the ball around the info_target to make it pop up/out from somewhere!

I like this one because you can make the ball pop out of a nearby pipe or hole in the ground!

What about Bumper Carts?
  • You can pick up the ball!
  • You can't throw the ball!
  • You can score on goals set to let carrier score.
  • If you don't include the pass_ prefix on the map name (in order to make it so you can't pick up the ball) the bumper carts do not collide with the Jack.

That's everything I've figured out at the moment. Please share anything else you find below! If I made a mistake or got something completely wrong, let me know so I can fix it!
 
Last edited:

Kube

Not the correct way to make lasagna
aa
Aug 31, 2014
1,342
1,849
Wow, this is quite the in-depth guide for being initially posted around two hours after the update! Excited to see if any custom gamemodes pop up using these entities.
 

14bit

L14: Bit Member
aa
Oct 5, 2014
642
2,066
I just did a quick decomplile with bspsrc. There's some random props near the center of the map, but all of the logic is in tact.

Also: multiple ball spawners don't give you more balls. :(
 

killohurtz

Distinction in Applied Carving
aa
Feb 22, 2014
1,016
1,277
The entity class of the ball itself is simply passtime_ball. I tried parenting a dynamic prop to it using the OnSpawnBall output fired from info_passtime_ball_spawn, but with no luck so far.
 

14bit

L14: Bit Member
aa
Oct 5, 2014
642
2,066
The dynamic entity that is the Jack (that's the name of the ball) is conveniently named passtime_ball, and you can spawn them with ent_create. Ones not spawned by the info_passtime_ball_spawn can't be picked up, and do not trigger trigger_passtime_ball s and cannot score in goals. They also do not have the white ring around them that the "real" ones have. They can, however, still be shot around.
 

MugWench

L1: Registered
Aug 19, 2015
7
4
The ball will normally bounce quite a bit (try dropping it). However near the goals on pass_warehouse it bounces barely at all. Perhaps the goalie zones reduce bounce to prevent bounce in goals.
 

henke37

aa
Sep 23, 2011
2,075
515
I think the SetSection input could be for configuring the HUD when the map layout changes at runtime.
 

page305

L1: Registered
Aug 19, 2015
11
0
I can't seem to run my map with passtime logic in my map. Crashes TF2.

All I'm trying to accomplish right now is spawn the ball and run around with it. Thats all. :D
 

14bit

L14: Bit Member
aa
Oct 5, 2014
642
2,066
I can't seem to run my map with passtime logic in my map. Crashes TF2.

All I'm trying to accomplish right now is spawn the ball and run around with it. Thats all. :D

Make sure you have a tf_gamerules! Maps will crash if you try to use passtime logic if you don't have one. MugWench, thanks for the tip. My new theory is that the ball returns to neutral if it hits anything after entering an oppositely teamed goalie zone, as well as reducing bouncing to prevent bounce-ins. This is untested and baised on my experiments last night and your idea. I will try to confirm later.
 

killohurtz

Distinction in Applied Carving
aa
Feb 22, 2014
1,016
1,277
Wait what? You cant use any passtime entity if you dont have the tf_gamerules? D:
So, if i want to make a.. CP map with trigger_catapult it will crash because I dont have the gamerules?
what :O

trigger_catapult is not a passtime entity. It just happens to be the only gamemode in which it is used.

Also, there is no tf_gamerules in the decompiled pass_warehouse, and I was able to run a prefab without one.
 

14bit

L14: Bit Member
aa
Oct 5, 2014
642
2,066
Hmm, I had problems with my test map crashing if I didn't include it yesterday. I might be wrong though. It may be the case that maps without the pass_ prefix that don't have it crash. That may be the case as I changed the prefix on my test map after I fixed the crashing by adding a tf_gamerules.
 

14bit

L14: Bit Member
aa
Oct 5, 2014
642
2,066
Ok, you don't need a tf_gamerules. The crash related to it earlier must have been something else with my test map.

Here's some new info:

passtime_logic
  • SpawnBall can be used to get rid of the ball and start the countdown to respawn the ball, it doesn't spawn it immediately. (Useful in combination with trigger_passtime_ball to respawn it after going off of cliffs or something)
  • Issues can arise with this as firing it won't cancel previous fires.
  • Section breaks the HUD if it's not zero.
  • If you send it SetSection, the game immediately crashes.
info_passtime_ball_spawn
  • Automatically places start point on HUD properly (i.e. closer to one side actually puts it closer)
  • Team just sets the starting team.
  • SetTeam does not appear to function at all.
func_passtime_goal
  • Non-integer score values are rounded down to the nearest integer.
  • Multiple goals for a team completely breaks the HUD.
  • Multiple brushes tied to the same goal work fine, except for the fancy goal target. It stays at the entity's origin.
  • If set so that ball carriers can score, you can still throw it in.
  • BUT if you set "DO NOT let the ball score here" flag, you can't throw it in.
  • Together, you can make goals that can only be scored on by running into them!
  • Setting Points to 0 will reset the ball properly, and award no points. You do get capture crits.
func_passtime_no_ball_zone
  • Cannot be enabled/disabled
What about Bumper Carts?
  • You can pick up the ball!
  • You can't throw the ball!
  • You can score on goals set to let carrier score.
tf_gamerules
  • Changing the HUD type doesn't work right. The Passtime HUD will always draw under the one you specify.

This is everything I thought to test. I'll update if I figure out anything else!
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Technically, you must have a tf_gamerules in every map - such that when one is not included in the BSP one is created by the server upon loading the map. It is impossible not to have one.
 

MugWench

L1: Registered
Aug 19, 2015
7
4
Ball Team color effects:

The ball can be in one of three states: Claimed for Red, Claimed for Blue, or Neutral.
A neutral ball cannot be scored.
A claimed ball can be scored for the claimed team.

A ball can only switch states through 4 ways:
  1. If a player picks it up it will become claimed by that team. (duh)
  2. If the ball is scored it will return to Neutral and respawn. (duh)
  3. If the ball touches a GROUND OR FLOOR SURFACE it will become Neutral.
  4. If the player carrying the ball enters a no-carry zone it will IMMEDIATELY return to Neutral. (it doesn't have to touch the ground.)

There is no time limit for possession I can find, if you drop the ball into the void, it will never lose its claimed status. (Also you can't pick the ball up if its in the void due to angry vphysics gods.)

Anything surface steeper that 45* is considered a wall

On Goalie zones:
They appear to limit ground and floor bounces. This is probably to prevent you from trying to bounce in goals off the ground. They DO NOT affect wall bounces.

Also of Note:
Since The Boost pads prevent the ball from actually TOUCHING the ground surface (The trigger area is quite large) You can throw a ball at them without it losing its claimed state. Meaning Boosting to the goal is possible.

And that's what I can find right now.
Hope I get custom maps working so I can dig deeper :/
 
Last edited:

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
14bit this is great :) But could you please update the existing post? It's a bit annoying having to trawl the thread learning bits of things at a time and making sure you replace older, faulty info. Much better to have one reference post with all of the collected knowledge, kept up to date. If ever the content at TF2m is indexed in a directory, it will be much more efficient and user-friendly to simply link to one comprehensive post rather than a bunch of posts with little bits of info. in them.

This pass time stuff is quite exciting. Do the balls work on the trigger_catapult on their own, without being held? Like the cubes and such in Portal 2.
 

MugWench

L1: Registered
Aug 19, 2015
7
4
On pass_warehouse the catapults will affect the Jack (Ball).
This is probably changeable from the entities options.

They will NOT affect most weapon projectiles including every thing from a baseball to a rocket.
This is probably changeable from the entities options.

EDIT:

Some quick Ball Passing stuff:
If you throw the ball, you cannot catch it until it turns Neutral again.
Meaning:
You can't bounce the ball off a wall, and catch it.
You can bounce it off the ground and catch it. (You can dribble)
 
Last edited:

page305

L1: Registered
Aug 19, 2015
11
0
Still no dice on running any map wit passtime logic. I loaded an empty single room map with dev textures, single player spawn, passtime logic and a ball spawner. Crash at TF2 main menu.

I tried my default map both with and without tf_gamerules. I'm not sure what is going wrong.
 

MugWench

L1: Registered
Aug 19, 2015
7
4
I managed to get passtime logic working!

What you need is a team_round_timer, passtime_logic, and an info_passtime_ball_spawn.

info_passtime_ball_spawn:
Just place this entity where you want the ball to spawn.

passtime_logic:

Give this a name, for this demo we'll use "pass_master".

team_round_timer:
Set "Setup timer length" to 15.
Configure an output like so:
OnFinished
pass_master
TimeUp

For the game to be played you'll need goals and noball areas. This should prevent your game from crashing however.