Creating a moving platform: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (On line has been there two times.)
m (minoro cleanup)
Line 1: Line 1:
== Introduction ==
== Introduction ==
[[Image:moving_platform_01.jpg|right|Width:64]]
[[Image:moving_platform_01.jpg|right|Width:64]]
In this tutorial we will be creating a moving platform.
In this tutorial you will learn how to create a moving platform.
 
An example map is available for download [http://myfreefilehosting.com/f/0e2f1084f7_0.22MB here].


== Creating and setting basic model ==
== Creating and setting basic 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>.
*This one is smaller <code> models/props/light_rail_platform_02.mdl </code>.
* This one is smaller <code> models/props/light_rail_platform_02.mdl </code>.
*After you make decided witch one is better for you, name it <code>platform_model</code>.
* After you have decided witch one is better for you, name it <code>platform_model</code>.
*Set its parent to <code>platform_func</code>, we will create it now.
* Set its parent to <code>platform_func</code>, which we'll create next.


== Creating a function ==
== Creating function ==
[[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 [ctrl + t]. Set it’s variables as follow:
Tie it to <code>func_door</code> entity by pressing <code>Ctrl-T</code>. Set its variables as follows:
[[Image:moving_platform_system.jpg|right|Height:64|Width:64]]
<!--


Somebody pls make that img smaller
-->
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 26: Line 20:
| Change angles || this is up to you, I’m using: <code>never (fixed orientation)</code>
| Change angles || this is up to you, I’m using: <code>never (fixed orientation)</code>
|-
|-
| Change velocity || too, it’s your choise, but: <code>ease in/ease out</code>
| Change velocity || too, it’s your choice, but: <code>ease in/ease out</code>
|-
|-
| First stop target || <code>P1_S1_M</code>
| First stop target || <code>P1_S1_M</code>
Line 40: Line 34:


And, you may set sounds:  
And, you may set sounds:  
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 52: Line 45:


== Track ==
== Track ==
Our platform is using path_track to move, so we have to create some. You can see architecture we we will use.
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.
Create path_track entity with this setting:
 
Create <code>path_track</code> entity with these settings:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 65: Line 59:
|  
|  
|}
|}
Now create another one:
Now create another one:
::{|
::{|
Line 77: Line 72:
|  
|  
|}
|}
P1_S2_I:
P1_S2_I:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 92: Line 87:


P1_S2_M:
P1_S2_M:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 106: Line 100:


P1_S2_O:
P1_S2_O:
::{|
::{|
!  Property Name || Value
!  Property Name || Value
Line 122: Line 115:


== Make it nice ==
== Make it nice ==
[[Image:moving_platform_mdl_01.jpg|right|Height:64|Width:64]]
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.
[[Image:moving_platform_mdl_02.jpg|right|Height:64|Width:64]]
 
[[Image:moving_platform_mdl_03.jpg|right|Height:64|Width:64]]
<gallery>
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. Just align top of P1_Sx_M to top of that model.
Image:moving_platform_mdl_01.jpg
Image:moving_platform_mdl_02.jpg
Image:moving_platform_mdl_03.jpg
</gallery>
 
== See also ==
* [http://myfreefilehosting.com/f/c28a01c6bb_0.1MB Moving platform] - an example map for the above tutorial.

Revision as of 02:22, 4 February 2008

Introduction

Width:64

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

Creating and setting basic 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 function

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. 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

Track

Our platform is using path_track to move, so we have to create some. You can see the architecture we we will use.

Create path_track entity with these settings:

Property Name Value
Name P1_S1_M
New train speed 30
Next stop target P1_S1_O

Now create another one:

Property Name Value
Name P1_S1_O
New train speed 200
Next stop target P1_S2_I

P1_S2_I:

Property Name Value
Name P1_S2_I
New train speed 30
Next stop target P1_S2_M

P1_S2_M:

Property Name Value
Name P1_S2_M
New train speed 30
Next stop target P1_S2_O

P1_S2_O:

Property Name Value
Name P1_S2_O
New train speed 200
Next stop target P1_S1_I

Move them as you need and check, if they are linked by an yellow line.

Make it nice

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.

See also