Discouragement Field: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Written up a tutorial on making them. Not sure if it's the "proper" way, but it recreated the effect perfectly.)
(Replaced build-from-scratch tutorial by an instance tutorial)
Line 1: Line 1:
[[File:Death field 1280.jpg|thumb|right|Death Field example.]]
[[File:Death field 1280.jpg|thumb|right|Death Field example.]]


The '''Death Field''' is a special energy field in [[Portal 2]] which kills any player touching it, but not destroying other objects. It can be considered as the counterpart to the [[Emancipation Grid]].
The '''Discouragement Field''' or '''Death Field''' is a special energy field in [[Portal 2]] which kills any player touching it, but not destroying other objects. It can be considered as the counterpart to the [[Emancipation Grid]].


== Tutorial ==
== Tutorial ==
* Create two [[prop_static]] entities
* Download these two instance files: [http://nuclearvelocity.com/barracuda/downloads/portal2/instances/death_field_128x128.vmf death_field_128x128.vmf] and [http://nuclearvelocity.com/barracuda/downloads/portal2/instances/death_field_256x256.vmf death_field_256x256.vmf] and put them into your instance folder under ''instances\gameplay''.
** set their world-model to <code>props/fizzler.mdl</code>.
* Create a new [[func_instance]] in your map, select ''VMF Filename'' and click ''Browse...'' on the right and select one of the two death field instances.
** set their skin to <code>2</code>
* The Discouragement Field is now ready and active on default. If you want to activate or deactivate the field, follow these steps:
* Position the models at either side of where you want the ''Discouragement Field'' to be.
** Give the func_instance a name (''Fix Up Name''), for example <code>death_field_1</code>.
* Create a brush between the models, with a depth of 2 hammer units. (There are little notches in the fizzler.mdl - 2 units fits the notch perfectly).
** Create a trigger or button somewhere and give it these outputs:
** Set the brush's texture to <code>tools/toolsnodraw</code>.
** Set the texture of the 2 faces either side of the ''Discouragement Field'' to <code>effects/laserplane</code>
** Turn this brush into the [[func_brush]] entity, call it ''laserfield_brush''.
* Create a new brush the same size as ''laserfield_brush''.
** Set it's texture to <code>tools/toolstrigger</code>
** Convert it into the brush entity, <code>trigger_hurt</code> and name it ''laserfield_hurt''.
*** Set it's "Damage" to <code>999</code>
*** Set it's "Damage Cap" to <code>999</code>
 
* Create a [[logic_relay]] with the name ''lasergrid_off''
** Set the following outputs:
{| class=standard-table
{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger || laserfield_brush || Disable || <none>  || 0.00 || No
| [[Image:Io11.png]] || OnTrigger || death_field_1 || instance:enable;Trigger || <none>  || 0.00 || No
|-
| [[Image:Io11.png]] || OnTrigger || laserfield_hurt || Disable || <none>  || 0.00 || No
|}
|}
* Create a [[logic_relay]] with the name ''lasergrid_on''
(for activation)
** Set the following outputs:
 
{| class=standard-table
{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger || laserfield_brush || Enable || <none>  || 0.00 || No
| [[Image:Io11.png]] || OnTrigger || death_field_1 || instance:disable;Trigger|| <none>  || 0.00 || No
|-
| [[Image:Io11.png]] || OnTrigger|| laserfield_hurt || Enable || <none>  || 0.00 || No
|}
|}
* Turn the ''Discouragement Field'' on or off via the <code>Trigger</code> input of ''lasergrid_on'' and ''lasergrid_off''.
(for deactivation)
 
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Tutorials]]

Revision as of 02:03, 16 May 2011

Death Field example.

The Discouragement Field or Death Field is a special energy field in Portal 2 which kills any player touching it, but not destroying other objects. It can be considered as the counterpart to the Emancipation Grid.

Tutorial

  • Download these two instance files: death_field_128x128.vmf and death_field_256x256.vmf and put them into your instance folder under instances\gameplay.
  • Create a new func_instance in your map, select VMF Filename and click Browse... on the right and select one of the two death field instances.
  • The Discouragement Field is now ready and active on default. If you want to activate or deactivate the field, follow these steps:
    • Give the func_instance a name (Fix Up Name), for example death_field_1.
    • Create a trigger or button somewhere and give it these outputs:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger death_field_1 instance:enable;Trigger <none> 0.00 No

(for activation)

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger death_field_1 instance:disable;Trigger <none> 0.00 No

(for deactivation)