Creating a rotating portalgun: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Brush Entities: recreating the tutorial with a better method, because the func_rotating doesn't work properly)
Line 62: Line 62:
== Defining entity outputs ==
== 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.
Now go to its outputs tab and write:
Now go to its outputs tab and write:
::{| class=standard-table
::{| class=standard-table
Line 74: Line 73:
|}
|}


Now go to the func_door_rotatings outputs tab and write:
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnFullyClosed || stand_top_model || SetParent || stand_func_door || 0.00 || No
|-
| [[Image:Io11.png]] || OnFullyClosed || weapon_portalgun || SetParent || stand_func_door || 0.00 || No
|-
| [[Image:Io11.png]] || OnFullyClosed || weapon_portalgun || FirePortal1 || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnFullyClosed || stand_func_rotating || Open || <none> || 0.01 || No
|-
| [[Image:Io11.png]] || OnFullyOpen || stand_top_model || SetParent || stand_func_rotating || 0.00 || No
|-
| [[Image:Io11.png]] || OnFullyOpen || weapon_portalgun || SetParent || stand_func_rotating || 0.00 || No
|-
| [[Image:Io11.png]] || OnFullyOpen || stand_func_rotating || Close || <none> || 0.01 || No
|}


Create a new output for stand_func_door:  
Create a new output for stand_func_door:  

Revision as of 03:58, 3 June 2013

Introduction

Width:64

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 it stand_bottom_model and set its "disableshadows" keyvalue to 1.
  • models/props/pedestal_center_reference.mdl. Name it stand_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

Brush and model placement.

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

Now go to its outputs tab and write:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTimer stand_func_rotating Start <none> 0.00 No
Io11.png OnTimer stand_func_rotating Stop <none> 3.00 No
Io11.png OnTimer weapon_portalgun FirePortal1 <none> 3.00 No

Now go to the func_door_rotatings outputs tab and write:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnFullyClosed stand_top_model SetParent stand_func_door 0.00 No
Io11.png OnFullyClosed weapon_portalgun SetParent stand_func_door 0.00 No
Io11.png OnFullyClosed weapon_portalgun FirePortal1 <none> 0.00 No
Io11.png OnFullyClosed stand_func_rotating Open <none> 0.01 No
Io11.png OnFullyOpen stand_top_model SetParent stand_func_rotating 0.00 No
Io11.png OnFullyOpen weapon_portalgun SetParent stand_func_rotating 0.00 No
Io11.png OnFullyOpen stand_func_rotating Close <none> 0.01 No

Create a new output for stand_func_door:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnFullyOpen stand_bottom_model SetAnimation close 0.00 No


Now, we will make outputs of stand_bottom_model:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnAnimationDone stand_bottom_model SetAnimation inactive 0.00 No


And few outputs for weapon_portalgun:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPlayerPickup timer_stand Kill 0.00 No
Io11.png OnPlayerPickup stand_top_model SetParent stand_func_door 0.00 No
Io11.png OnPlayerPickup stand_func_door Open 0.80 No

Parents and the hole

All done. Notice the hole created on the floor.

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

See also