Pit: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Updating the tutorial)
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar}}
|ru=Pit:ru
[[File:pit.png|thumb|right|250px|"Could you just jump into that pit?" <br>- '''Wheatley''']]
}}
'''Death pits''' are used as obstacles in [[Portal 2]] and destroy objects and players that drop into them, just like [[Shredder|shredders]] and [[slime]]. They trigger a fade to black for players that fall into them.


'''Bottomless pits''' are used as obstacles in [[Portal 2]] and destroy objects and players that drop into them, just like [[Shredder|grinders]] and [[slime|deadly goo]]. They trigger a fade to black for players that fall into them.


== Entities you need ==
== Entities you need ==
*[[trigger_hurt]] - Using the block tool
*[[player_loadsaved]] - Using to load to a recent save


[[trigger_hurt]] (using the block tool)
Optional:
*[[trigger_multiple]] - For destroying objects like [[prop_weighted_cube]]


== Making the deadly pit ==
Take your {{hammer block}} and make a block, with the trigger texture, in the place where you want the player's death. After that press {{Key|Ctrl|T}} and make the it '''trigger_hurt'''. You can see many properties but we are only going to use the {{code|Damage}}, {{code|Damage cap}} (only if you have chosen Doubling w/Forgiveness) and the {{code|damage type}} properties.
Change {{code|Damage}} and {{code|Damage cap}} to 1000, and for {{code|Damage type}} to {{code|FALL}}.
Create an entity with {{hammer entity}} and change it to '''player_loadsaved''', add a name like "player_loadsaved", then change {{code|Fade Duration (seconds)}} to 1, {{code|Hold Fade (seconds)}} to 5 and {{code|Reload Delay}} to 3, these parameters are used in official maps.
Optionally you can create a brush to destroy objects, simply copy the '''trigger_hurt''' and move it down, if you have a fog then move it just enough that you don't see the object getting destroyed, and change the class to '''trigger_multiple'''.
Set these flags to checked and the rest to unchecked:
* Pushables
* Physics Objects
* Physics debris
== Outputs ==
Add this output for '''trigger_hurt''':
{| class=standard-table
!
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once
|-
| [[File:Io11.png]] || OnStartTouch || player_loadsaved || Reload|| &nbsp; || 0.00 || No
|}
Add these outputs for '''trigger_multiple''':
{| class=standard-table
!
! My Output > !! Target Entity !! Target Input !! Parameter !! Delay !! Only Once
|-
| [[File:Io11.png]] || OnStartTouch || !activator || SilentDissolve || &nbsp; || 0.00 || No
|-
| [[File:Io11.png]] || OnStartTouch || !activator || Kill|| &nbsp; || 0.10 || No
|}


== Making the deadly pit ==
The {{code|SilentDissolve}} input destroys cubes and fires their {{code|OnDissolved}} output correctly, so they can respawn. The {{code|Kill}} output removes other entities that ignore {{code|SilentDissolve}}. It is delayed to ensure {{code|SilentDissolve}} executes first.


Take your block tool and make a block, with the trigger texture, in the place where you want the player's death. After that press '''[Ctrl+T]''' and make it [[trigger_hurt]]. You can see many properties but we are only going to use the "damage", "damage cap" and the "damage type" properties.
If there is no output for {{code|SilentDissolve}}, the player won't able to get a new cube, this could lead to a [[W:Glossary_of_video_game_terms#softlock|soft lock]] in your level.


== Final things you need to do ==
== See also ==
* [[Slime Water]] - For creating deadly goo


Change the number of the "'''damage'''" property and put a high number (e.g '''1000'''). Do the same with "'''damage cap'''" and then choose the "'''damage type'''" property and select "FALL".
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Tutorials]]
[[Category:Portal 2 Tutorials]]

Latest revision as of 14:08, 12 March 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)
"Could you just jump into that pit?"
- Wheatley

Bottomless pits are used as obstacles in Portal 2 and destroy objects and players that drop into them, just like grinders and deadly goo. They trigger a fade to black for players that fall into them.

Entities you need

Optional:

Making the deadly pit

Take your Block tool Hammer block.png and make a block, with the trigger texture, in the place where you want the player's death. After that press Ctrl+T and make the it trigger_hurt. You can see many properties but we are only going to use the Damage, Damage cap (only if you have chosen Doubling w/Forgiveness) and the damage type properties.

Change Damage and Damage cap to 1000, and for Damage type to FALL.

Create an entity with Entity tool Mt-entities.png and change it to player_loadsaved, add a name like "player_loadsaved", then change Fade Duration (seconds) to 1, Hold Fade (seconds) to 5 and Reload Delay to 3, these parameters are used in official maps.

Optionally you can create a brush to destroy objects, simply copy the trigger_hurt and move it down, if you have a fog then move it just enough that you don't see the object getting destroyed, and change the class to trigger_multiple.

Set these flags to checked and the rest to unchecked:

  • Pushables
  • Physics Objects
  • Physics debris

Outputs

Add this output for trigger_hurt:

My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch player_loadsaved Reload   0.00 No

Add these outputs for trigger_multiple:

My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch !activator SilentDissolve   0.00 No
Io11.png OnStartTouch !activator Kill   0.10 No

The SilentDissolve input destroys cubes and fires their OnDissolved output correctly, so they can respawn. The Kill output removes other entities that ignore SilentDissolve. It is delayed to ensure SilentDissolve executes first.

If there is no output for SilentDissolve, the player won't able to get a new cube, this could lead to a soft lock in your level.

See also