Creating a rotating portalgun: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:
You will need:
You will need:


prop_dynamic, world model: models/props/pedestal_base_reference.mdl, name: stand_bottom_model
prop_dynamic, world model: <code>models/props/pedestal_base_reference.mdl</code>, name: <code>stand_bottom_model</code>


prop_dynamic, world model: models/props/pedestal_center_reference.mdl, name: stand_top_model
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
Just create and name them, we will move them after next step
Line 15: Line 15:
Create:
Create:


32 to 32 square, height 4, using nodraw texture.
32 to 32 square, height 4, using <code>nodraw</code> texture.


4 to 32 sq, height 55 with nodraw texture too.
4 to 32 sq, height 55 with <code>nodraw</code> texture too.


==Moving==
==Moving==


[[Image:Picture_01.jpg|right|thumb|Illustration 1.]]
[[Image:Picture_01.jpg|right|thumb|Illustration 1.]]
Move stand_bottom_model 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, that small doors on it have to be under ground.
Then move stand_top_model above stand_bottom_model, as on picture //soon// .
Then move <code>stand_top_model</code> above <code>stand_bottom_model</code>, as on picture.
Center 1st brush, that 32x32, with stand_top_model, Z axis to half of stand_top_model (approximately).
Center 1st brush, that 32x32, with <code>stand_top_model</code>, Z axis to half of <code>stand_top_model</code> (approximately).
And move 2nd brush as on picture.
And move 2nd brush as on picture.


==PortalGun==
==PortalGun==


Create new entity, weapon_portalgun and name it weapon_portalgun.
Create new entity, <code>weapon_portalgun</code> and name it weapon_portalgun.
Move it exactly to top of stand_top_model, a front part of portalgun has to be on left when you’re loking on stand_top_model from that part with blue display.  
Move it exactly to top of <code>stand_top_model</code>, a front part of portalgun has to be on left when you’re loking on <code>stand_top_model</code> from that part with blue display.  


==Logic==
==Logic==


Make entity logic_timer named timer_stand and set interval to 5 sec. Make sure that initial state is on.
Make entity <code>logic_timer</code> named timer_stand and set interval to 5 sec. Make sure that initial state is on.
Now go to outputs and write:
Now go to outputs and write:
::{|
::{|
Line 46: Line 46:
|}
|}


Select 32x32 brush and tie it to entity func_rotating.  
Select 32x32 brush and tie it to entity <code>func_rotating</code>.  
Name: stand_func_rotating |
<code>Name: stand_func_rotating |
Friction: 0 |
Friction: 0 |
Max Rotation Speed: 30 |
Max Rotation Speed: 30 |
In Flags, unmark Start ON.
In Flags, unmark Start ON.</code>


Tie 2nd brush to func_door.  
Tie 2nd brush to <code>func_door</code>.  
Name: stand_func_door |
<code>Name: stand_func_door |
Speed: 25 |
Speed: 25 |
Move direction: 90 0 0 //Down.
Move direction: 90 0 0.</code>
Create new output:
Create new output:
::{|
::{|
Line 64: Line 64:




Now, we will make outputs of stand_bottom_model:
Now, we will make outputs of <code>stand_bottom_model</code>:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
Line 72: Line 72:




And few outputs for weapon_portalgun:
And few outputs for <code>weapon_portalgun</code>:
::{|
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
Line 86: Line 86:


[[Image:Picture_02.jpg|right|thumb|All moved, just for illustration of hole.]]
[[Image:Picture_02.jpg|right|thumb|All moved, just for illustration of hole.]]
Now, just set parent of weapon_portalgun and stand_top_model to stand_func_rotating.
Now, just set parent of <code>weapon_portalgun</code> and <code>stand_top_model</code> to <code>stand_func_rotating</code>.
When your done, make hole under stand_bottom_models overground part.
When your done, make hole under <code>stand_bottom_model</code>s overground part.


==End==
==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.
You may create prop_static with model of <code>models/props/autoportal_frame/autoportal_frame.mdl</code> for framing autofired portals, just move them to wall and rotate.

Revision as of 11:07, 5 January 2008

Introduction

Width:64

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

Prepare models

You will need:

prop_dynamic, world model: models/props/pedestal_base_reference.mdl, name: stand_bottom_model

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

Just create and name them, we will move them after next step

Prepare brushes

Create:

32 to 32 square, height 4, using nodraw texture.

4 to 32 sq, height 55 with nodraw texture too.

Moving

Illustration 1.

Move stand_bottom_model where you want to have the stand, that small doors on it have to be under ground. Then move stand_top_model above stand_bottom_model, as on picture. Center 1st brush, that 32x32, with stand_top_model, Z axis to half of stand_top_model (approximately). And move 2nd brush as on picture.

PortalGun

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

Select 32x32 brush and tie it to entity func_rotating. Name: stand_func_rotating | Friction: 0 | Max Rotation Speed: 30 | In Flags, unmark Start ON.

Tie 2nd brush to func_door. Name: stand_func_door | Speed: 25 | Move direction: 90 0 0. Create 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.