Creating a rotating portalgun: Difference between revisions
Darthkillyou (talk | contribs) (→Logic) |
m (further tidy) |
||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
[[Image:Picture_03.jpg|right|Width:64]] | [[Image:Picture_03.jpg|right|Width:64]] | ||
In this tutorial we will be creating a rotating stand with a mounted portalgun that automatically shoots portals. | |||
An example map is available for download [http://myfreefilehosting.com/f/c28a01c6bb_0.1MB here]. | An example map is available for download [http://myfreefilehosting.com/f/c28a01c6bb_0.1MB here]. | ||
==Prepare models == | == Prepare models == | ||
You will need:< | You will need two {{ent|prop_dynamic}} entities, one for each of the following world models: | ||
* <code>models/props/pedestal_base_reference.mdl</code>. Name it <code>stand_bottom_model</code> and set its "disableshadows" keyvalue to 1. | |||
* <code>models/props/pedestal_center_reference.mdl</code>. Name it <code>stand_top_model</code>. | |||
* | == Prepare brushes == | ||
* | Create two brushes with the following dimensions: | ||
* 32 x 32, height 4, using the <code>tools/nodraw</code> texture. | |||
* 4 x 32, height 55, also using the <code>tools/nodraw</code> texture. | |||
== | == Moving == | ||
[[Image:Picture_01.jpg|right|thumb|Brush and model placement.]] | |||
Move <code>stand_bottom_model</code> where you want to have the stand. The small doors on the bottom of the model need to be just underground. Now move <code>stand_top_model</code> above <code>stand_bottom_model</code> as shown in the picture on the right. | |||
Center the first brush (the one that measured 32x32) with <code>stand_top_model</code>. Set its Z axis (height) to about half of <code>stand_top_model</code>. | |||
Now move the second brush to the side of the stand, as it is shown in the picture on the right. | |||
{{clr}} | |||
== Brush Entities == | |||
Select the 32x32 brush and tie it to a <code>func_rotating</code> entity with the following properties: | |||
::{| | ::{| | ||
! Property Name || Value | ! Property Name || Value | ||
Line 37: | Line 34: | ||
| | | | ||
|} | |} | ||
Under the Flags tab, uncheck <code>Start ON | Under the Flags tab, uncheck <code>Start ON</code>. | ||
Tie the second brush to a <code>func_door</code> set to these properties: | Tie the second brush to a <code>func_door</code> set to these properties: | ||
::{| | ::{| | ||
! Property Name || Value | ! Property Name || Value | ||
Line 51: | Line 48: | ||
|} | |} | ||
==PortalGun== | == PortalGun == | ||
Create a new entity, a <code>weapon_portalgun</code> and name it <code>weapon_portalgun</code>. | Create a new entity, a <code>weapon_portalgun</code> and name it <code>weapon_portalgun</code>. | ||
Move it exactly on top of <code>stand_top_model</code>. The portalgun should face left when you’re looking at <code>stand_top_model</code> in the direction of the blue display. | Move it exactly on top of <code>stand_top_model</code>. The portalgun should face left when you’re looking at <code>stand_top_model</code> in the direction of the blue display, like the one shown in the first picture on the [[{{PAGENAME}}#top|top]] of this page. | ||
== | == Defining entity outputs == | ||
Make a <code>logic_timer</code> entity named timer_stand and set its refire interval to 5 sec. Make sure that it starts enabled. | Make a <code>logic_timer</code> entity named timer_stand and set its refire interval to 5 sec. Make sure that it starts enabled. | ||
Line 97: | Line 94: | ||
|} | |} | ||
==Parents and the | == Parents and the hole == | ||
[[Image:Picture_02.jpg|right|thumb|All | [[Image:Picture_02.jpg|right|thumb|All done. Notice the hole created on the floor.]] | ||
Now, just set the parent of <code>weapon_portalgun</code> and <code>stand_top_model</code> to <code>stand_func_rotating</code>. | Now, just set the parent of <code>weapon_portalgun</code> and <code>stand_top_model</code> to <code>stand_func_rotating</code>. | ||
When you're done, make a cylindrical hole beneath <code>stand_bottom_model</code>. | When you're done, make a cylindrical hole on the floor beneath <code>stand_bottom_model</code>, like the one shown in the image to the right. | ||
==End== | == End == | ||
Additionally, you may want to create a portal frame on each wall the portals are going to be fired at. | |||
To do this, create a {{ent|prop_static}} entity with the model <code>models/props/autoportal_frame/autoportal_frame.mdl</code>, move it to the wall you wish to place it at, and rotate it until it is parallel to the wall. |
Revision as of 17:50, 16 January 2008
Introduction
In this tutorial we will be creating a rotating stand with a mounted portalgun that automatically shoots portals.
An example map is available for download here.
Prepare models
You will need two prop_dynamic entities, one for each of the following world models:
models/props/pedestal_base_reference.mdl
. Name itstand_bottom_model
and set its "disableshadows" keyvalue to 1.models/props/pedestal_center_reference.mdl
. Name itstand_top_model
.
Prepare brushes
Create two brushes with the following dimensions:
- 32 x 32, height 4, using the
tools/nodraw
texture. - 4 x 32, height 55, also using the
tools/nodraw
texture.
Moving
Move stand_bottom_model
where you want to have the stand. The small doors on the bottom of the model need to be just underground. Now move stand_top_model
above stand_bottom_model
as shown in the picture on the right.
Center the first brush (the one that measured 32x32) with stand_top_model
. Set its Z axis (height) to about half of stand_top_model
.
Now move the second brush to the side of the stand, as it is shown in the picture on the right.
Brush Entities
Select the 32x32 brush and tie it to a func_rotating
entity with the following properties:
Property Name Value Name stand_func_rotating Max Rotation Speed 30
Under the Flags tab, uncheck Start ON
.
Tie the second brush to a func_door
set to these properties:
Property Name Value Name stand_func_door Speed 25 Move direction: 90 0 0
PortalGun
Create a new entity, a weapon_portalgun
and name it weapon_portalgun
.
Move it exactly on top of stand_top_model
. The portalgun should face left when you’re looking at stand_top_model
in the direction of the blue display, like the one shown in the first picture on the top of this page.
Defining entity outputs
Make a logic_timer
entity named timer_stand and set its refire interval to 5 sec. Make sure that it starts enabled.
Now go to its outputs tab and write:
Create a new output:
Now, we will make outputs of stand_bottom_model
:
And few outputs for weapon_portalgun
:
Parents and the hole
Now, just set the parent of weapon_portalgun
and stand_top_model
to stand_func_rotating
.
When you're done, make a cylindrical hole on the floor beneath stand_bottom_model
, like the one shown in the image to the right.
End
Additionally, you may want to create a portal frame on each wall the portals are going to be fired at.
To do this, create a prop_static entity with the model models/props/autoportal_frame/autoportal_frame.mdl
, move it to the wall you wish to place it at, and rotate it until it is parallel to the wall.