Creating a moving platform: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(General cleanup for consistency and removal of "old tutorial")
Line 1: Line 1:
{{Back|Portal Level Creation}}
{{otherlang2
{{otherlang2
| ru = Creating a moving platform:ru
| ru = Creating a moving platform:ru
Line 6: Line 5:
In this tutorial you will learn how to create a moving platform.  
In this tutorial you will learn how to create a moving platform.  


= New Tutorial =
[[Image:Train1.JPG|right|thumb|Finished platform in [[Portal_Design_And_Detail|unfinished room]]]]
[[Image:Train1.JPG|right|thumb|Finished platform in [[Portal_Design_And_Detail|unfinished room]]]]
== The platform ==
== The Platform ==


1. Create a prop_dynamic with the following settings:
1. Create a prop_dynamic with the following settings:
Line 20: Line 18:
| Parent || platform1_train
| Parent || platform1_train
|}
|}


2. Create a brush that is 120x120x2 with the texture glass/glasswindow_frosted_004. Place it inside the train model. Tie it to a func_tractrain with these settings:
2. Create a brush that is 120x120x2 with the texture glass/glasswindow_frosted_004. Place it inside the train model. Tie it to a func_tractrain with these settings:
Line 47: Line 44:
|}
|}
:Also, ensure no user control is checked. ''If no initial speed is specified, the train will not move at all.''
:Also, ensure no user control is checked. ''If no initial speed is specified, the train will not move at all.''


3. Create an env_citadel_energy_core, place it under the model, and set these values:
3. Create an env_citadel_energy_core, place it under the model, and set these values:
Line 86: Line 82:
| [[Image:Io11.png]] || OnPass || platform1_train || Resume || 0 || 1 || No
| [[Image:Io11.png]] || OnPass || platform1_train || Resume || 0 || 1 || No
|}
|}


2. Create as many path_track entities as you desire. Ensure they stay the same height, and follow the same numbers. Also make sure the last path_track points to the first.
2. Create as many path_track entities as you desire. Ensure they stay the same height, and follow the same numbers. Also make sure the last path_track points to the first.


3. Test your system, before you continue.
3. Test your system, before you continue.


== The Rail ==
== The Rail ==
Line 105: Line 99:
|}
|}


2. Place info_targets at each bend or end of the rail brushes. Name them something like platform1_target1.


2. Place info_targets at each bend or end of the rail brushes. Name them something like platform1_target1.
3. Create an env_beam for each strait section of track. Set the following:
3. Create an env_beam for each strait section of track. Set the following:
:{| class=standard-table
:{| class=standard-table
Line 141: Line 135:
:: models/props/light_rail_endcap.mdl
:: models/props/light_rail_endcap.mdl
:: models/props/light_rail_corner.mdl
:: models/props/light_rail_corner.mdl


2. Add an env_citadel_energy_core that points at the base of the prop. Set these to start on with a scale of .5
2. Add an env_citadel_energy_core that points at the base of the prop. Set these to start on with a scale of .5
Line 160: Line 153:
| [[Image:Io11.png]] || OnTrigger || platform1_train || SetSpeed || 40 || 2 || No
| [[Image:Io11.png]] || OnTrigger || platform1_train || SetSpeed || 40 || 2 || No
|}
|}
<br>
----
<br>
----
<br>
= Old Tutorial =
{{Cleanup}}
[[Image:moving_platform_01.jpg|right|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: <code> models/props/light_rail_platform.mdl </code>.
* This one is smaller <code> models/props/light_rail_platform_02.mdl </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>, which we'll create next.
== Creating functions ==
[[Image:moving_platform_system.jpg|right|320px]]
Create brush with dimensions of chosen platform. It’s not necessary, but it will surely work without any bugs. Tie it to <code>func_tracktrain</code> entity by pressing <code>Ctrl-T</code>, and set its variables as follows:
::{| class=standard-table
!  Property Name || Value
|-
| Change angles || this is up to you, I’m using: <code>never (fixed orientation)</code>
|-
| Change velocity || too, it’s your choice, but: <code>ease in/ease out</code>
|-
| First stop target || <code>P1_S1_M</code>
|-
| Initial speed || <code>100</code>
|-
| Max speed || <code>10 000</code>
|-
| Name || platform_func
|}
And, you may set sounds:
::{| class=standard-table
!  Property Name || Value
|-
| Start sound || <code>Doors.Move12</code>
|-
| Stop sound || <code>Doors.FullClose12</code>
|}
== Path tracking ==
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 will use.
Create a set of [[path_track]]s, configuring them as follows:
::{| class=standard-table
!  Property Name || Value
|-
| Name || <code>P1_S1_M</code>
|-
| New train speed || <code>30</code>
|-
| Next stop target || <code>P1_S1_O</code>
|}
::{| class=standard-table
!  Property Name || Value
|-
| Name || <code>P1_S1_O</code>
|-
| New train speed || <code>200</code>
|-
| Next stop target || <code>P1_S2_I</code>
|}
::{| class=standard-table
!  Property Name || Value
|-
| Name || <code>P1_S2_I</code>
|-
| New train speed || <code>30</code>
|-
| Next stop target || <code>P1_S2_M</code>
|}
::{| class=standard-table
!  Property Name || Value
|-
| Name || <code>P1_S2_M</code>
|-
| New train speed || <code>30</code>
|-
| Next stop target || <code>P1_S2_O</code>
|}
::{| class=standard-table
!  Property Name || Value
|-
| Name || <code>P1_S2_O</code>
|-
| New train speed || <code>200</code>
|-
| Next stop target || <code>P1_S1_I</code>
|}
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.
<gallery>
Image:moving_platform_mdl_01.jpg
Image:moving_platform_mdl_02.jpg
Image:moving_platform_mdl_03.jpg
</gallery>


== See also ==
== See also ==
[[Portal Level Creation]]
* [[Portal Level Creation]]


== External links ==
== External links ==

Revision as of 01:19, 29 August 2010

Template:Otherlang2

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

Finished platform in unfinished room

The Platform

1. Create a prop_dynamic with the following settings:

Property Name Value
World Model models/props/light_rail_platform.mdl
Name platform1_model
Parent platform1_train

2. Create a brush that is 120x120x2 with the texture glass/glasswindow_frosted_004. Place it inside the train model. Tie it to a func_tractrain with these settings:

Property Name Value
Name platform1_train
Height above track 0
Change angles never
Move sound Portal.horizontal_lift_move
Volume 2
Max pitch 100
Min pitch 80
First stop target platform1_s1
Max speed 40
Initial Speed 40
Also, ensure no user control is checked. If no initial speed is specified, the train will not move at all.

3. Create an env_citadel_energy_core, place it under the model, and set these values:

Property Name Value
Name platform1_core
Parent platform1_train
Pitch Yaw Roll 90 0 0
Scale .5
Set the flag to start on if desired.

The Path

1. Create a path_track, center it in the very center of platform1_train. Set these values:

Property Name Value
Name platform1_s1
Next stop target platform1_s2
Orientation type no change
Set the flag teleport to this path_track if you have a one direction system.
I also set these outputs:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPass platform1_train Stop 0 0 No
Io11.png OnPass platform1_train Resume 0 1 No

2. Create as many path_track entities as you desire. Ensure they stay the same height, and follow the same numbers. Also make sure the last path_track points to the first.

3. Test your system, before you continue.

The Rail

1. Create a brush 12x2 and set it around your path. Texture it with effects/light_rail_beam1. Turn it to a func_brush with these settings:

Property Name Value
Fx color 225 252 253
Solidity Never Solid

2. Place info_targets at each bend or end of the rail brushes. Name them something like platform1_target1.

3. Create an env_beam for each strait section of track. Set the following:

Property Name Value
Beam color 38 50 68
Brightness 255
Ending entity (your info_target)
Life 0
Name platform1_beam
Render FX Fast Wide Pulse
Sprite name materials/Effects/laser1.vmt
Start entity (your info_target)
Texture scroll rate 2
Width 4

Set it to start on.

Props

1. Add props at the end of your rails. Also under the corners.

Some props are :
models/props/light_rail_wall_emitter.mdl
models/props/light_rail_endcap.mdl
models/props/light_rail_corner.mdl

2. Add an env_citadel_energy_core that points at the base of the prop. Set these to start on with a scale of .5

Enabling

1. To enable your train use these outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger platform1_beam Color 176 217 247 0 No
Io11.png OnTrigger platform1_beam Width 10 0 No
Io11.png OnTrigger platform1_core StartDischarge 0 0 No
Io11.png OnTrigger platform1_train SetSpeed 40 2 No

See also

External links

  • Example map Example map using this tutorial. VMF included.