Making trains in goldsrc

In this tutorial, I will teach you how to use different entities to create trains, elevators, moving platforms, etc in cs 1.6

In this tutorial, I will show you how to make a train in cs. Keep in mind that the train does not work on a single entity; in fact, it constitutes of a group of entities. So it can be called an entity system.

A little information

You can not only make trains but also elevators, cranes, moving platforms, etc. I will simply explain the concept of making the train here. Also, you should be well versed in the different types of entities in goldsrc. If you can't understand the entities system shown here, go to this tutorial.

Step 1

Make a simple brush about 64x64x16 units. You can make any type of brush but make something small and simple for the first time. Now place cube on top of the brush. Keep in mind that it should be in the center of the brush and it must be fully covered in the "origin" texture.
Done?
Now select both the cube and the brush and tie it to the func_tracktrain entity. Keep in mind that the brush covered in the origin texture will not show up in game. This brush tells the goldsrc engine the center of the train. So if you make train and place the origin covered brush on the front, the train will take turns from the front, thereby simulating 2x2 drive which is found in vehicles.

Step 2

Now setup the properties of this entity.

Name: Type something unique like train1. This is used to ink the func_traincontrols entity.
Invisible: no(obviously)
Non solid: no
First stop target: Type something which can be written in progression like r1 or t1. This targets the entity the train will teleport to first when the round starts.
Sound: Some sounds are given to select, choose one.
Distance between the wheels: ignore this property for now.
Height above track: Ignore this one also.
Initial speed: Leave it at default.
Speed: add some number around 500.
Damage on crush: 0 does not hurt the player when he blocks the train on its path but add a number to make the player take damage upon blocking the trains path.
Volume: Control the noise the train makes.
Bank angle on turns: This useful property makes the train automatically tilt when it turns. Add a small value like 4 or 8 for now. Angles are measured in degrees.

Flags:( no need to mess with these for now)
No pitch. Disables the train to automatically tilt forwards or backwards between two turns which are located at an uneven height.
No user control: Disables the user control. Useful if you want to make a train which runs automatically. Keep in mind that you still need to add a name for the train as you will make to manually trigger the train by another entity.
Passable: Makes the train pass through players without blocking them. Use this if you want to make a moving train just for the visuals.

For this tutorial, I have named the first stop target as t1. Now place the point based path_track entity in front of the train. Name the path_track entity as t1. Type t2 as the next stop target. What does this mean? It means that the train will follow a set of set of entities. Just keep placing the path_track entities and name them in succession like t1>t2>t3, etc. To make the train go in a loop, type t1 in the last path_track's next stop target.

Step3

Now you need to make the controls for the player. Create a box on top of our platform. Texture this brush in the aaa texture and convert it into the func_traincontrols entity. When the player enters the box, he will be able to control the train.
But what if you want the train to be controlled from another position? Like a control panel or any other entity. Just place a trigger_multiple or a func_button entity and type the name of the train in its target name.

That's it. You have successfully made a moving platform which goes from one point to another. However, there a lot of different entities to experiment with.

I have uploaded this screenshot which helps newbies understand the mechanics of this entity system:
Note that the number in left is the name of the entity while the number on the right is the target of the entity.

Notes:

Func_train and func_tracktrain are basically same. Just remember that the func_train entity is useful for making elevators while the tracktrain is useful for making actual trains.
Keep in mind that the func_tracktrain will not work with the path_corner entity. That will only work with the func_train entity.

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

  • shash7's Levels
    • P2: Drudge
      Points: 1,013
    • E1: Helper
      EF: 16
    • C1: Member
    • A5: Veteran
      Account Age: 4 years
    Posted 1 year ago

    Posted by Max (von A)

    Excellent tutorials I was expecting more of yours.

    I am keeping my promise and I subscribe to your tutorials.

    Thank you :-)

    User Title
    Got no fuel, running on pure a
  • Max (von A)'s Levels
    • P2: Drudge
      Points: 2,448
    • E1: Helper
      EF: 4
    • C2: Treehouse Member
    • A6: Elder
      Account Age: 7 years
    Posted 1 year ago

    Excellent tutorials I was expecting more of yours.

    I am keeping my promise and I subscribe to your tutorials.

    User Title
    Mapper

Credits

Submitter
shash7's Levels
  • P2: Drudge
    Points: 1,013
  • E1: Helper
    EF: 16
  • C1: Member
  • A5: Veteran
    Account Age: 4 years
shash7 (Creator/Co-creator)
Key Authors
shash7
Author

Rating

10.0/10
Based off 1 rating(s)

Additional Info

Genre
Mapping
Difficulty Level
Advanced

Stats

Post Count
2
ViewCount
1,284
Date Added
1 year ago
Date Modified
1 year ago

Share

Embed Code
Code to use:

More embeddable images

Bookmark and Share