Author Topic: [solved] Toggle bind to swap other binds, only works 1/2 way.  (Read 1884 times)

Deadbeat Engineer

  • Posts: 105
  • Turrets: +9/-0
I'm trying to set it so that when I press f9 it sets 1-0 for the alien evo binds, then if I press it again, it'll set 1-0 for the human evo binds and vice versa. My problem is that I can press the button once and it'll work, but then I go to use it again, and it just tells me what the string is set to in the console.

I'm also trying to do this with cg_wwToggle for f10

Code: [Select]
set evobinds1 "vstr unbind; vstr alien; set evobinds vstr evobinds2"
set evobinds2 "vstr unbind; vstr human; set evobinds evobinds1"
vstr evobinds1

set wwtog1 "set cg_wwToggle 0; set wwtog vstr wwtog2"
set wwtog2 "set cg_wwToggle 1; set wwtog vstr wwtog1"
vstr wwtog1

bind f9 "vstr evobinds"
bind f10 "vstr wwtog"

the string "unbind" unbinds 1-0, the string "alien" sets 1-9 to the alien evo binds, and "human" sets 1-0 to the human evo binds. These binds work fine on their own, but when I try to implement them like this, it just doesn't work...

Any ideas on how to implement this or what I'm doing wrong? Thanks.
« Last Edit: June 14, 2010, 02:49:39 am by Deadbeat Engineer »
I herd u liek maras?

This most definitely. I cannot begin to express how This this is.

Kiwi

  • Posts: 859
  • Turrets: +29/-9
Re: Toggle bind to swap other binds, only works 1/2 way.
« Reply #1 on: June 14, 2010, 02:32:54 am »
Perhaps you have, but you can check out this post I made:
http://tremulous.net/forum/index.php?topic=10945.0
A bit outdated now, but it should still all work.

As for your question you could address it like this:
Code: [Select]
set evobinds1 "vstr unbind; vstr aliens; bind f10 vstr evobinds2; echo alien binds"
set evobinds2 "vstr unbind; vstr human; bind f10 vstr evobinds1; echo human binds"
vstr evobinds1

Or are you trying to do something more in depth?  I'm tired so I might be missing what you're trying to do :)

Deadbeat Engineer

  • Posts: 105
  • Turrets: +9/-0
Re: Toggle bind to swap other binds, only works 1/2 way.
« Reply #2 on: June 14, 2010, 02:46:19 am »
Thanks kiwi. Your tutorial is actually where I got my autoexec.cfg from to begin with :D

kevlarman was helping me on irc and told me that you can actually set up 1.2 so that it loads a .cfg on choosing a team, so it automatically sets the binds for me now. He also said (which I should have realized b/c I've implemented it before) is that I can just use toggle for the cg_wwToggle thing.

Thanks for the help! :D
I herd u liek maras?

This most definitely. I cannot begin to express how This this is.

Kiwi

  • Posts: 859
  • Turrets: +29/-9
Re: [solved] Toggle bind to swap other binds, only works 1/2 way.
« Reply #3 on: June 14, 2010, 03:37:07 am »
No Problem!  And thanks for adding [solved] to the beginning of the title, it's very helpful for people surfing thought the forum.