1. Hey there Guest,

    The game servers have moved to semi-dedicated hardware and IPs have changed. Please see front page server widget for up-to-date game server information.

Train help?

Discussion in 'Mapping Questions & Discussion' started by Shanghai, Mar 30, 2011.

  1. Shanghai

    Shanghai L6: Sharp Member

    Messages:
    394
    Positive Ratings:
    383
    I've been looking for a good tutorial on trains, but I can't seem to find one. I want a train similar to the ones in well (random timer, flashing lights and bells), but all the tutorials are either too basic or not what I'm looking for. So far, the closest I've gotten is a train that runs along its track, then teleports back to the start of the track and runs it again, over and over. If anyone could point me to a good tutorial, or just explain it here, that'd be great. Thanks a bunch! I look forward to sharing my project with you guys.
     
  2. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    5,464
    Not exactly sure what your your asking for... The train in well does that, it teleports back to the start position.
     
  3. Mr. Happy

    Mr. Happy L6: Sharp Member

    Messages:
    320
    Positive Ratings:
    158
    So do you want to stop the train so you can trigger it at random intervals? Do you not know how to do the flashing lights?

    If you need help with the complete package rather than just an aspect of two it might be most helpful for you to decompile well and take a look (you can also download the valve maps decompiled) in Hammer yourself.
     
  4. Shanghai

    Shanghai L6: Sharp Member

    Messages:
    394
    Positive Ratings:
    383
    Basically, what I want is for it to stop, so I can trigger it again at random intervals. It would probably be good to look at the decompiled map and self teach (or copy/paste ;) Teaching myself tends to work well for me. The reason I didn't want to look at decompiled Well in the first place was because it probably has a lot of irrelevant stuff (like the things they use to transition to the skybox train).
     
  5. ardysqrrl

    ardysqrrl L4: Comfortable Member

    Messages:
    173
    Positive Ratings:
    159
    I usually just control trains with their SetSpeedDir value; 1 for the train's max speed, 0 for stopped, -1 for reverse max speed. (Reverse and StartBackward have some glitches that SetSpeedDir with a negative value seems to avoid when I've tried it)

    Triggering again using random values sounds like use of a logic_timer possibly in conjunction with a logic_case

    What starts the train going in the first place? Does it start at the beginning of the map moving along the path and then stops and reverses at random?
     
    Last edited: Mar 30, 2011
  6. Shanghai

    Shanghai L6: Sharp Member

    Messages:
    394
    Positive Ratings:
    383
    Not quite. The train isn't on any particular trigger; just a random logic_timer. As for going backwards, I just want it to go back to the beginning of the track ('teleport to this track' flag), but not start moving again.
     
  7. ardysqrrl

    ardysqrrl L4: Comfortable Member

    Messages:
    173
    Positive Ratings:
    159
    you won't be using that flag unless you always want it to "jump" at a certain place; rather the TeleportToPathTrack input on the func_tracktrain will do what I think you want to do. setspeeddir 0 at the same time will make it stop moving.

    let me know if you have any difficulty putting it together
     
    • Thanks Thanks x 1
  8. Shanghai

    Shanghai L6: Sharp Member

    Messages:
    394
    Positive Ratings:
    383
    Thanks, got it ^.^