Apparently I can't attach a txt file for the aforementioned documentation, so here it is:
CP4P - Common Prefabs for Portal
This is a set of prefabs intended for creating common gameplay elements in Portal.
They are designed with the following in mind:
* Easy alignment to the grid (when feasible)
* No excess baggage
* Consistent naming scheme designed to not conflict with other entities not related to CP4P
* All prefabs are documented.
* Prefab origin makes sense.
Most named entities use a naming scheme that is:
* Instance-able. Most named entities use &i somewhere in their name so multiple copies can coexist. Exceptions may exist for entities that should only need to exist once per map, or where multiple entities with the same name is acceptable.
* Named to not conflict with existing entities. All entity names begin with "CP4P_" (and expect similiar)
* Work with wildcards in such a way where additional components of a prefab will not inadvertently be affected as well.
Prefabs try to designate a minimal set of entities for communication with 'the outside world'. For instance, a multipart door only requires a single set of inputs (one to open and one to close) to a single connection point, rather than having to instruct each side of the door to open/close individually.
About &i:
Hammer allows prefabs to use "&i" in entity names. This is a token that will be replaced by a unique number when the prefab is inserted in a map, which allows multiple copies of a prefab to coexist peacefully without stepping on each other's entity names.
All CP4P prefabs use &i tokens on named entities, except for those which should only exist once per map (such as those created by the "Common CP4P Dependencies" prefab.)
=====Common CP4P Dependencies=====
Description:
This is a small set of common entities required by other CP4P prefabs (among other things). All of the entities are in a sealed nodraw room that is intended to be isolated from the rest of the world.
Included here is:
* CP4P_filtercubes - a filter_activator_name that filters for boxes. Used by big buttons to ensure the object sitting on them is, in fact, a cube (as opposed to a camera or turret or other physics object).
* CP4P_filterballs - A filter_combineball_type that filters combine energy balls. Used for proper functioning of ball catchers.
* CP4P_cube_storage and CP4P_template_cube_storage - A weighted storage cube and a template used to spawn it. Used for box droppers.
* CP4P_cube_companion and CP4P_template_cube_companion - A weighted companion cube and a template used to spawn it. Used for box droppers.
* Aperture_AI - A generic_actor used to make GLaDOS speak in your levels, as documented at http://developer.valvesoftware.com/wiki/Making_GLaDOS_speak
* An unnamed water_lod_control should you use water or slime in your level, built with default values.
Source:
Various, but mostly built from scratch by Dewin.
Usage:
* Place one (and only one) instance of this prefab in your level. There is no need for multiple instances, regardless of how many CP4P prefabs are used.
* You may delete unused components. For example, a level with no energy ball catchers does not require CP4P_filterballs.
=====Ball Launcher=====
Description:
Ball Launcher, a producer of high-energy pellets.
Source:
Test Chamber 13 (decompiled with VMEX) used as a reference.
Modifications for CP4P by Dewin.
Dependencies:
none
Usage:
* Insert in map and rotate as desired.
* Make sure CP4P_launcher_&i points the correct direction... sometimes it isn't rotated when the rest of the group is.
* Adjust the other attributes of CP4P_launcher_&i as needed (respawn time, minimum lifetime, lifetime after portal transition, etc.)
=====Ball Catcher=====
Description:
Ball Catcher, as seen as the ultimate destination of an high-energy pellet.
Source:
"Portal Prefab Pack" created by Youme -- http://forums.thinking.withportals.com/dload.php?action=file&file_id=19
Altered for CP4P by Dewin.
Dependencies:
* CP4P_filterballs
Usage:
* Place at desired location. You may delete or retexture the backing brushes, however, be sure to keep a 32x32x8 'hole' behind the catcher -- source: http://developer.valvesoftware.com/wiki/Creating_an_energy_ball_launcher_and_catcher#See_also
* Add desired OnTrigger outputs to the trigger brush (CP4P_catcher_&i).
=====Big Button=====
Description:
A big floor button ("Aperture Science 1500-Megawatt Supercolliding Superbutton") that can be activated by a storage cube or the player.
Source:
Derived from testchmb_a_05. Modified for CP4P by Dewin.
Dependencies:
* CP4P_filtercubes
Notes:
* Regular portal maps (at least testchmb_a_05) have buttons on a platform slightly raised above the rest of the floor. This platform is included in the prefab, but may be deleted if not required. (It also serves to ease grid alignment.)
* The platform in regular portal maps has four overlays (one on each corner) for aesthetics. These overlays are not present on this prefab, as Hammer has issues inserting prefabs with overlays and maintaining proper rotation.
Usage:
* Create "OnOpen" and "OnClose" outputs of CP4P_bigbutton_button_&i connected to entities of your choice. The CP4P_bigbutton_button_&i entity is the 'nodraw' brush directly beneath the button's top.
* OnOpen fires when the button is pushed, OnClose fires when the button is no longer pushed.
Named Entities:
* CP4P_bigbutton_sndup_&i and CP4P_bigbutton_snddn_&i - ambient_generics for button activation.
* CP4P_bigbutton_button_&i - func_door brush for button activation.
* CP4P_bigbutton_triggercube_&i and CP4P_bigbutton_triggerplayer_&i - trigger_multiples to actually activate the button when a cube or player is on it.
Troubleshooting:
* If your button activates/deactivates rapidly with nothing on it, you probably forgot to include the dependencies.
=====Round Door and Round Door (wide)=====
Description:
A round door.
Source:
Derived from testchmb_a_05
Usage:
* Open or close CP4P_rounddoor_&i as needed.
* CP4P_rounddoor_&i refers to the right side of the door. The left side is automatically linked to the right side via the right side's outputs.
* You may need to adjust the func_door entity angles (CP4P_rounddoor_&i and CP4P_rounddoor_&i_left) if you rotate the door.
Troubleshooting:
* If your door does not open properly, you may need to adjust the angles of the func_door entities (CP4P_rounddoor_&i and CP4P_rounddoor_&i_left)
=====Switch (Timed), Switch (Timed Refreshable), Switch (Simple), Switch (Toggle)
Description:
A small switches/button (func_button).
Multiple variations exist:
Timed: Plays a ticking sound when activated for a set amount of time, and then deactivates.
Timed, Refreshable: Like Timed, only the switch can be re-activated while the countdown is going to start the countdown over.
Simple: For a non-time-related task that might need to be triggered multiple times.
Once: For a one-time-only task, such as permanently opening a door. Switch reminds in 'down' position forever once activated.
Source:
Created by Dewin from scratch from tutorial at http://developer.valvesoftware.com/wiki/Creating_a_switch and related pages
Notes:
* Hammer does not recognize the Enable/Disable inputs on ambient_generics, and will (incorrectly) report an error about bad I/O connections when these prefabs are present.
Usage:
* Insert the desired prefab at the appropriate location.
* For Timed switches (NOT Timed Refreshable):
* Adjust CP4P_switch_&i's (the invisible brush aligned with the button) "Delay before Reset" to the desired duration of the countdown.
* Add inputs to CP4P_switch_&i's OnPressed (activated) and OnOut (out of time) outputs.
* For Timed Refreshable switches:
* Adjust CP4P_switch_&i_logic's (the topmost logic_relay) "OnTrigger !Self FireUser2" output to the desired duration of the countdown.
* Add inputs to CP4P_switch_logic&i's OnUser1 (activated) and OnUser2 (out of time) outputs.
Note: The slightly wonky implementation here avoids duplicate "Open the doors", etc. commands from being sent if the timer is reset, however, the 'switch pressed' sound will play again.
* For Simple switches:
* Adjust CP4P_switch_&i's "Delay before Reset" to the desired delay between activations. Generally, all actions activating the switch begins should be completed before the switch can be reactivated.
* Add inputs to CP4P_switch_&i's OnPressed (activated) and OnOut (out of time) outputs. The OnOut outputs are optional.
* For a one-time-only switch, set "Delay before Reset" to -1.
* For Toggle switches:
* Adjust CP4P_switch_&i's "Delay before Reset" to the desired delay between activations. Generally, all actions activating the switch begins should be completed before the switch can be reactivated.
* Add OnTrue and OnFalse inputs to CP4P_switch_&i_toggle. By default, the OnTrue inputs will fire every odd time the switch is activated and the OnFalse will fire every even.
=====Weighted Storage/Companion Cube=====
Description:
A weighted storage or companion cube.
Source:
Derived from testchmb_a_05. Modified for CP4P by Dewin.
Usage:
* Place storage/companion cube where desired.
* You should consider using one of the boxdroppers instead, especially if your map offers any means of destroying the cube before the player is done using it. (Common design sense suggests maps should be solvable on the first attempt and not require a restart or reload should the player make a non-fatal mistake.)
* It is recommended that you filter based on "CP4P_cube*", which will proper trigger for all storage and companion cube instances on the map.
* If you want to filter against just storage cubes (not companion cubes), filter on "CP4P_cube_storage*"
* If you want to filter against just companion cubes (not storage cubes), filter on "CP4P_cube_companion*"
Named Entities:
* CP4P_cube_storage_&i or CP4P_cube_companion_&i
=====Weighted Storage/Companion Cube Dropper=====
Description:
A box dropper for spawning multiple storage/companion cubes.
Source:
Derived from testchmb_a_05. Modified for CP4P by Dewin.
Dependencies:
* CP4P_cube_storage and CP4P_template_cube_storage, or CP4P_cube_companion and CP4P_template_cube_companion, depending on type.
* CP4P_filtercubes
Notes:
* Both prefabs are identical except for the EntityTemplate of "CP4P_dropper_boxmaker_&i". You can convert between storage and companion cubes by altering its value between "CP4P_template_cube_storage" and "CP4P_template_cube_companion", provided the requisite template exists (see dependencies)
Usage:
* On map load (or before the first box is needed), trigger CP4P_dropper_boxmaker_&i's "Spawn" event to create the initial box.
* Trigger CP4P_dropper_trigger_&i's "Trigger" event no less than 4 seconds later to allow the initial box to drop to the floor.
* Trigger CP4P_dropper_trigger_&i's "Trigger" event whenever a replacement box is needed.
* Many Valve maps delay the actual release of the inital box until a player approaches the generator by using a trigger_once to draw the player's attention to the dropper.
Named Entities:
* CP4P_dropper_boxmaker_&i - env_entity_maker to spawn cubes.
* CP4P_dropper_stopper_&i - func_brush used to hold cubes in the tube until the tube is opened.
* CP4P_dropper_trigger_&i - logic_relay used to trigger the release of a cube and spawning a replacement.
* CP4P_dropper_cover_&i - prop_dynamic animated as part of the cube replacement process. This is the tube 'cover'.
* CP4P_dropper_clear_&i - Used to signal when the box is fully clear of the dropper, which triggers the dropper to close and the next box to be spawned.