Toggle between two weapons

Locked
surgeon62
Posts: 573
Joined: Sun Mar 13, 2005 6:58 pm

Toggle between two weapons

Post by surgeon62 »

I'm hoping this is an easy one, although I didn't find anything like this searching the forum. Say you have two favorite weapons RL and PG for instance. Can you bind one key to togle between them?
Dilbert is a documentary.
[xeno]Julios
Posts: 6216
Joined: Fri Dec 10, 1999 8:00 am

Post by [xeno]Julios »

set plasmy "weapon 8; bind x vstr rocky"
set rocky "weapon 5; bind x vstr plasmy"

bind x "vstr plasmy"



try that - haven't tested it and it's been years since i've cfg'ed, so i might be mistaken.
surgeon62
Posts: 573
Joined: Sun Mar 13, 2005 6:58 pm

Post by surgeon62 »

Thanks man, that worked!

OK, here's a more difficult one: I see you are using variables to set up the toggle, but what if you want to set up another weapon to switch to from the RL if you don't have the PG (the SG for instance)? It seems like you need an if statement here, but I don't think you have that ability in a cfg. Is there another way to handle this?
Dilbert is a documentary.
[xeno]Julios
Posts: 6216
Joined: Fri Dec 10, 1999 8:00 am

Post by [xeno]Julios »

set up a prioritization script,

so something like

set bestweapon "weapon 1; weapon 2; weapon 3; weapon 4; etc"

that way, if u have weapon 4, it'll select it. If you don't, it'll select weapon 3 (if u have it), and so on.

That's how i did it in q2 - should work in q3 - and i don't think u'll get a cost in delay - test it out.
menkent
Posts: 2629
Joined: Sun Jul 23, 2000 7:00 am

Post by menkent »

that works in q3... it's not usually the greatest idea though since you don't know what weapon you're actually gonna end up with. same with that toggle above.

scenario: you switch to PG ("x") and spam a little then RG ("r") and after sniping at someone another guy pops around the corner and you need PG again... oh noes! "x" is now bound to RL and you kill yourself with splash damage as he rapes you with a point-blank hit from his ssg! gg.
an example demo (osp)
[xeno]Julios
Posts: 6216
Joined: Fri Dec 10, 1999 8:00 am

Post by [xeno]Julios »

yep - best solution, imo, is to have an individual key bound for each and every weapon.
surgeon62
Posts: 573
Joined: Sun Mar 13, 2005 6:58 pm

Post by surgeon62 »

menkent wrote:scenario: you switch to PG ("x") and spam a little then RG ("r") and after sniping at someone another guy pops around the corner and you need PG again... oh noes! "x" is now bound to RL and you kill yourself with splash damage as he rapes you with a point-blank hit from his ssg! gg.
an example demo (osp)
LOL... I watched the demo. Yeah, I am wanting to do this because I initally learned to play with the bad habit of making the bind for the RL the only one that was in reach with my config because it's my favorite. As a result, I don't do well with switching to the right weapon for the occasion. So as a solution, I would like to use this toggle which will create another problem... This is the kind of thinking that will get you promoted in corporate America. I know from experience... Dilbert is non-fiction.
Dilbert is a documentary.
Cooldown
Posts: 660
Joined: Mon Jun 05, 2000 7:00 am

Post by Cooldown »

surgeon62, you should check out my post relating to setting up your controls in this thread: http://www.quake3world.com/forum/viewto ... t=tertiary (it's a bit ways down)

As everyone else has stated, you should bind each weapon to an individual key. It might take some time to adjust to but it's for the best. As far as the layout is concerned, you should place your weapon binds in very close proximity to your movement keys, ie. surrounding them.
Locked