Creating an energy ball launcher and catcher: Difference between revisions
m (→Introduction) |
(Fixed inaccuracies and removed the func_tracktrain. The tracktrain doesn't even work in Portal and is leftover from Episode One) |
||
| Line 21: | Line 21: | ||
To create the launcher: | To create the launcher: | ||
:1. Create a <code>prop_dynamic</code> entity (<code>Shift+E</code>) with a <code>World Model</code> set to "<code>models/props/combine_ball_launcher.mdl</code>" and the <code>Name</code> key of "ball_launcher". | :1. Create a <code>prop_dynamic</code> entity (<code>Shift+E</code>) with a <code>World Model</code> set to "<code>models/props/combine_ball_launcher.mdl</code>" and the <code>Name</code> key of "ball_launcher". Disable the shadows. | ||
: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 <code>point_energy_ball_launcher</code> entity, set its name to "ball", <code>Ball count</code> to 1, and <code>Ball radius</code> to 12.0. | :3. Create a <code>point_energy_ball_launcher</code> entity, set its name to "ball", <code>Ball count</code> to 1, and <code>Ball radius</code> to 12.0. | ||
| Line 52: | Line 52: | ||
* [[env_sprite]] | * [[env_sprite]] | ||
* [[filter_combineball_type]] | * [[filter_combineball_type]] | ||
* [[logic_relay]] | * [[logic_relay]] | ||
* [[point_spotlight]] | * [[point_spotlight]] | ||
* [[prop_dynamic]] (2) | * [[prop_dynamic]] (2) | ||
| Line 64: | Line 62: | ||
To create the catcher: | To create the catcher: | ||
:1. Create a <code>prop_dynamic</code> entity with a <code>World Model</code> key pointing to "<code>models/props/combine_ball_catcher.mdl</code>" and the <code>Name</code> set to "ball_trap". | :1. Create a <code>prop_dynamic</code> entity with a <code>World Model</code> key pointing to "<code>models/props/combine_ball_catcher.mdl</code>" and the <code>Name</code> set to "ball_trap". Disable the shadows. | ||
:2. Place the entity where you want it in your map. | :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.}} | {{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.}} | ||
| Line 82: | Line 80: | ||
|- | |- | ||
| [[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 <code>point_spotlight</code> entity (<code>Shift+E</code>) and name it "ball_trap_spotlight". You may also want to disable the <code>Dynamic Light</code> flag. | ||
:13. Set the <code>Color</code> for "ball_trap_spotlight" to "255 0 0", the <code>Beam Length</code> is normally the length of the room, and <code>Beam Width</code> somewhere between 20 and 40. | |||
:14. Create an <code>ambient_generic</code> entity and <code>Name</code> it "ball_trap_sound" | |||
:15. Set the <code>Sound Name</code> key for "ball_trap_sound" to "AlyxEMP.Charge". Set it's Source Entity Name to the Main Prop_dynamic. | |||
:16. Open the property window for "trigger_ball_trap" and set these 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 | ||
| Line 144: | Line 103: | ||
|- | |- | ||
| [[Image:Io11.png]] || OnStartTouch || ball_trap_spotlight || LightOff || <none> || 0.00 || No | | [[Image:Io11.png]] || OnStartTouch || ball_trap_spotlight || LightOff || <none> || 0.00 || No | ||
|- | |- | ||
| [[Image:Io11.png]] || OnStartTouch || ball_trap_sound || PlaySound || <none> || 0.00 || No | | [[Image:Io11.png]] || OnStartTouch || ball_trap_sound || PlaySound || <none> || 0.00 || No | ||
| Line 152: | Line 109: | ||
The Aperture Science High Energy Pellet Target is now complete. | The Aperture Science High Energy Pellet Target is now complete. | ||
== The theory == | == The theory == | ||
Revision as of 14:36, 23 July 2021
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
The launcher is comprised of four entities:
The model used is:
models/props/combine_ball_launcher.mdl
To create the launcher:
- 1. Create a
prop_dynamicentity (Shift+E) with aWorld Modelset to "models/props/combine_ball_launcher.mdl" and theNamekey of "ball_launcher". Disable the shadows. - 2. Place the new entity where you want it in your map.
- 3. Create a
point_energy_ball_launcherentity, set its name to "ball",Ball countto 1, andBall radiusto 12.0. - 4. Place the new entity inside the dome of the "ball_launcher" model.
- 5. Create a
1w*20l*20hbrush with the nodraw texture. - 6. Turn this brush into a
func_brushentity (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_launcherproperties and set these outputs:
- 9. Adjust the keyvalues of
point_energy_ball_launcherto set the desiredDirection,Speed(400 is usually what's used),Type, andLifeof the ball. - 10. Create a
8w*80l*80hwith the invisible texture. Tie this brush to thefunc_noportal_volumebrush entity. Place the brush on the wall and make sure the brush's center is lined up with the ball and the shield brush. Look at the image to the right for more context.
The Aperture Science High Energy Pellet Launcher is now complete.
point_energy_ball_launcher outside of the "ball_launcher" model and remove the "ball_launcher_shield" outputs.The Aperture Science High Energy Pellet Target
The target is comprised of eleven entities:
- ambient_generic
- env_sprite
- filter_combineball_type
- logic_relay
- point_spotlight
- prop_dynamic (2)
- trigger_multiple
The models used are:
/models/props/combine_ball_catcher.mdl/models/Effects/combineball.mdl
To create the catcher:
- 1. Create a
prop_dynamicentity with aWorld Modelkey pointing to "models/props/combine_ball_catcher.mdl" and theNameset to "ball_trap". Disable the shadows. - 2. Place the entity where you want it in your map.
- 3. Create a
filter_combineball_typeentity and name it "filter_ball". - 4. Set the ball type for "filter_ball" to "Launched by
point_combine_ball_launcher". - 5. Create a cylinder brush with 8 faces, and size it to same the length and width, as the Dynamic prop. Texture it with the trigger texture to cover the opening of the "ball_trap" model.
- 6. Turn this brush into a
trigger_multipleentity and name it "trigger_ball_trap", also set thefilter_nameto "filter_ball". Make sure to have the flags Physics Objects selected. - 7. Create a
prop_dynamicentity with aWorld Modelof "models/Effects/combineball.mdl", set itsParentto "ball_trap" andNameit "ball_trap_ball". Also make sure to haveStart Disabledset to "Yes". - 8. Create a
env_spriteentity, set itsSprite Nameto "sprites/physring1.vmt", set itsParentto "ball_trap" andNameit "ball_trap_sprite". Make sure to have 'Render mode' set to Additive. Also, the 'Scale should be set to 1.5 'Size of Glow proxy' set to 0, and HDR Color Scale set to 1.0, yet all these values can be changed to your liking. Also be sure to have 'Render Fx' set to Distort. - 9. Place both "ball_trap_ball" and "ball_trap_sprite" somewhere near the front of the "ball_trap" model.
- 10. Create a
logic_relayentity and name it "relay_ball_trap_spawn". - 11. Open up the
logic_relayproperties and set these outputs:
- 12. Create a
point_spotlightentity (Shift+E) and name it "ball_trap_spotlight". You may also want to disable theDynamic Lightflag. - 13. Set the
Colorfor "ball_trap_spotlight" to "255 0 0", theBeam Lengthis normally the length of the room, andBeam Widthsomewhere between 20 and 40. - 14. Create an
ambient_genericentity andNameit "ball_trap_sound" - 15. Set the
Sound Namekey for "ball_trap_sound" to "AlyxEMP.Charge". Set it's Source Entity Name to the Main Prop_dynamic. - 16. Open the property window for "trigger_ball_trap" and set these outputs:
- Then under the Flags tab un-check "clients" and check everything else.
The Aperture Science High Energy Pellet Target is now complete.
The theory
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
External links
- Example map Example map using this tutorial. VMF included.