Creating a moving platform: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Link addes + some grammar)
m (Unicodifying, replaced: [[Image: → [[File: (10))
 
(38 intermediate revisions by 17 users not shown)
Line 1: Line 1:
== Introduction ==
{{lang|Creating a moving platform}}
[[Image:moving_platform_01.jpg|right|Width:64]]
{{DISPLAYTITLE: Portal - Tutorial - Scaffolds}}
In this tutorial we will be creating a moving platform.
{{back | Portal Level Creation}}


An example map is available for download [http://myfreefilehosting.com/f/0e2f1084f7_0.22MB here].
[[File:Train1.JPG|right|thumb|350px|Finished platform in [[Portal_Design_And_Detail|unfinished room]]]]


== Creating and setting basic model ==
This tutorial covers the creation of a Scaffold in [[Portal]].
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 make 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.


== Creating a function ==
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:
[[Image:moving_platform_system.jpg|right|Height:64|Width:64]]
<!--


Somebody pls make that img smaller


-->
== The Platform ==
::{|
[[File:MovingPlatformTut1.PNG|right|thumb|200px|Properties for Step 1. Click to enlarge.]]
 
1. The first step is to insert the model of the platform. Create a [[prop_dynamic]] with the following settings:
:{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Change angles || this is up to you, I’m using: <code>never (fixed orientation)</code>
| World Model || models/props/light_rail_platform.mdl
|-
|-
| Change velocity || too, it’s your choise, but: <code>ease in/ease out</code>
| Name || platform1_model
|-
|-
| First stop target || <code>P1_S1_M</code>
| Parent || platform1_train
|}
[[File:MovingPlatformTut2.PNG|right|thumb|200px|Properties for Step 2. Click to enlarge.]]
 
2. The platform model does not have glass in it; this must be created manually. Create a brush that is 120x120x2 with the texture glass/glasswindow_frosted_004. Place it inside the platform model so that it lines up perfectly with the edges (you may need to set the grid scale to 2 or 1 temporarily). Tie it to a [[func_tracktrain]] with these settings:
:{| class=standard-table
!  Property Name || Value
|-
|-
| Initial speed || <code>100</code>
| Name || platform1_train
|-
|-
| Initial speed || <code>100</code>
| Height above track || 0
|-
|-
| Name || platform_func
| Change angles || never
|-
|-
|  
| Move sound || Portal.horizontal_lift_move
|}
|-
 
| Volume || 2
And, you may set sounds:
|-
 
| Max pitch || 100
::{|
|-
!  Property Name || Value
| Min pitch || 80
|-
|-
| Start sound || <code>Doors.Move12</code>
| First stop target || platform1_s1
|-
|-
| Stop sound || <code>Doors.FullClose12</code>
| Max speed || 40
|-
|-
|  
| Initial Speed || 40
|}
|}
:Also, ensure no user control is checked.
[[File:MovingPlatformTut3.PNG|right|thumb|200px|Properties for Step 3. Click to enlarge.]]


== Track ==
3. To add an energy effect underneath the platform, create an [[env_citadel_energy_core]] [[point entity]], place it under the model, and set these values:
Our platform is using path_track to move, so we have to create some. You can see architecture we we will use.
:{| class=standard-table
Create path_track entity with this setting:
::{|
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || <code>P1_S1_M</code>
| Name || platform1_core
|-
|-
| New train speed || <code>30</code>
| Parent || platform1_train
|-
|-
| Next stop target || <code>P1_S1_O</code>
| Pitch Yaw Roll || 90 0 0
|-
|-
|  
| Scale || .5
|}
|}
Now create another one:
:Set the flag to start on if desired.
::{|
 
== The Path ==
{{More screenshots}}
 
1. Create a [[path_track]], center it in the very center of platform1_train. This will be the starting waypoint for the path the platform follows. Set these values:
:{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || <code>P1_S1_O</code>
| Name || platform1_s1
|-
| Next stop target || platform1_s2
|-
|-
| New train speed || <code>200</code>
| Orientation type || no change
|}
:Set the flag teleport to this path_track if you have a one direction system.
 
:Also set these outputs:
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| Next stop target || <code>P1_S2_I</code>
| [[File:Io11.png]] || OnPass || platform1_train || Stop || 0 || 0 || No
|-
|-
|  
| [[File:Io11.png]] || OnPass || platform1_train || Resume || 0 || 1 || No
|}
|}
P1_S2_I:


::{|
2. Create as many path_track entities as desired. Ensure they stay the same height, and follow the same numbers. Also make sure the last path_track 's keyvalue ''Next stop target'' points back to the first path_track if the platform is intended to travel in a loop.
 
3. Compile and test the map before continuing.
 
== The Energy Rail ==
{{More screenshots}}
1. Create a brush 12x2 and set it around the path. Texture it with effects/light_rail_beam1. Turn it to a [[func_brush]] with these settings:
 
:{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || <code>P1_S2_I</code>
| Fx color || 225 252 253
|-
|-
| New train speed || <code>30</code>
| Solidity || Never Solid
|-
| Next stop target || <code>P1_S2_M</code>
|-
|
|}
|}


P1_S2_M:
2. Place [[info_target]]s at each bend or end of the rail brushes. The active energy rail beam effect will travel between these targets. Name them something like platform1_target1, platform1_target2, etc.


::{|
3. Create an [[env_beam]] for each straight section of track. Set the following:
:{| class=standard-table
!  Property Name || Value
!  Property Name || Value
|-
|-
| Name || <code>P1_S2_M</code>
| Beam color || 38 50 68
|-
|-
| New train speed || <code>30</code>
| Brightness || 255
|-
|-
| Next stop target || <code>P1_S2_O</code>
| 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
|}
|}


P1_S2_O:
Set it to start on.
 
== Props ==
{{More screenshots}}
1. Add props at the end of the rails. Also under the corners. These decorative props will appear to be creating and directing the energy rail beam.
: 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 the train use these outputs:


::{|
::{| class=standard-table
! Property Name || Value
!   || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| Name || <code>P1_S2_O</code>
| [[File:Io11.png]] || OnTrigger || platform1_beam || Color || 176 217 247 || 0 || No
|-
|-
| New train speed || <code>200</code>
| [[File:Io11.png]] || OnTrigger || platform1_beam || Width || 10 || 0 || No
|-
|-
| Next stop target || <code>P1_S1_I</code>
| [[File:Io11.png]] || OnTrigger || platform1_core || StartDischarge || 0 || 0 || No
|-
|-
|  
| [[File:Io11.png]] || OnTrigger || platform1_train || SetSpeed || 40 || 2 || No
|}
|}


Move them as you need and check, if they are linked by an yellow line.
== See also ==
* [[Portal Level Creation]]
 
== External links ==
* [http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=189 Example map] Example map using this tutorial. VMF included.


== Make it nice ==
[[Category:Portal]]
[[Image:moving_platform_mdl_01.jpg|right|Height:64|Width:64]]  
[[Category:Level Design]]
[[Image:moving_platform_mdl_02.jpg|right|Height:64|Width:64]]  
[[Category:Tutorials]]
[[Image:moving_platform_mdl_03.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. Just align top of P1_Sx_M to top of that model.

Latest revision as of 18:27, 7 January 2024

English (en)Русский (ru)Translate (Translate)

Warning: Display title "Portal - Tutorial - Scaffolds" overrides earlier display title "Creating a moving platform".

Portal Level Creation
Finished platform in unfinished room

This tutorial covers the creation of a Scaffold in Portal.


The Platform

Properties for Step 1. Click to enlarge.

1. The first step is to insert the model of the platform. 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
Properties for Step 2. Click to enlarge.

2. The platform model does not have glass in it; this must be created manually. Create a brush that is 120x120x2 with the texture glass/glasswindow_frosted_004. Place it inside the platform model so that it lines up perfectly with the edges (you may need to set the grid scale to 2 or 1 temporarily). Tie it to a func_tracktrain 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.
Properties for Step 3. Click to enlarge.

3. To add an energy effect underneath the platform, create an env_citadel_energy_core point entity, 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. This will be the starting waypoint for the path the platform follows. 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.
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 desired. Ensure they stay the same height, and follow the same numbers. Also make sure the last path_track 's keyvalue Next stop target points back to the first path_track if the platform is intended to travel in a loop.

3. Compile and test the map before continuing.

The Energy Rail

1. Create a brush 12x2 and set it around the 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. The active energy rail beam effect will travel between these targets. Name them something like platform1_target1, platform1_target2, etc.

3. Create an env_beam for each straight 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 the rails. Also under the corners. These decorative props will appear to be creating and directing the energy rail beam.

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