Portal 2

Portal 2

Not enough ratings
p0rtalmaster's Hammer Guide Series Part 06/19
By The Sojourner
Hello and welcome to part 06/19 of my series of mini-guides, designed to help you learn perhaps what is the biggest part of the Portal 2 Authoring tools: Hammer.

For a super-quick version of this series, please check out my other guide, Hammer for the Flustered.
   
Award
Favorite
Favorited
Unfavorite
Intro
The Vital Apparatus Vent will deliver...
~ GLaDOS

This is a somewhat more advanced guide about Aperture's Vital Apparatus Vents for gels and cubes, and so it may be bypassed without loss of continuity, just as some test chambers are sometimes bypassed in the same way. That being said, they are rather important apparatuses, and as such I will at least show you somewhere to begin.
Using Valve's Instances
If you're lazy and don't really have the time to make your own instance of a cube dropper, you can go with one of Valve's instances that they used in their maps. They are located in the maps\instances\gameplay directory:
  • cube_dropper_shared.vmf: this is the core instance for the cube dropper, containing all the logic stuff necessary for it to work.
  • cube_dropper_monster_box.vmf: used to drop frankencubes instead of normal cubes. May be buggy.
  • reflectocube_dropper_*.vmf: used for redirection cubes instead of normal cubes.
  • sphere_dropper_*.vmf: used for edgless safety cubes instead of normal cubes.

NB there are also "dirty" versions of the above (except for spheres) for decayed- and reconstructing-themed maps.
Also, be aware that some of Valve's instances were made for special, one-time, in-game scenes or were leftovers from the development stages, and may be buggy.

To control them:
  • To drop a cube at the touch of a button, trigger the $trigger_to_drop_box or @cube_dropper entity inside the instance.
  • To enable auto-respawn, use a logic_auto and set it to enable the @cube_dropper_autorespawn entity inside the instance.
  • If you want your cubes to spawn the first time, you'll also need a logic_auto (or a trigger_once by the entrance). Simply set it to drop a cube once.

I also recommend tweaking these instances to fit your needs if needed. Just be sure to save in a separate file.
Science from Scratch: Making Your Own Cube Droppers
I myself have spent a fair bit of time wondering how many bare entities it would take to make a perfectly working cube dropper, and I think I've come to a rather definite conclusion on the number: 7. The rest is just details. At the core, we have:


  • A prop_dynamic which will be the dropper model
  • A point_template
  • An env_entity_maker to continually spawn cubes for each time one gets lost
  • A prop_weighted_cube or prop_monster_box, 'cause we all love our companion cubes!
  • A logic_auto
  • A trigger_multiple, set to filter out only cubes (use a filter_activator_class to do the job)

Everything except the point_template and the logic_auto will need a name. To begin, in the env_entity_maker, set its "Point_template To Spawn" keyvalue to your point_template, and in your point_template, set under "Template 1" the name of your cube.

For the "details" part, we have:
  • A button or other activator unless your cube is going to have some sort of auto-respawn
  • Clipping brushes (useful if your dropper is near the floor)
  • Lighting to match the dropper skin changes (see Valve's redirection cube instances for a good way to do it)

To set this up, you'll need to place all the entities accordingly:



Next, you'll need to set up the I/O:





...and there you have it, a cube dropper you can be proud of.

To simulate the "auto-drop first cube" behavior, have a trigger_once (positioned in an area either near the start of the chamber or when the player enters the room with the dropper) in place of the first button press.

To enable/disable auto-respawn, just add/remove the output coming from the cube.

One thing to be wary of with all cube droppers is if you're not using the normal pedestal button (prop_button) for an input device. In that case you can use an additional logic_relay to gate your input to 3-second intervals (assuming auto-respawn is off), so as to prevent spamming from ruining everything:


Droppers with a Pre-placed Cube
For this, you'll need a cube and a cube dropper of the same type (see above...).

If you don't have auto-respawn on and have a button for the dropper:
1) Create your cube and give it a name.
2) Create your button and set it to drop a cube when pressed.
3) Set up an additional output for the button: to fizzle (dissolve) your pre-placed cube when pressed.

If you have auto-respawn on and no button for the dropper:
1) Create your cube and set it to drop a cube.
2) That's it!

The advantage that this has is that now you can (for example) place a cube up high on a ledge but have the dropper in the middle of the room so that the player doesn't have to go through the tedium of retrieving the cube again. You might also use it to bring the cube a bit closer to the players when they enter an area while leaving the dropper a bit further away.
Open Droppers
These are, perhaps surprisingly, easier to make than the gated cube droppers that we've seen a bazillion times.

To do it, you'll need:


  • Some prop_statics for the pneumatic diversity vent used to deliver the cube
  • Optionally, some trigger_pushes to move the cube out of its spawn position and into the testing area
  • A trigger_multiple with a filter_activator_class on it, set for prop_weighted_cube
  • A logic_relay
  • A prop_weighted_cube (or prop_monster_box), a point_template, and an env_entity_maker

Name everything except the props and trigger, and then as before, in the env_entity_maker, set its "Point_template To Spawn" keyvalue to your point_template, and in your point_template, set under "Template 1" the name of your cube.



If you don't have auto-respawn on and have a button for the dropper:



If you have auto-respawn on:


Droppers and prop_paint_bomb
Interestingly, all gel isn't always dispensed in the same way. Sometimes it's a flow, and other times it's a great, big ball of gel. We'll soon see how to create the former, but the latter requires another entity: prop_paint_bomb. In either case, you can set the type of gel you want to use.

While the open droppers aren't really used for cubes, they are used for those big "paint bombs" that have been cutely exploited for their ability to bounce off of faith plates. The creation process is almost the same as for open droppers with auto-respawn, but since the droppers can continually be dropping gel bombs, you'll need a logic_relay to control the gel flow if you have an input device for it. Here are the details:

You'll need:


  • Some prop_statics for the pipe(s) used to deliver the gel
  • A logic_relay
  • A prop_paint_bomb, a point_template, and an env_entity_maker
  • Depending in your input device, a second logic_relay

Name everything except the props, and then as before, in the env_entity_maker, set its "Point_template To Spawn" keyvalue to your point_template, and in your point_template, set under "Template 1" the name of your prop_paint_bomb.



The setup is identical to open droppers. However the I/O is a little different.

If you don't have an input device and just want the gel to keep on flowing, as I said before, you don't even need the logic_relay. All you need to do is to set your prop_paint_bomb (via the OnExploded, NOT the OnFizzled, output) to spawn a new one (using the env_entity maker's ForceSpawn input) after half a second.

If you have a pedestal button (perhaps with a ticking timer on it):




As with cube droppers, the I/O is a little different when any other input device is involved. In that case, you'll need a second logic_relay and these I/O for everything:





This will prevent spammers from wreaking havoc on your gel dropper(s).
Mistakes to Avoid & More Information

  • I really can't think of many mistakes other than to use too many entities in a cube or gel dropper.
  • Forgetting to debug droppers might be one mistake, but overall...
  • Droppers aren't always common in Hammer maps on the workshop, so I can't seem to find many mistakes for this guide.
  • And that's good, isn't it?

More information from the VDC Wiki:
Master Guide List
Please note that there are still some works in progress. This section will be updated as I finish more guides for you!

You are currently viewing part 06/19 in the series.

| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |

Previous Guide (about indicator lights and checkmarks/timers)
Next Guide (about panels and platforms)

Please feel free to leave a well-reasoned question or comment below. Either I or a qualified Test Chamber Associate (you'll know because they make all the good maps on the workshop) will respond. If your question or comment is not well-reasoned, I recommend reading over my guides again until you understand them 100%. No further information is required here or will be provided, and you will become an excellent Test Chamber Designer — using Hammer!

25 Comments
Cmonster820 11 May @ 5:45pm 
for some reason, when I try to use multiple of the prefab droppers, it just breaks everything. Why?
Olepa 28 May, 2022 @ 5:37am 
A bit late reply to one of the comments, but I was trying to make dropper not auto-drop the first cube too. If it helps anyone, it works when I set 'Start Disabled' on trigger_multiple to 'Yes'

(Also, to make it work correctly, you should also check 'Physics Objects' flag in that trigger's flags, which sadly wasn't mentioned here)
conduitseawing 22 May, 2022 @ 12:39pm 
I tried building a cube dropper from scratch, using the steps you provided, however, the cube doesn't appear. The logic_auto does Force Spawn the spawner on map spawn.
The Sojourner  [author] 7 May, 2022 @ 11:04pm 
The basic idea is that you have a logic_auto to pre-load the cube dropper (assuming you're not using an open dropper, in which case, you shouldn't need a logic_auto in the first place, given what you're looking for), which should start closed, and then a button to open the dropper and drop the cube. Do you have a trigger in the map near the entrance by any chance? If so, check to see that it's not sending any outputs to your cube dropper. If you're using the I/O exactly as shown, it should be 100% button-controlled (with auto-respawn, so that the test subject doesn't have to repeatedly go back and press a button).

The same should be true if you're using one of Valve's instances: they should only auto-drop the first cube if you have a specific mechanism for doing so.

Hope this helps. Good luck!
oyqea NtrTAYnMnt 7 May, 2022 @ 7:43pm 
So, I have a problem. The cube dropper auto-drops the first cube as soon as the map is loaded, when it's supposed to be doing it when the button is pushed. Either I misread something, or I'm just stupid.
The Sojourner  [author] 19 Jan, 2021 @ 7:37am 
Good question. For pre-placed gel, the trick is to use an info_paint_sprayer , have it on, and then quickly shut it off (this can be done with a logic_auto and some input delay). Make sure there are no sounds emanating from these info_paint_sprayer s.
Coordinati Coglione 9 Jan, 2021 @ 2:44am 
Great Guide my friend! May I ask you if you know how to add gel on surfaces without streams and droppers?
Madeline 20 Sep, 2020 @ 12:54am 
I followed your guide and tried to make a cube dropper by myself. When I tested it in the game, I found that nothing happened. I was very confused, and then I checked step by step to make sure it was consistent with the guide, but it still didn't work. So I went to disassemble Valve's cube dropper and found that your guide was missing an important step, which is to set the flags of trigger_multipe.
rynegeist 12 Aug, 2020 @ 2:34am 
Just learnt that thats also the reason why overlays wont appear! ;) Thanks
rynegeist 12 Aug, 2020 @ 1:27am 
Ahh, okay. Thanks!