Creating a rotating portalgun

From Valve Developer Community
Revision as of 16:14, 16 January 2008 by Darthkillyou (talk | contribs) (removed linebreak)
Jump to navigation Jump to search

Introduction

Width:64

So, we are going to create rotating stand with portalgun shooting portals.

An example map is available for download here.

Prepare models

You will need:

  • prop_dynamic, world model: models/props/pedestal_base_reference.mdl, name: stand_bottom_model Set the "disableshadows" keyvalue to 1.

  • prop_dynamic, world model: models/props/pedestal_center_reference.mdl, name: stand_top_model

Prepare brushes

Create:

  • 32 x 32 block, height 4, using the tools/nodraw texture.
  • 4 x 32 block, height 55, also using the nodraw texture.

Moving

Illustration 1

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 in the illustration. Center the first brush that measured 32x32 with stand_top_model. Set its Z axis (height) to about half of stand_top_model. Now move the second brush as it is in the picture.

Brush Entities

Select the 32x32 brush and tie it to a func_rotating entity.

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.

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.

Logic

Make entity logic_timer named timer_stand and set interval to 5 sec. Make sure that initial state is on. Now go to outputs 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

Create a new output:

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 moved, just for illustration of hole.

Now, just set parent of weapon_portalgun and stand_top_model to stand_func_rotating. When your done, make hole under stand_bottom_models overground part.

End

You may create prop_static with model of models/props/autoportal_frame/autoportal_frame.mdl for framing autofired portals, just move them to wall and rotate.