How To Control A Train?

How To Control A Train?

Re: How To Control A Train? Posted by SirJim on Fri Jan 7th 2005 at 8:54pm
SirJim
18 posts
Posted 2005-01-07 8:54pm
SirJim
member
18 posts 22 snarkmarks Registered: Jan 7th 2005 Occupation: Student Location: UK
Can anyone tell me how to make a train that can be controlled like the
ones in HL1? With the various arrows showing the speed of the train.
Ive got a train moving along a track at the mo, triggered by a button,
pressing the button makes the train move along its track, but i need
the player to be able to stop the train whenever they want, speed up
slow down etc. I know this could be done in HL1 so you must be able to
do it in HL2... right? Thanks
Re: How To Control A Train? Posted by Yesurbius on Sat Jan 8th 2005 at 1:57am
Yesurbius
48 posts
Posted 2005-01-08 1:57am
48 posts 5 snarkmarks Registered: Dec 31st 2004
You would need to put buttons in the train (func_buttons that
is). Parent them to the track_train object. Much the same
as how you made the switches to control the train from the outside.

Trains in HL2 work very similar to elevators. If you want
to get into some fancier stuff like speed control, lights to indicate
train position, etc etc - one place you may wish to start is an
elevator example map that I learned off of:

http://users.telenet.be/fnh/hl2/fnh_elevator.vmf
Re: How To Control A Train? Posted by SirJim on Sat Jan 8th 2005 at 11:15am
SirJim
18 posts
Posted 2005-01-08 11:15am
SirJim
member
18 posts 22 snarkmarks Registered: Jan 7th 2005 Occupation: Student Location: UK
Thanks alot Yesurbis, I'll check out the link in a moment. :smile:
Re: How To Control A Train? Posted by SirJim on Sat Jan 8th 2005 at 6:03pm
SirJim
18 posts
Posted 2005-01-08 6:03pm
SirJim
member
18 posts 22 snarkmarks Registered: Jan 7th 2005 Occupation: Student Location: UK
Wow, that lift looks complicated. Its close, but not quite the cigar...
as it were. In HL1's 'On A Rail' level, you were in control of a train
that could be sped up, slowed down and stopped whenever the player
wanted through a control panel thing. Yellow arrows were shown in front
of the player depicting the trains current speed and the different
speeds you could choose. I need this for the train otherwise its kind
of pointless. :smile:

Anyway, thanks for the help. Any other ideas anybody?
Re: How To Control A Train? Posted by Rof on Sat Jan 8th 2005 at 7:20pm
Rof
210 posts
Posted 2005-01-08 7:20pm
Rof
member
210 posts 41 snarkmarks Registered: Dec 3rd 2004
Use a func_tracktrain with the "HL1 train" spawnflag checked. That
makes it behave the same way as it did in HL1. At least that's the way
its done in HL:Source, anyway.
Re: How To Control A Train? Posted by SirJim on Sat Jan 8th 2005 at 9:06pm
SirJim
18 posts
Posted 2005-01-08 9:06pm
SirJim
member
18 posts 22 snarkmarks Registered: Jan 7th 2005 Occupation: Student Location: UK
Hmm, just tried that, still doesnt seem to work. I press 'use' on the
train... nothing. I also tried making a func_traincontrols and linking
it to the train... still nothing. Thanks for the help anyway. This is
really beggining to get annoying now. Someone MUST know how to make a
controlable train like those in HL1, in the level 'on a rail'. Please!!
Help me! :smile:

P.S: Theres so many questions regarding trains, someone really should
write a tutorial on them. I would if i could overcome this last
hurdle...
Re: How To Control A Train? Posted by Rof on Sun Jan 9th 2005 at 3:34am
Rof
210 posts
Posted 2005-01-09 3:34am
Rof
member
210 posts 41 snarkmarks Registered: Dec 3rd 2004
Well I made a quick test map, and if you set that spawnflag, the train
behaves just like a HL1 train except you can't see the arrows on the
hud. The functionality is identical, with forward speeds and reverse
working (even the noises are the same), it's just the arrows don't show
up.

I suspect that HL2 lacks the Hud icons necessary to display the arrows.
You might try copying those used in HL:Source to the HL2 directory
(you'd need to guess what they are named and extract them with GCF
scape), but it's possible also that the HL2 build of the engine doesn't
have the function to display the icons in the first place.
Re: How To Control A Train? Posted by SirJim on Sun Jan 9th 2005 at 1:02pm
SirJim
18 posts
Posted 2005-01-09 1:02pm
SirJim
member
18 posts 22 snarkmarks Registered: Jan 7th 2005 Occupation: Student Location: UK
Thanks alot, ill give it a try.
Re: How To Control A Train? Posted by Agent_21 on Thu May 19th 2005 at 9:17am
Agent_21
19 posts
Posted 2005-05-19 9:17am
Agent_21
member
19 posts 2 snarkmarks Registered: Apr 23rd 2005 Occupation: Mapper Location: United States
I don't have an answer for you're question, but I would like to reassure you that it can be done. I have dabbled in vehicle scripts and noticed that vehicle speeds can be controlled if modified to link to a certain key, I am assuming that trains are similiar. Don't give up trying though, you might go back to hl1 and look at the train in hammer if you still have hl1.