Tremulous Forum
General => Troubleshooting => Topic started by: OhaiReapd on May 12, 2011, 02:07:37 am
-
Ok, so I am having trouble setting it so the first time I hit the bind, it locks, and the second will unlock and reset. BUT It doesn't. I can lock, unlock but it doesn't reset.
Thanks for all the bind help. <3
seta ulocka "seta m5k1 "lock a; vstr locka; vstr menu0"
seta ulockh "seta m5k2 "lock h; vstr lockh; vstr menu0"
seta locka "seta m5k1 "unlock a; vstr ulocka; vstr menu0"
seta lockh "seta m5k2 "unlock h; vstr ulockh; vstr menu0"
seta m5k1 "lock a; vstr locka; vstr menu0"
seta m5k2 "lock h; vstr lockh; vstr menu0"
-
seta ulocka "seta m5k1 "lock a; vstr locka; vstr menu0"
seta ulockh "seta m5k2 "lock h; vstr lockh; vstr menu0"
seta locka "seta m5k1 "unlock a; vstr ulocka; vstr menu0"
seta lockh "seta m5k2 "unlock h; vstr ulockh; vstr menu0"
seta m5k1 "lock a; vstr locka; vstr menu0"
seta m5k2 "lock h; vstr lockh; vstr menu0"
You can't put quotes in a cvar. Something like this should work
seta locka "lock a; seta togglea vstr unlocka"
seta unlocka "unlock a; seta togglea vstr locka"
seta togglea "vstr locka"
seta lockh "lock h; seta toggleh vstr unlockh"
seta unlockh "lock h; seta toggleh vstr lockh"
seta toggleh "vstr lockh"
-
Can you please explain why it works for future reference? And I can add that vstr menu0 thing too, right?
-
I don't know what "the vstr menu0 thing" is, so…
I'm not sure what you want in terms of explaining why it works, but I can take a shot at explaining why your version did not
seta ulocka "seta m5k1 "lock a; vstr locka; vstr menu0"
the quote before seta m5k1 starts a string literal
the quote before lock a terminates the string literal, so the following semicolon is treated as the end of the line
the above code is interpreted as
seta unlocka "seta m5k1 lock a"
vstr locka
vstr "menu0 "
If you remove the quotes before the setas, your version might work as expected
-
Oh thank you, I forgot to respond to this.. It works, thanks for the help. <3