Creating an energy ball launcher and catcher: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(POV)
(cleanup (please don't spam the links to related articles. link the first instance and code-tag the rest. TLDR: In formatting, less still is more.))
Line 1: Line 1:
[[Category:Level Design Tutorials]]
== Introduction ==
= Introduction =
The purpose of this tutorial is to illustrate how to create a single ball launcher and have a single ball catcher as its target. Both, the launcher and the catcher instructions will detail how the basic animations as well as the visual and sound effects work.
The purpose of this tutorial is to illustrate how to create a single ball launcher and have a single ball catcher be its target. Both the launcher and the catcher instructions will detail how the basic animations as well as the visual and sound effects work.
 
=The Aperture Science High Energy Pellet Launcher =
== The Aperture Science High Energy Pellet Launcher ==
[[Image:launcher-catcher01.jpg|right|thumb|Launcher Assembly]]
[[Image:launcher-catcher01.jpg|right|thumb|Launcher assembly]]
 
The launcher is comprised of three entities:  
The launcher is comprised of three entities:  
*'''a [[func_brush]]'''
* [[func_brush]]
*'''a [[point_energy_ball_launcher]]'''
* [[point_energy_ball_launcher]]
*'''a [[prop_dynamic]]'''
* [[prop_dynamic]]
 
The model used is:
The model used is:
*'''models/props/combine_ball_launcher.mdl'''
* <code>models/props/combine_ball_launcher.mdl</code>
 
To create the launcher:
To create the launcher:
:1. Create a [[prop_dynamic]] entity (Shift + E) with a World Model of '''models/props/combine_ball_launcher.mdl''' and a name of “ball_launcher”
:1. Create a <code>prop_dynamic</code> entity (<code>Shift+E</code>) with a World Model set to "<code>models/props/combine_ball_launcher.mdl</code>" and the Name key of "ball_launcher".
:2. Place the new entity where you want it in your map
:2. Place the new entity where you want it in your map.
:3. Create a [[point_energy_ball_launcher]] entity (Shift + E) and set its name to "ball"
:3. Create a <code>point_energy_ball_launcher</code> entity and set its name to "ball".
:4. Place the new entity inside the dome of the “ball_launcher” model
:4. Place the new entity inside the dome of the "ball_launcher" model.
:5. Create a new brush 20 units or so square and 1 unit thick with the nodraw texture
:5. Create a new brush 20 units or so square and 1 unit thick with the [[Tool textures|nodraw texture]].
:6. Turn this brush into a [[func_brush]] entity (Ctrl + T) and name it “ball_launcher_shield”
:6. Turn this brush into a <code>func_brush</code> entity (<code>Ctrl+T</code>) and name it "ball_launcher_shield".
:7. Place the “ball_launcher_shield” so that it is touching the black circular shield of the “ball_launcher model”
:7. Place the "ball_launcher_shield" so that it is touching the black circular shield of the "ball_launcher model".
:8. Open up the [[point_energy_ball_launcher]] properties (Ctrl + T) and set these outputs:
:8. Open up the <code>point_energy_ball_launcher</code> properties and set these outputs:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
Line 28: Line 31:
| [[Image:Io11.png]] || OnPostSpawnBall || ball_launcher_shield || Enable || <none> || 2.00 || No
| [[Image:Io11.png]] || OnPostSpawnBall || ball_launcher_shield || Enable || <none> || 2.00 || No
|}
|}
:9. Adjust the keyvalues of [[point_energy_ball_launcher]] to set the desired direction, speed, type, and life of the ball.
:9. Adjust the [[Keyvalue|keyvalues]] of <code>point_energy_ball_launcher</code> to set the desired direction, speed, type, and life of the ball.
The Aperture Science High Energy Pellet Launcher is now complete.
The Aperture Science High Energy Pellet Launcher is now complete.
{{note| If desired you can also place the [[point_energy_ball_launcher]] outside of the “ball_launcher” model and remove the “ball_launcher_shield” outputs.}}
 
=The Aperture Science High Energy Pellet Target =
{{note| If necessary, you can also place the <code>point_energy_ball_launcher</code> outside of the "<code>ball_launcher</code>" model and remove the "<code>ball_launcher_shield</code>" outputs.}}
[[Image:launcher-catcher02.JPG|right|thumb|Target Assembly]]
 
== The Aperture Science High Energy Pellet Target ==
[[Image:launcher-catcher02.JPG|right|thumb|Target assembly]]
 
The target is comprised of eleven entities:
The target is comprised of eleven entities:
*'''an [[ambient_generic]]'''
* [[ambient_generic]]
*'''an [[env_sprite]]'''
* [[env_sprite]]
*'''a [[filter_combineball_type]]'''
* [[filter_combineball_type]]
*'''a [[func_tracktrain]]'''
* [[func_tracktrain]]
*'''a [[logic_relay]]'''
* [[logic_relay]]
*'''two [[path_track]]s'''
* [[path_track]] (2)
*'''a [[point_spotlight]]'''
* [[point_spotlight]]
*'''two [[prop_dynamic]]s'''
* [[prop_dynamic]] (2)
*'''a [[trigger_multiple]]'''
* [[trigger_multiple]]
 
The models used are:
The models used are:
*'''/models/props/combine_ball_catcher.mdl'''
* <code>/models/props/combine_ball_catcher.mdl</code>
*'''/models/Effects/combineball.mdl'''
* <code>/models/Effects/combineball.mdl</code>
 
To create the catcher:
To create the catcher:
:1. Create a [[prop_dynamic]] entity (Shift + E) with a World Model of '''models/props/combine_ball_catcher.mdl''' and a name of “ball_trap”
:1. Create a <code>prop_dynamic</code> entity with a World Model key pointing to "<code>models/props/combine_ball_catcher.mdl</code>" and the Name set to "ball_trap".
:2. Place the entity where you want it in your map {{note| The model requires a hole of at least 32 units square and 8 units deep. Otherwise, when the model animates to its closed state, part of the model will be hidden in a wall.}}
:2. Place the entity where you want it in your map.
:3. Create a [[filter_combineball_type]] entity (Shift + E) and name it filter_ball.
{{note|The model requires a hole of at least 32 units square and 8 units deep. Otherwise, when the model animates to its closed state, part of the model will be hidden in a wall.}}
:4. Set the balltype for “filter_ball” to '''"Launched by [[point_combine_ball_launcher]]"'''
:3. Create a <code>filter_combineball_type</code> entity and name it filter_ball.
:5. Create a brush with the trigger texture to cover the opening of the “ball_trap” model.
:4. Set the ball type for "filter_ball" to "Launched by <code>point_combine_ball_launcher</code>".
:6. Turn this brush into a [[trigger_multiple]] entity (Ctrl + T) and name it “trigger_ball_trap”, also set the filter_name to “filter_ball”
:5. Create a brush with the trigger texture to cover the opening of the "ball_trap" model.
:7.   Create a [[prop_dynamic]] entity (Shift + E) with a World Model of '''/models/Effects/combineball.mdl''', set its parent to “ball_trap” and name it “ball_trap_ball”
:6. Turn this brush into a <code>trigger_multiple</code> entity and name it "trigger_ball_trap", also set the filter_name to "filter_ball".
:8. Create a [[env_sprite]] entity (Shift + E), set its Sprite Name to '''/sprites/physring1.vmt''', set its parent to “ball_trap” and name it “ball_trap_sprite”
:7. Create a <code>prop_dynamic</code> entity with a World Model of "<code>models/Effects/combineball.mdl</code>", set its parent to "ball_trap" and name it "ball_trap_ball".
:9. Place both “ball_trap_ball” and “ball_trap_sprite” somewhere near the front of the “ball_trap” model
:8. Create a <code>env_sprite</code> entity, set its Sprite Name to "<code>sprites/physring1.vmt</code>", set its parent to "ball_trap" and name it "ball_trap_sprite".
:10. Create a [[logic_relay]] entity (Shift + E) and name it “relay_ball_trap_spawn”
:9. Place both "ball_trap_ball" and "ball_trap_sprite" somewhere near the front of the "ball_trap" model.
:11. Open up the [[logic_relay]] properties and set these outputs:
:10. Create a <code>logic_relay</code> entity and name it "relay_ball_trap_spawn".
:11. Open up the <code>logic_relay</code> properties and set these outputs:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
Line 65: Line 74:
| [[Image:Io11.png]] || OnSpawn || ball_trap_sprite || SetParentAttachment || ball_attachment || 0.00 || No
| [[Image:Io11.png]] || OnSpawn || ball_trap_sprite || SetParentAttachment || ball_attachment || 0.00 || No
|}
|}
:12. Create a [[path_track]] entity (Shift + E) and name it “path_ball_trap_01”, set Next Stop Target to "path_ball_trap_02"
:12. Create a <code>path_track</code> entity and name it "path_ball_trap_01", set Next Stop Target to "path_ball_trap_02".
:13. Place “path_ball_trap_01” in front of and slightly above the “ball_trap” model.
:13. Place "path_ball_trap_01" in front of and slightly above the "ball_trap" model.
:14. Create a [[path_track]] entity (Shift + E) and name it “path_ball_trap_02, set Next Stop Target to "path_ball_trap_01”
:14. Create a <code>path_track</code> entity and name it "path_ball_trap_02, set Next Stop Target to "path_ball_trap_01".
:15. Place “path_ball_trap_02” behind and slightly above the “ball_trap” model.
:15. Place "path_ball_trap_02" behind and slightly above the "ball_trap" model.
:16. Create a brush with the nodraw texture
:16. Create a brush with the nodraw texture.
:17. Turn this brush into a [[func_tracktrain]] entity and name it “ball_trap_door”
:17. Turn this brush into a <code>func_tracktrain</code> entity and name it "ball_trap_door".
:18. Place brush slightly above the two [[path_track]]s and behind “path_ball_trap_01”
:18. Place brush slightly above the two <code>path_track</code> entities and behind the "path_ball_trap_01".
:19.   Open up the property window (Ctrl + T) for “ball_trap_door” and set these keyvalues:
:19. Open up the property window for "ball_trap_door" and set these keyvalues:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 79: Line 88:
|-
|-
| Move Sound || d3_citadel.podarm_move
| Move Sound || d3_citadel.podarm_move
|-
|-
| Start Sound || d3_citadel.podarm_move_start
| Start Sound || d3_citadel.podarm_move_start
Line 85: Line 93:
| Stop Sound || d3_citadel.podarm_move_stop
| Stop Sound || d3_citadel.podarm_move_stop
|}
|}
:20. Open up the property window (Ctrl + T) for “path_ball_trap_02” and set this output:
:20. Open up the property window for "path_ball_trap_02" and set this output:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
Line 91: Line 99:
| [[Image:Io11.png]] || OnPass || ball_trap_door || SetSpeed || 0 || 0.00 || No
| [[Image:Io11.png]] || OnPass || ball_trap_door || SetSpeed || 0 || 0.00 || No
|}
|}
:21. Create a [[point_spotlight]] entity (Shift + E) and name it “ball_trap_spotlight” You may also want to disable the dynamic light flag.
:21. Create a <code>point_spotlight</code> entity (Shift + E) and name it "ball_trap_spotlight" You may also want to disable the dynamic light flag.
:22. Set the color for “ball_trap_spotlight” to '''”255 0 0”''', the beam length is normally the length of the room, and the width somewhere between 20 and 40.
:22. Set the color for "ball_trap_spotlight" to "255 0 0", the beam length is normally the length of the room, and the width somewhere between 20 and 40.
:23. Create an [[ambient_generic]] entity (Shift + E) and name it “ball_trap_sound”
:23. Create an <code>ambient_generic</code> entity and name it "ball_trap_sound"
:24. Set Sound Name for "ball_trap_sound" to '''“AlyxEMP.Charge”'''
:24. Set the Sound Name key for "ball_trap_sound" to "AlyxEMP.Charge"
:25 Open the propery window (Ctrl + T) for “trigger_ball_trap” and set these outputs:
:25. Open the property window for "trigger_ball_trap" and set these outputs:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
Line 117: Line 125:
| [[Image:Io11.png]] || OnStartTouch || ball_trap_sound || PlaySound || <none> || 0.00 || No
| [[Image:Io11.png]] || OnStartTouch || ball_trap_sound || PlaySound || <none> || 0.00 || No
|}
|}
::Then under Flags uncheck clients and check everything.
::Then under the Flags tab un-check "clients" and check everything else.
{{note|The “ball_trap_door” sounds are drowned out by the “ball_trap_sound”, you may want to adjust the delay for the PlaySound}}
 
The Aperture Science High Energy Pellet Target is now complete.
The Aperture Science High Energy Pellet Target is now complete.


=Theory=
{{note|The "ball_trap_door" sounds are drowned out by the "ball_trap_sound", you may want to adjust the delay for the <code>PlaySound</code>}}
[[Image:launcher-catcher03.jpg|right|thumb|Working Energy Pellet Launcher and Target]]
These instructions illustrate the most basic use of the launcher and catchers.  Theoretically you should be able to have one launcher and multiple catchers, or even catchers that reset themselves.


== The theory ==
[[Image:launcher-catcher03.jpg|right|thumb|Energy Pellet Launcher and Target at work]]


Return to [[Portal Level Creation]]
These instructions illustrate the most basic use of the launcher and catchers. Theoretically you should be able to have one launcher and multiple catchers, or even catchers that reset themselves.{{clr}}
 
== See also ==
* [[Portal Level Creation]]
 
[[Category:Level Design Tutorials]]

Revision as of 15:55, 1 December 2007

Introduction

The purpose of this tutorial is to illustrate how to create a single ball launcher and have a single ball catcher as its target. Both, the launcher and the catcher instructions will detail how the basic animations as well as the visual and sound effects work.

The Aperture Science High Energy Pellet Launcher

Launcher assembly

The launcher is comprised of three entities:

The model used is:

  • models/props/combine_ball_launcher.mdl

To create the launcher:

1. Create a prop_dynamic entity (Shift+E) with a World Model set to "models/props/combine_ball_launcher.mdl" and the Name key of "ball_launcher".
2. Place the new entity where you want it in your map.
3. Create a point_energy_ball_launcher entity and set its name to "ball".
4. Place the new entity inside the dome of the "ball_launcher" model.
5. Create a new brush 20 units or so square and 1 unit thick with the nodraw texture.
6. Turn this brush into a func_brush entity (Ctrl+T) and name it "ball_launcher_shield".
7. Place the "ball_launcher_shield" so that it is touching the black circular shield of the "ball_launcher model".
8. Open up the point_energy_ball_launcher properties and set these outputs:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPostSpawnBall ball_launcher SetAnimation close 0.00 No
Io11.png OnPostSpawnBall ball_launcher_shield Disable <none> 0.00 No
Io11.png OnPostSpawnBall ball_launcher_shield Enable <none> 2.00 No
9. Adjust the keyvalues of point_energy_ball_launcher to set the desired direction, speed, type, and life of the ball.

The Aperture Science High Energy Pellet Launcher is now complete.

Note.pngNote: If necessary, you can also place the point_energy_ball_launcher outside of the "ball_launcher" model and remove the "ball_launcher_shield" outputs.

The Aperture Science High Energy Pellet Target

Target assembly

The target is comprised of eleven entities:

The models used are:

  • /models/props/combine_ball_catcher.mdl
  • /models/Effects/combineball.mdl

To create the catcher:

1. Create a prop_dynamic entity with a World Model key pointing to "models/props/combine_ball_catcher.mdl" and the Name set to "ball_trap".
2. Place the entity where you want it in your map.
Note.pngNote:The model requires a hole of at least 32 units square and 8 units deep. Otherwise, when the model animates to its closed state, part of the model will be hidden in a wall.
3. Create a filter_combineball_type entity and name it filter_ball.
4. Set the ball type for "filter_ball" to "Launched by point_combine_ball_launcher".
5. Create a brush with the trigger texture to cover the opening of the "ball_trap" model.
6. Turn this brush into a trigger_multiple entity and name it "trigger_ball_trap", also set the filter_name to "filter_ball".
7. Create a prop_dynamic entity with a World Model of "models/Effects/combineball.mdl", set its parent to "ball_trap" and name it "ball_trap_ball".
8. Create a env_sprite entity, set its Sprite Name to "sprites/physring1.vmt", set its parent to "ball_trap" and name it "ball_trap_sprite".
9. Place both "ball_trap_ball" and "ball_trap_sprite" somewhere near the front of the "ball_trap" model.
10. Create a logic_relay entity and name it "relay_ball_trap_spawn".
11. Open up the logic_relay properties and set these outputs:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnSpawn ball_trap_ball SetParentAttachment ball_attachment 0.00 No
Io11.png OnSpawn ball_trap_sprite SetParentAttachment ball_attachment 0.00 No
12. Create a path_track entity and name it "path_ball_trap_01", set Next Stop Target to "path_ball_trap_02".
13. Place "path_ball_trap_01" in front of and slightly above the "ball_trap" model.
14. Create a path_track entity and name it "path_ball_trap_02, set Next Stop Target to "path_ball_trap_01".
15. Place "path_ball_trap_02" behind and slightly above the "ball_trap" model.
16. Create a brush with the nodraw texture.
17. Turn this brush into a func_tracktrain entity and name it "ball_trap_door".
18. Place brush slightly above the two path_track entities and behind the "path_ball_trap_01".
19. Open up the property window for "ball_trap_door" and set these keyvalues:
Property Name Value
First Stop Target path_ball_trap_01
Move Sound d3_citadel.podarm_move
Start Sound d3_citadel.podarm_move_start
Stop Sound d3_citadel.podarm_move_stop
20. Open up the property window for "path_ball_trap_02" and set this output:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPass ball_trap_door SetSpeed 0 0.00 No
21. Create a point_spotlight entity (Shift + E) and name it "ball_trap_spotlight" You may also want to disable the dynamic light flag.
22. Set the color for "ball_trap_spotlight" to "255 0 0", the beam length is normally the length of the room, and the width somewhere between 20 and 40.
23. Create an ambient_generic entity and name it "ball_trap_sound"
24. Set the Sound Name key for "ball_trap_sound" to "AlyxEMP.Charge"
25. Open the property window for "trigger_ball_trap" and set these outputs:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch trigger_ball_trap Disable <none> 0.00 No
Io11.png OnStartTouch ball Disable <none> 0.00 No
Io11.png OnStartTouch !activator Kill <none> 0.00 No
Io11.png OnStartTouch ball_trap_ball Enable <none> 0.00 No
Io11.png OnStartTouch ball_trap_sprite Enable <none> 0.00 No
Io11.png OnStartTouch ball_trap SetAnimation close 0.00 No
Io11.png OnStartTouch ball_trap_spotlight LightOff <none> 0.00 No
Io11.png OnStartTouch ball_trap_door SetSpeed .5 0.00 No
Io11.png OnStartTouch ball_trap_sound PlaySound <none> 0.00 No
Then under the Flags tab un-check "clients" and check everything else.

The Aperture Science High Energy Pellet Target is now complete.

Note.pngNote:The "ball_trap_door" sounds are drowned out by the "ball_trap_sound", you may want to adjust the delay for the PlaySound

The theory

Energy Pellet Launcher and Target at work

These instructions illustrate the most basic use of the launcher and catchers. Theoretically you should be able to have one launcher and multiple catchers, or even catchers that reset themselves.

See also