Creating a rotating portalgun: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Quite a bit of cleanup)
Line 2: Line 2:
[[Image:Picture_03.jpg|right|Width:64]]
[[Image:Picture_03.jpg|right|Width:64]]
So, we are going to create rotating stand with portalgun shooting portals.
So, we are going to create rotating stand with portalgun shooting portals.
{{warning|You will probably see shadow of stand cover underground. Does anybody know how to fix it?}}


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:<br><br>


prop_dynamic, world model: <code>models/props/pedestal_base_reference.mdl</code>, name: <code>stand_bottom_model</code><br>
*prop_dynamic, world model: <code>models/props/pedestal_base_reference.mdl</code>, name: <code>stand_bottom_model</code> Set the "disableshadows" keyvalue to 1.<br><br>
prop_dynamic, world model: <code>models/props/pedestal_center_reference.mdl</code>, name: <code>stand_top_model</code>
*prop_dynamic, world model: <code>models/props/pedestal_center_reference.mdl</code>, name: <code>stand_top_model</code>
 
Just create and name them, we will move them after next step


==Prepare brushes==
==Prepare brushes==
Create:
Create:


32 to 32 square, height 4, using <code>nodraw</code> texture.
*32 x 32 block, height 4, using the <code>tools/nodraw</code> texture.


4 to 32 sq, height 55 with <code>nodraw</code> texture too.
*4 x 32 block, height 55, also using the <code>nodraw</code> texture.


==Moving==
==Moving==


[[Image:Picture_01.jpg|right|thumb|Illustration 1.]]
[[Image:Picture_01.jpg|right|thumb|Illustration 1]]
Move <code>stand_bottom_model</code> where you want to have the stand, that small doors on it have to be under ground.
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.<br><br>
Then move <code>stand_top_model</code> above <code>stand_bottom_model</code>, as on picture.
Now move <code>stand_top_model</code> above <code>stand_bottom_model</code> as in the illustration.
Center 1st brush, that 32x32, with <code>stand_top_model</code>, Z axis to half of <code>stand_top_model</code> (approximately).
Center the first brush that measured 32x32 with <code>stand_top_model</code>. Set its Z axis (height) to about half of <code>stand_top_model</code>.
And move 2nd brush as on picture.
Now move the second brush as it is in the picture.


==Brush Entities==
Select the 32x32 brush and tie it to a <code>func_rotating</code> entity. <br>
::{|
!  Property Name || Value
|-
| Name || stand_func_rotating
|-
| Max Rotation Speed || 30
|-
|
|}
Under the Flags tab, uncheck <code>Start ON.</code>
<br><br>
Tie the second brush to a <code>func_door</code>.
<br>
::{|
!  Property Name || Value
|-
| Name || stand_func_door
|-
| Speed || 25
|-
| Move direction: || 90 0 0
|}
==PortalGun==
==PortalGun==


Create new entity, <code>weapon_portalgun</code> and name it weapon_portalgun.
Create a new entity, a <code>weapon_portalgun</code> and name it <code>weapon_portalgun</code>.
Move it exactly to top of <code>stand_top_model</code>, a front part of portalgun has to be on left when you’re looking on <code>stand_top_model</code> from that part with 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.  


==Logic==
==Logic==
Line 48: Line 69:
|}
|}


Select 32x32 brush and tie it to entity <code>func_rotating</code>.
Create a new output:
<code>Name: stand_func_rotating |
Friction: 0 |
Max Rotation Speed: 30 |
In Flags, uncheck Start ON.</code>
 
Tie 2nd brush to <code>func_door</code>.
<code>Name: stand_func_door |
Speed: 25 |
Move direction: 90 0 0.</code>
Create new output:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once

Revision as of 16:13, 16 January 2008

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.