Trains.

Discussion in 'Mapping Questions & Discussion' started by Demitri Omni, May 3, 2008.

  1. Demitri Omni

    Demitri Omni L2: Junior Member

    Messages:
    53
    Positive Ratings:
    3
    Apparently, I can't get this simple thing down. I've made a func_tracktrain, with a large trolley parented to it. It worked fine earlier, except that it keeps ending up spawning backwards. I tried reversing the track itself, but that creates an issue where when it's triggered to move backwards, it just sort of shudders back and forth an inch or so, effectively stuck. I'm also having a model parented to it switch parents with another tracktrain, and I wanted to know if it was necessary to remove the previous parent, or if the the SetParent input would be sufficient.
     
  2. Foreverkul

    Foreverkul L4: Comfortable Member

    Messages:
    157
    Positive Ratings:
    14
    Flag 'fixed orientation', unless it turns, then you need to change the turning on the path_tracks.
    And I think an object can only have 1 parent so if you set a new one the old one is overridden.
     
  3. Pseudo

    Pseudo L6: Sharp Member

    Messages:
    319
    Positive Ratings:
    149
    Rotate your train so that you see the front of the train in the front (y/z) view. When the train spawns it automatically places itself on the first path_track and will rotate the correct way.
     
    • Thanks Thanks x 2
  4. Demitri Omni

    Demitri Omni L2: Junior Member

    Messages:
    53
    Positive Ratings:
    3
    Another question, if I parent a door to the tram, will the move direction rotate along with the tram?
     
  5. Pseudo

    Pseudo L6: Sharp Member

    Messages:
    319
    Positive Ratings:
    149
    Yes. When something is parented all of its angles, directions, and movements become relative to its parent.
     
    • Thanks Thanks x 1
  6. Demitri Omni

    Demitri Omni L2: Junior Member

    Messages:
    53
    Positive Ratings:
    3
    Alright, hopefully that will be my last question, I'm about to compile my last build of the startup of my map, if I can get past that, it's honestly the most complicated thing I have going.
     
  7. Demitri Omni

    Demitri Omni L2: Junior Member

    Messages:
    53
    Positive Ratings:
    3
    (hopefully) final question:

    If I set a train to Stop through an i/o, do I need to set a speed if I tell it to go backward? Simply adding an output to move backward doesn't seem to do anything.
     
  8. Jive Turkey

    Jive Turkey L3: Member

    Messages:
    120
    Positive Ratings:
    32
    From the dev wiki:
    The only way I could get mine to behave was to have each path_track have the same speed variable (unfortunately losing some functionality in the process), but even then I never figured out how to solve the ghost cart problem whereby the train would sometimes continue moving with no one on it, presumably because of errors in the OnEndTouch output of the trigger.

    Reading about the new gametype payload it appears that Valve may have corrected these problems. I mean I would have to assume they've done something as goldrush seems to function properly. Apparently, with the recent payload addition the func_tracktrain has received a new input called SetSpeedDirAccel. If you set this to a number between 0 and 1 the cart will accelerate to whatever scale of its max speed that number represents. For instance 0.5 will accelerate to half its max speed. Just give it a negative number to have it roll backwards. I have not tested this, but I'm assuming they've finally fixed the damn tracktrain with the newest payload map release. I'm excited to try this out myself, but yea, tracktrains have historically been a pain to work with so good luck.