Prefabs - Box Of Features

Prefabs - Box Of Features 3.0.0

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

Prefabs - Box Of Features 3.0.0

A Box filled with a variety of prefabs!


[ Box of Features ]

A collection of Prefabs for TF2!






Hello there!
In this section I'll try to explain how to use these prefabs...
Most of these prefabs need a unique name if there are multiple instances, make sure to use the Replace tool
Replace XXX with a name of your choosing.

I've highlighted in <!>red<!> each prefabs' problems.
To use the prefabs just drop the attached ◄◄( Team Fortress 2 )►► folder in:
C:\Program Files (x86)\Steam\steamapps\common

Then in Hammer:
Select the Entity Tool :entitytool:, then on the right you should see something like this...

"All Class Toolboxes" (with custom buildings!)
<!> Requires some custom textures and models, they are in the .zip, remember to pack 'em <!>
<!> Every prefab has the filters it needs for it's building, however most of them are shared and only one should be in your map, they can be easily found inside the containers <!>
<!> Messes up the players targetname, please refer to TempNameDealer for a workaround <!>

Spice up your MvM maps with more guns!
You've heard the sound of Medicine, now it's time to taste the Metal (and lead).

> How to use the Toolboxes?

With this prefab you can summon "Toolboxes", which the players can carry around and drop by hitting the ground below them with a melee weapon.
To start building just hit the toolbox.


> How to Summon the Toolboxes?
By using "env_entity_maker"'s ForceSpawn/ForceSpawnAtEntityOrigin inputs, the makers are:
- box_toolbox_sentry_red_lvl_1_maker
- box_toolbox_sentry_red_lvl_2_maker
- box_toolbox_sentry_red_lvl_3_maker
- box_toolbox_sentry_blue_lvl_1_maker
- box_toolbox_sentry_blue_lvl_2_maker
- box_toolbox_sentry_blue_lvl_3_maker
- box_toolbox_dispenser_red_lvl_1_maker
- box_toolbox_dispenser_red_lvl_2_maker
- box_toolbox_dispenser_red_lvl_3_maker
- box_toolbox_dispenser_blue_lvl_1_maker
- box_toolbox_dispenser_blue_lvl_2_maker
- box_toolbox_dispenser_blue_lvl_3_maker
- box_toolbox_amplifier_red_maker
- box_toolbox_amplifier_blue_maker
- box_toolbox_stunner_red_lvl_1_maker

- box_toolbox_stunner_red_lvl_2_maker
You can also summon the building itself by replacing "toolbox" with "object".

> Custom buildings?
That's right!
2 new buildings:
This building needs no presentation... It's the AMPLIFIER!
And also the stunner, it has two levels and I think it's cool.
(Amplifier by Jumento M.D. and textures by Eggman.

> What else?
+ Ownership! The player that hits the toolbox will be the building's Owner! This includes the Amplifier which you can pick up as engineer (Special thanks to @Yaki whose maps helped me make the pick-up system!)
+ Clean! No entities will be left around the world when you use them;
+ Safe! Lots of testing went into making sure that no unfunny problems came up (a flying building is funny).
+ Directionable! The building's facing direction is based on where you hit the toolbox from.
There is a ~0.15 seconds window after hitting the toolbox when if the builder changes it's targetname then the building from AllClassToolboxes won't be oriented.
+ Why? These buildings were originally made for the Guardian Dynamica contest back in 2020-2021, where you had to basically create a MvM gamemode, I tried and made gd_pelago.

"HUD Counters"

<!> Requires all 6 game_text channels <!>
<!> When a player respawns the counter may disappear, output
"OnSomething | hud_counter_XXX_text* | Display"
to display the text once in a while or after a player respawns <!>

Did you know? While in game you can't see the value inside of a math_counter, not even with ent_dump.
And TF2 is too damn old, no SetText for us!

That makes it really annoying to debug math_counters, so here's a solution!

With this prefab, you get a special math_counter, when you update it's value, the number on the HUD will update as well!

Comes in 2 flavors:
- 6 digits
- 5 digits + title

The counter has been programmed so that the HUD refresh happens ONLY when the math_counter is updated, at least every 0.5 seconds if it's continuously updating, or after 0.2 seconds with no additional updates.

"Player LOS sensor"
<!> DEPENDENCY: Unique Name Applier (do not change the trigger_multiple's targetname) <!>
L.O.S. stands for Line Of Sight

An actual feature!
Sometimes you want to check if a player is visible from somewhere, and thanks to a "generic_actor" you can check for LOS.
This is nothing more that a setup for a basic "generic_actor", it can fire OnFoundPlayer <string> and OnLostPlayer.
Also check out @SpookyToad 's guide:

Some anti-lag precautions have been taken, since the saucer needs to be updated every time a new player joins it got ugly when the game started with a lot of players, so the update is delayed with the simple "CancelPending -> Trigger again" trick.

> What can you do with this?
<!> DEPENDENCY: Unique Name Applier (do not change the trigger_multiple's targetname) <!>
<!> Requires to manually update the two light_dynamics' angles if rotated <!>

Ermh... Proabably would look better as .gif.
It's a Camera which follows players (the closest one), and it does so smoothly! Not func_rotating smooth, but 10fps smooth.

Video tutorial:

"Unique Name Applier"
<!> BE CAREFUL IF YOU CHANGE THE NAMES, THIS MAY CRASH THE GAME, check TempNameDealer for a workaround <!>
<!> Requires the players' OnUser1 <!>

Assignes to players who touch the trigger a unique player name, the trigger should be around the spawn points.

I've tested it with bots (worst-cases) and the game didn't crash if the names never changed, this has yet to be tested on a real server.

Basically a player when it asks for a name will get one but if a player already has that name the latter will ask on account of the former to have another name.
It's a cool game of using the !activator (the one time it actaually works).

The assigned targetnames are "name_1" ... "name_32".

There are two versions:
- Simple (left picture):
Incredibly simple logic, but the players' unique targetnames must not change!
- Disableable (right picture):
A bit more complex, but the system can be disabled so that the unique targetnames can be temporarily changed, the system should be enabled back ONLY when the unique targetnames are given back (Check TempNameDealer to see how).

"Dropped Healthkit Maker"
Embrace the power of item_powerup_rune!

I'll add this here:
You can change the gravity of a item_powerup_rune to make it fly straight when spawned with PostSpawnSpeed from an env_entity_maker.
This was used to make the projectiles in boss_spamton_neo.

"Preserved Entities"
<!> Uses entities that don't exist until the game starts <!>

Did you know that some entites are preserved between rounds?
Did you also know that you can make any entity a preserved one?

Here is a really simple but super useful prefab, with this you can preserve entities between rounds.

I've included a prefab that uses this feature to add round-specific events.

> Can't you just update the classname?
When a new round starts, every non-preserved entity is respawned, this includes entities which had their classname changed to be preserved, leading to two copies of the same entity but with diffrent classnames.
Luckily logic_auto has an output that is fired only when the map first starts, so it's possible to change the preserved one's targetname and ignore the "original" when it's respawned.

"Halloween Setup"
Enables halloween and spells.
Also includes the entities and outputs required to teleport to Hell.

"Shop System"
<!> Bad <!>
I hate this so much, there is no way to turn it into a good prefab!
This prefab is divided in two parts:
- Shop Handler (place 1)
- Shop Product (place and rename as many as you want)

So... Please take this prefab as a demonstration that getValue correctly selects the !caller.
<!> The engine has a bug that makes this super useful output a bit problematic: it doesn't work when you want to fire the !caller's OnUsers output (because getValue returns a number that OnUser doesn't want), this bug is actually already documented on the wiki<!>

"Temp Name Dealer"
<!> Requires the players' OnUser4 <!>
<!> Don't spam the FireUser4s! (***) <!>

Yeah I was suprised too when all it took was a single filter, one for every player targetname you are using.

Should be used instead of "AddOutput targetname XXX" on the !activator player. By using FireUser4 on this filter the activator will update its name to XXX and using FireUser4 on the player will return either it's FIRST name or PREVIOUS name, depending on which of the two variants you are using.
Either way only one name is memorized at a time.

(***) When using the FIRST variant, the order of memorized names gets messed up when the FireUser4s are spammed (at the speed of a minigun)... It's something you have to workaround.
- If the project is simple enough, then consider removing the OnPass output on every "temp_name_dealer" that deals names that aren't critical for the map (so that they aren't memorized and thus can't override the original name).
- In the example below "builder" isn't critical and doesn't need to be memorized, but the "name_..." from UniqueNameApplier is very critical and must be memorized.
So the OnPass output is removed from "temp_name_dealer_builder" (and every other temp_name_dealer that isn't a temp_name_dealer_name_...) and now there should be no way for the players to forget their assigned name (and possibly crash the server).

Do note that you can also replace XXX with blank.

> Why?
For example, you can't use AllClassToolboxes and UniqueNameApplier together, because AllClassToolboxes needs for a brief moment to change the player's targetname, but UniqueNameApplier requires that the names do not change!
This is where TempNameDealer comes in handy!
Don't use


And the player will receive it's previous name.
The disabling is necessary to avoid breaking the system and crashing the game, so use "UniqueNameApplier (disableable)".

Box Of Paper
First release
Last update

More downloads from Box Of Paper

Latest updates

  1. New Prefabs: Homing Rockets and Incremental PowerUps

    New folder structure = new Major Version, you can delete the old versions. Ramblings: With Vscript coming to TF2, I figured I'd update Box Of Features with my latests prefabs before they become outdated. These two prefabs were meant for...
  2. New Prefab: "Disableable Unique Name Applier"

    New Update! New Prefab: Unique Name Applier (disableable) Here it is! A way to temporary change the players' unique targetnames (given by UniqueNameApplier) and not crash the game! More in depth... You can now change the players' targetname...
  3. Major Update! v2.0.0

    New Update! Everything from the previous version has been reworked, and a lot of new features have been added! Major Update means that you might as well remove the old "BoxOfFeatures" folders. What changed? + Complete rework of the All Class...

Latest reviews

It a lot of help for future maps