BindToggle

Discussion in 'Mapping Questions & Discussion' started by Psy, Aug 31, 2009.

  1. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,467
    Nothing on the VDC Wiki. How do you use this command?
     
  2. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    It works with cvars which are 0/1 boolean values, and automagically changes it to whatever it currently isn't.

    Code:
    bind u "bindtoggle sv_cheats"
    Each time you depress the button, the sv_cheats state should flip.

    "Incrementvar" is also handy, taking min/max/step arguments like a little for-loop.
    Code:
    bind u "incrementvar mat_wireframe 0 3 1
    Should cause mat_wireframe to increase by 1 for each press, with 0-3 being the min/max. When it goes past the max it loops back to the minimum.
     
    • Thanks Thanks x 4
    Last edited: Aug 31, 2009
  3. Psy

    aa Psy The Imp Queen

    Messages:
    1,705
    Positive Ratings:
    1,467
    Awesome. Thanks. I've also bounded wireframe on and off to seperate keys. :p You should add this information to this page.
     
  4. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    I'll go ahead and toss something up when I get home and can be 100% sure I'm writing accurate descriptions ;)
     
  5. alecom

    alecom L8: Fancy Shmancy Member

    Messages:
    516
    Positive Ratings:
    120
  6. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    It's an example.

    And you really should have a Mic.
     
  7. Xi.Cynx

    aa Xi.Cynx Former Alias: †Blade†

    Messages:
    772
    Positive Ratings:
    727
    I made what you would call a "script", at least that what a lot of people would call it. I call it ease on the classes. One for spy and engineer to use the "f buttons" to do certains thigns faster as opposed to going through multiple screens. and it only loads when i select that character. =) ex:

    bind f1 "disguise 1 1" //Scout
    bind f2 "disguise 3 1" //Soldier
     
  8. Ðїαмøп∂Ðøvαн

    Ðїαмøп∂Ðøvαн L1: Registered

    Messages:
    1
    Positive Ratings:
    0
    Hey guys, I've been trying to use the bindtoggle command to toggle addcond 5 and removecond 5 for my private server. This is what i've been using: bindtoggle "-" "addcond 5; removecond 5". I've also been using: bind "-" "bindtoggle addcond 5; bindtoggle removecond 5". Neither worked. help please?