Creating a rotating portalgun: Difference between revisions
KubeKing4556 (talk | contribs) m (→Defining entity outputs: Clarified the use of a logic_timer entity.) |
|||
Line 62: | Line 62: | ||
== Defining entity outputs == | == Defining entity outputs == | ||
Now go to its outputs tab and write: | Place a [[logic_timerhttps://developer.valvesoftware.com/wiki/Logic_timer|logic_timer]] entity. Now go to its outputs tab and write: | ||
::{| 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 |
Revision as of 17:42, 27 May 2015
Introduction
In this tutorial we will be creating a rotating stand with a mounted portalgun that automatically shoots portals.
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 56, 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_door_rotating
entity with the following properties:
Property Name Value Name stand_func_rotating Delay Before Reset -1 Spawn Position Closed Speed 30 Distance 90
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 Delay Before Reset -1 Lip 1
Under the Flags tab, check Passable
.
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 arrow display, like the one shown in the first picture on the top of this page.
Defining entity outputs
Place a logic_timer entity. Now go to its outputs tab and write:
Now go to the func_door_rotatings outputs tab and write:
Create a new output for stand_func_door:
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.
Or, you can make a brush-based portal frame with the following parameters:
- Size of each brush: 8 x 4, height is 128
- Gap between two brushes: 64
- Front texture:
signage/fixed_portal_border
- Side texture:
signage/signage_border