Button trouble

Discussion in 'Mapping Questions & Discussion' started by bamibal, Aug 14, 2015.

  1. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    Hello, I´m making my first map and slowly getting the hang of it. Now there´s one thing that I can´t seem to figure out. Ater googling, experimenting and compiling for hours without result I figured it would be a wise step to register here and ask :p

    I got a ´train´(actually a moving prop) up and running, it runs a continuous pattern. I made a button on the wall which you can smack and does 'SetSpeed 800', making the prop go beserk. So far so good. At first I tried to make it so that you press the button, prop goes beserk, press it again to turn it back to normal:

    [​IMG]

    Result: prop goes beserk, but after whacking the button again to depress it, it doesn't go back to 100 speed. Tried it with the 'toggle' flag enabled and disabled but both didn't work.

    Tried some other things but all didn't work. Then I thought, if this has to be so hard, I'm gonna try something different and make it a timed sequence with the prop going beserk for 8 secs:

    [​IMG]

    Unfortunately, same result. Once the speed is set to 800 it just won't go back to 100. I hope someone can help me out here:thumbup:
     
  2. spudboy

    spudboy L1: Registered

    Messages:
    37
    Positive Ratings:
    6
    I'm going to assume that you're using a func_tracktrain because you haven't said what you're using and it's the only thing I'm familiar with that can do what you're saying.
    I looked on the Valve Developer wiki and under the inputs, it says this about setspeed:

    SetSpeed <float>
    Set the speed of the train, as a ratio of max speed [0, 1]

    So I'm pretty sure what you want to be doing is setting the train's max speed to 800 and using setspeed 1 to make it go at 800 and setspeed 0.125 to make it go at 100.

    Hope this helps.
     
    • Thanks Thanks x 1
  3. MoonFox

    MoonFox L10: Glamorous Member

    Messages:
    735
    Positive Ratings:
    72
    if I remember correctly, trains (other than the cart) don't work in TF2. be careful, and can we see the properties instead of the inputs/outputs
     
  4. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
    No?
     
    • Thanks Thanks x 1
  5. MoonFox

    MoonFox L10: Glamorous Member

    Messages:
    735
    Positive Ratings:
    72
    that's what I was concerned about... because no map (I have ever seen) has used any hint of a separate track train for separation of ledges. and tyler, once I get my issue dealing with the prop library, im curious how exactly I set up a split Payload track path.
     
  6. killohurtz

    aa killohurtz Distinction in Applied Carving

    Messages:
    998
    Positive Ratings:
    1,135
    You may want to take a long hard look at Well and Freight if you don't think trains work in TF2.

    Also, make your own separate thread if you have an unrelated question. Don't hijack someone else's.
     
    • Thanks Thanks x 1
  7. MoonFox

    MoonFox L10: Glamorous Member

    Messages:
    735
    Positive Ratings:
    72
    yea... sorry about that. but yea some days your forget maps exist. though on a serious note, I think the thing we need is the related properties of the entities/brushes involved
     
  8. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    @spudboy and coltnweston, it's indeed a func_traintrack tied to a ghost prop. It runs perfectly along it's path_track and it does go to speed 800 when I smack the button, it just doesn't go back to 100. I didn't notice the ratio part you mentioned and that might be the key, gonna try it now! If it doesn't work I'll post the settings.
     
  9. MoonFox

    MoonFox L10: Glamorous Member

    Messages:
    735
    Positive Ratings:
    72
    alright I wish you luck, a lot of hammer is learning from others, the dev page, and trial and error. so good luck
     
  10. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,071
    Positive Ratings:
    832
    No luck involved. Using 0-1 as a ratio of the func_tracktrain's max speed is what is required as an input when using SetSpeed. For example, SetSpeed 0.1 would be 10% of the train's max speed.

    If you want to set the train's speed in units-per-second rather than a ratio, then you use the SetSpeedReal input. The train will accept any value up to its maximum speed.

    Trains are quirky, but they definitely work. I can assure you of that because of my experiences working on Deathrun maps, where trains are used commonly.
     
    • Thanks Thanks x 1
  11. bamibal

    bamibal L1: Registered

    Messages:
    47
    Positive Ratings:
    5
    Damn, I set the ratio and compiled, only to see all my lighting was broken and every brush was black! I started making a lot of things func_detail and now the lighting is back (could be coincidental too, I don't know). But the good news is, my button is now working! Thanks guys!
     
  12. MoonFox

    MoonFox L10: Glamorous Member

    Messages:
    735
    Positive Ratings:
    72
    enjoy