User panel stuff on forum
  8 posts on 1 page  1
Advanced Configuration
2011-07-18, 00:45
Member
10 posts

Registered:
Jul 2011
Hello,

I'm looking for a script that notifies me in the tracker box which weapon I have selected - e.g. when I change to RL the tracker says 'switched to RL' or something like that.

Forgetting which weapon I'm holding is a big problem since ammo is shared between weapons and I'm yet to find a HUD that highlights the currently selected one. I'm using weapon preselect and autohide.

Thanks in advance.
2011-07-18, 03:14
Member
87 posts

Registered:
Apr 2011
// Don't know how to get the tracker to print the selections, but this script will check for weapon / ammo, switch to it and print f. ex.
// 'Shotgun selected.' if both are present. Not in the tracker, but where normal msg's are printed (usually on the top of the screen).

alias ...axe "weapon 1; echo Axe selected."
alias ...sg "if $shells < 1 then echo Not enough shells. else .sg"
alias .sg "weapon 2; echo Shotgun selected."
alias ...ssg "if $tp_name_ssg isin $weapons then ..ssg else echo No weapon."
alias ..ssg "if $shells < 2 then echo Not enough shells. else .ssg"
alias .ssg "weapon 3; echo Double-barreled Shotgun selected."
alias ...ng "if $tp_name_ng isin $weapons then ..ng else echo No weapon."
alias ..ng "if $nails < 1 then echo Not enough nails. else .ng"
alias .ng "weapon 4; echo Nailgun selected."
alias ...sng "if $tp_name_sng isin $weapons then ..sng else echo No weapon."
alias ..sng "if $nails < 2 then echo Not enough nails. else .sng"
alias .sng "weapon 5; echo Super Nailgun selected."
alias ...gl "if $tp_name_gl isin $weapons then ..gl else echo No weapon."
alias ..gl "if $rockets < 1 then echo No rockets. else .gl"
alias .gl "weapon 6; echo Grenade Launcher selected."
alias ...rl "if $tp_name_rl isin $weapons then ..rl else echo No weapon."
alias ..rl "if $rockets < 1 then echo No rockets. else .rl"
alias .rl "weapon 7; echo Rocket Launcher selected."
alias ...lg "if $tp_name_lg isin $weapons then ..lg else echo No weapon."
alias ..lg "if $cells < 1 then echo Not enough cells. else .lg"
alias .lg "weapon 8; echo Thunderbolt selected."

// If you want the key to switch to the weapon whether you have the ammo to fire it or not: You just
// delete the ..middle lines and edit the ...first lines so they refer to the .third instead of the ..middle ones:
// alias ...ssg "if $tp_name_ssg isin $weapons then .ssg else echo No weapon."
// alias .ssg "weapon 3; echo Double-barreled Shotgun selected."

// Perhaps you want Ocrana leds or coloured text in these prints, to make them quicker / easier to read.
// This example will print red leds if no weapon, yellow if no ammo, and 'Rocket Launcher' in turquoise:
// alias ...rl "if $tp_name_rl isin $weapons then ..rl else echo $R$R No weapon."
// alias ..rl "if $rockets < 1 then echo $Y$Y No rockets. else .rl"
// alias .rl "weapon 7; echo &c2aaRocket Launcher &cfffselected."

bind KEY ...axe
bind KEY ...sg
bind KEY ...ssg
bind KEY ...ng
bind KEY ...sng
bind KEY ...gl
bind KEY ...rl
bind KEY ...lg
2011-07-18, 04:13
Member
87 posts

Registered:
Apr 2011
Oh, by the way, do you use r_drawviewmodel 1?

If you do, you can set r_viewpreselgun to 1 - you will now see the preselected weapon as viewmodel instead of the shotgun or the axe. ^^
2011-07-18, 07:05
Member
10 posts

Registered:
Jul 2011
Wow, thanks a lot

Yes, I am using r_drawviewmodel 1, and although the latter option is more convenient I'd prefer not to have a gunmodel.

I pasted the script right into my config under ALIASES but it doesn't seem to work. Any suggestions?
2011-07-18, 08:59
Member
87 posts

Registered:
Apr 2011
Just tested it again, works fine for me.

Try to save the text as a cfg file instead, put it in the qw folder, exec it in the console, then do a cfg_save. I used your settings (autohide and preselect) and I assume you have +attack on mouse1? The script is written with that in mind.

The text shouldn't be pasted directly into one spot of a config: The aliases should be in the alias section, and the key binds in the binds section, at the end. Make sure there's no weapon aliases being execed after this script, and no conflicting key binds after these. Perhaps you should put unaliasall at the start of the alias section of your config, and unbindall that the start of the binds section, to remove such things.

But it's better to do it as said above, by execing this script as a separate config, and then saving the new settings by using cfg_save configname.

Remember, when binding the keys, that space, ctrl, shift etc are to be written in Caps, while letter keys like q, w, e, r, t and y are to be written small.
I bound the keys like this when testing:
bind SPACE ...axe // the 'new' weapon 1
bind ALT ...sg // the 'new' weapon 2
bind e ...ssg // etc.
bind r ...ng
bind q ...sng
bind f ...gl
bind CTRL ...rl
bind SHIFT ...lg

I bet there's something I haven't thought of though.
2011-07-18, 09:36
Administrator
2059 posts

Registered:
Jan 2006
Another good thing to know might be that you can set r_drawviewmodel to any value between 0...1. So 0.5 would make it transparent, which might also be interesting...
www.facebook.com/QuakeWorld
2011-07-18, 10:26
Member
10 posts

Registered:
Jul 2011
No, it was just me not putting in the binds properly. It works fine, thankyou.
2011-07-18, 10:35
Member
87 posts

Registered:
Apr 2011
Ok cool to hear that it works!

Have fun.
  8 posts on 1 page  1