User:Mattshu/sandbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{wrongtitle|Creating a laser}}
{{wrongtitle|Creating a laser}}
{{portal2}} This tutorial will walk you through the basics of adding a laser beam with relays and a catcher to your Portal 2 map.


{{todo|Add pictures}}
{{todo|Add pictures}}
{{portal2}} This tutorial will walk you through the basics of adding a laser beam with nodes and a receiver to your Portal 2 map.


{{note|This tutorial is currently using [http://www.moddb.com/games/portal-2/tutorials/getting-setup-for-portal-2-mapping an alternate method] to create Portal 2 maps. Some entities must be manually written in Hammer. This will most likely need updated once the official SDK is released.}}
{{note|This tutorial is currently using [http://www.moddb.com/games/portal-2/tutorials/getting-setup-for-portal-2-mapping an alternate method] to create Portal 2 maps. Some entities must be manually written in Hammer. This will most likely need updated once the official SDK is released.}}
Line 35: Line 35:
Using Hammer's handles (the X marks you see that shows the center of a brush), line up the new entity inside your hole. Make sure the laser is pointing in the direction you'd like it to.
Using Hammer's handles (the X marks you see that shows the center of a brush), line up the new entity inside your hole. Make sure the laser is pointing in the direction you'd like it to.


= Creating laser nodes =
= Creating the relay =
 
This also requires a ''64 x 64 x 32'' hole.
 
Create a new entity and name it '''prop_laser_relay''' with the following keyvalues:
 
:{| {{standard-table}}
! Key || Value
|-
| angles || 0 0 0
|-
| model || models/props/laser_receptacle.mdl
|-
| targetname || ''name of the catcher (required for logic entities)''
|-
| vscripts || laser_target/musical_laser_catcher.nut
|-
|}
{{note|Once again, these are the defaults taken from the Portal 2 map as mentioned above. Feel free to play with the values. With an angle of 0 0 0, the laser relay will be placed facing up.}}
 
As done before, line up the entity with Hammer handles, but raise it so it will be lined up with the real floor surface.
 
= Creating the catcher =
 
Once again, create the standard ''64 x 64 x 32'' hole in your wall.
 
Create a new entity and name it '''prop_laser_catcher''' with the following keyvalues:
 
:{| {{standard-table}}
! Key || Value
|-
| angles || 0 0 0
|-
| model || models/props/laser_catcher_center.mdl
|-
| skin || 0
|-
|}

Revision as of 20:01, 25 April 2011

Template:Wrongtitle

Portal 2 This tutorial will walk you through the basics of adding a laser beam with relays and a catcher to your Portal 2 map.

Todo: Add pictures
Note.pngNote:This tutorial is currently using an alternate method to create Portal 2 maps. Some entities must be manually written in Hammer. This will most likely need updated once the official SDK is released.

Creating the beam

First you'll need to create the base for the laser. If you're attaching the laser to the wall, you'll need a 64 x 64 x 32 space in the wall.

Then create a new entity named env_portal_laser and create the following keyvalues:

Key Value
StartState 0
angles 0 90 0
skin 0
AutoAimEnabled 1
model models/props/laser_emitter_center.mdl
drawinfastreflection 0
LethalDamage 0
Note.pngNote:These were the default values as found in Portal 2's official map sp_a2_column_blocker. The only value you need to worry about changing is angles.

Using Hammer's handles (the X marks you see that shows the center of a brush), line up the new entity inside your hole. Make sure the laser is pointing in the direction you'd like it to.

Creating the relay

This also requires a 64 x 64 x 32 hole.

Create a new entity and name it prop_laser_relay with the following keyvalues:

Key Value
angles 0 0 0
model models/props/laser_receptacle.mdl
targetname name of the catcher (required for logic entities)
vscripts laser_target/musical_laser_catcher.nut
Note.pngNote:Once again, these are the defaults taken from the Portal 2 map as mentioned above. Feel free to play with the values. With an angle of 0 0 0, the laser relay will be placed facing up.

As done before, line up the entity with Hammer handles, but raise it so it will be lined up with the real floor surface.

Creating the catcher

Once again, create the standard 64 x 64 x 32 hole in your wall.

Create a new entity and name it prop_laser_catcher with the following keyvalues:

Key Value
angles 0 0 0
model models/props/laser_catcher_center.mdl
skin 0