buttons to make the train leave.
Post Reply
Quote
Re: buttons to make the train leave.
Posted by Junkyard God on Thu Mar 22nd at 3:22pm 2007


Hello,
I've set up my little train, made 3 path_tracks for it and connected them properly, set the next stop target at the first path, so it starts in the right place.

Now, here's my problem, I want to make it move using a button.
But it won't move <img src=" SRC="images/smiles/sad.gif">
I set the button to target the tracktrain. but nothing happens.

The train is floating in mid air so it's defenatly not stuck or anything, I made the output 'toggle', I also tried "startForward" but both do nothing for me.

Anyone have any clue to what it might be?

Sorry for the sketchy description / typing, entitie problems get me so ANGRY lol.



Hell, is an half-filled auditorium



Quote
Re: buttons to make the train leave.
Posted by Riven on Thu Mar 22nd at 8:40pm 2007


I've worked a lot with func_tracktrains, enough to have dealt with just about every problem they present. I've had plenty of restless nights because of them. Anyhow, here's what I think you may not be doing right:

First make sure that you go under "flags" in the func_tracktrain's properties and check "fixed orientation" and "No User Control." Now under its "keyvalues" the main thing here is to make sure that its "Initial Speed" keyvalue is set to zero, that is if this train needs to start motionless, it will refer back to this "default" speed you gave it. With that in mind, also set the "Max Speed" to something that you obviously think the train will not go past in velocity.

Now with that clarified (you may have already had those set), I can tell you what I think the problem is. On your button, there needs to be two different outputs there that tell the func_tracktrain to go; they are: the "startForward" target input value, and the "SetSpeed" value. Just by telling the func_tracktrain to go forward only specifies its direction, not its speed, that's why the "SetSpeed" value is necessary, and why your train isn't moving. (of course you would need to enter some integers in the "parameters" box for it to have any effect)

Something else you should know: If you have a value set on each of the path_tracks under "New Train Speed" that will have the same effect. But it is important that you set the speed FIRST from that button you're using. Putting 0 in the "New Train Speed" keyvalue will deliberately not change the func_tracktrain's speed (it'll keep it the same). You will need another input onto the func_tracktrain that tells it to stop, (another "SetSpeed" that says 0).

Anyhow, there could be some other issues, but by the sound of it, I'm pretty sure that may be it. Let me know otherwise, I have a few more tricks up my sleeve







Quote
Re: buttons to make the train leave.
Posted by Stadric on Thu Mar 22nd at 8:42pm 2007


Did you remember to set the func_tracktrain's first stop property to one of your path_tracks? That's been my most common mistake making trains.

If that's not it, you may have to give the train a max speed, otherwise startforward won't work.
I think toggle just enables or disables the train visibly, or does it actually start or stop it?



Also change the texture of the dock. Docks are rarely tile. -Facepunch
As I Lay Dying



Quote
Re: buttons to make the train leave.
Posted by Junkyard God on Fri Mar 23rd at 6:34am 2007


I'll try Riven's answer when I get home later today. I'm pretty sure I only have the StartForward, and not the SetSpeed and I'm convinced that's where I whent wrong.

Riven, you might want to concider writing a tutorial about tracktrains image Seems like you know pretty much about them hehe, I'll flag you as correct once I've really tested it but I'm sure your solution will work. image

Toggle hasn't done anything really, not that I noticed anyway.

*Edit*

Well well, 2 correct answers, they both helped me, thanks a million lads, my bridge made out of trains is finished. <img src=" SRC="images/smiles/icon_smile.gif">



Hell, is an half-filled auditorium



Quote
Re: buttons to make the train leave.
Posted by Riven on Sat Mar 24th at 4:53am 2007


Hmm, that's not a bad idea actually, I feel pretty confident in the subject, and have been looking for a good idea to write a tutorial about.

I'll be sure to cover different material than what Booker did for his "Elevators" tutorial.

It's easy for me to get carried away in the details, so I'll be sure to outline this on paper first. I suppose you can all be expecting a func_tracktrain tutorial soon! Thanks for the inspiration Junkyard God.







Quote
Re: buttons to make the train leave.
Posted by Junkyard God on Sat Mar 24th at 9:20am 2007


Cool, that'd be very helpfull Riven <img src=" SRC="images/smiles/icon_smile.gif">


Hell, is an half-filled auditorium




Post Reply