Creating a moving platform: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (minoro cleanup)
m (some more)
Line 3: Line 3:
In this tutorial you will learn how to create a moving platform.
In this tutorial you will learn how to create a moving platform.


== Creating and setting basic model ==
== Setting up the model ==
You will need one from these models
You will need one from these models
* This one is bigger: <code> models/props/light_rail_platform.mdl </code>.
* This one is bigger: <code> models/props/light_rail_platform.mdl </code>.
Line 10: Line 10:
* Set its parent to <code>platform_func</code>, which we'll create next.
* Set its parent to <code>platform_func</code>, which we'll create next.


== Creating function ==
== Creating functions ==
[[Image:moving_platform_system.jpg|right|320px]]  
[[Image:moving_platform_system.jpg|right|320px]]  
Create brush with dimensions of chosen platform. It’s not necessary, but it will surely work.
Create brush with dimensions of chosen platform. It’s not necessary, but it will surely work. Tie it to <code>func_door</code> entity by pressing <code>Ctrl-T</code>, and set its variables as follows:
Tie it to <code>func_door</code> entity by pressing <code>Ctrl-T</code>. Set its variables as follows:


::{|
::{|
Line 44: Line 43:
|}
|}


== Track ==
== Path tracking ==
Our platform is using <code>path_track</code> to move, so we have to create some. You can see the architecture we we will use.
Our platform is using the <code>path_track</code> entities to specify its movement course, so we have to add these now. You can see the architecture we we will use.


Create <code>path_track</code> entity with these settings:
Create a set of [[path_track]]s, configuring them as follows:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 60: Line 59:
|}
|}


Now create another one:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 73: Line 71:
|}
|}


P1_S2_I:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 86: Line 83:
|}
|}


P1_S2_M:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 99: Line 95:
|}
|}


P1_S2_O:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 112: Line 107:
|}
|}


Move them as you need and check, if they are linked by an yellow line.
Place them as necessary but make sure they are linked, as shown by a yellow line in Hammer's viewports.


== Make it nice ==
== Final touches ==
Now you have working platform, but we will add few models. That oval-like object is mostly on wall, so it's easy to add it to your map. Second model looks better, you may even add that stand under it.
Now you have a working platform, so we can add a few models to support it. That oval-shaped object is used on walls, so it's easy to add to your map. The second model looks better, you may even add that stand under it.


<gallery>
<gallery>

Revision as of 02:35, 4 February 2008

Introduction

Width:64

In this tutorial you will learn how to create a moving platform.

Setting up the model

You will need one from these models

  • This one is bigger: models/props/light_rail_platform.mdl .
  • This one is smaller models/props/light_rail_platform_02.mdl .
  • After you have decided witch one is better for you, name it platform_model.
  • Set its parent to platform_func, which we'll create next.

Creating functions

Moving platform system.jpg

Create brush with dimensions of chosen platform. It’s not necessary, but it will surely work. Tie it to func_door entity by pressing Ctrl-T, and set its variables as follows:

Property Name Value
Change angles this is up to you, I’m using: never (fixed orientation)
Change velocity too, it’s your choice, but: ease in/ease out
First stop target P1_S1_M
Initial speed 100
Max speed 10 000
Name platform_func

And, you may set sounds:

Property Name Value
Start sound Doors.Move12
Stop sound Doors.FullClose12

Path tracking

Our platform is using the path_track entities to specify its movement course, so we have to add these now. You can see the architecture we we will use.

Create a set of path_tracks, configuring them as follows:

Property Name Value
Name P1_S1_M
New train speed 30
Next stop target P1_S1_O
Property Name Value
Name P1_S1_O
New train speed 200
Next stop target P1_S2_I
Property Name Value
Name P1_S2_I
New train speed 30
Next stop target P1_S2_M
Property Name Value
Name P1_S2_M
New train speed 30
Next stop target P1_S2_O
Property Name Value
Name P1_S2_O
New train speed 200
Next stop target P1_S1_I

Place them as necessary but make sure they are linked, as shown by a yellow line in Hammer's viewports.

Final touches

Now you have a working platform, so we can add a few models to support it. That oval-shaped object is used on walls, so it's easy to add to your map. The second model looks better, you may even add that stand under it.

See also