View Full Version : Weapons changing
Tonetheman
04-07-2001, 07:38 PM
I am wanting to write a script that will help organize weapons a little better. I want to put two weapons on a key, and then switch back forth between the weapons on a key-press. I use the same kind of script in Q3 and it is great! :)
Any ideas on places to start? I am having trouble even finding a reference of where to start to be honest.
Thanks ahead of time
SuperTech
04-07-2001, 07:54 PM
Well the single pistol- dual pistol, shotgun-coachgun and tommygun - minigun will toggle back and forth already but they are the only ones. I have looked into it briefly but I have not found a way yet to toggle the others.
FuelnFire
04-08-2001, 12:28 AM
Get it in gear willya ST? :cheesy:
kill O zap
04-25-2001, 04:47 PM
I did write a script that does what you were asking for. It toggles two weapons with one key, that is:
knife/pistol -> 1
shotgun/machinegun -> 2
rocket/grenade launcher -> 3
lasergun/cannon -> 4
But as ST said, the single pistol/dual pistol, shotgun/coachgun and tommygun/minigun do toggle on one key each by default. My script overrides this default, it toggles to the bigger one of each if you have that one, else you get the smaller. So if you have the dual pistols my script toggles between knife and the dual pistols by pressing the <1> key. This might not be the best solution.
Anyways, here it is:
Add the following lines to your GameStartup.ini :
extern INDEX kOz_bWeaponKey_1=(INDEX)0;
extern INDEX kOz_bWeaponKey_2=(INDEX)0;
extern INDEX kOz_bWeaponKey_3=(INDEX)0;
extern INDEX kOz_bWeaponKey_4=(INDEX)0;
extern INDEX kOz_bWeaponDummy=(INDEX)0;
Add the following lines to your Controls0.ctl :
Button
Name: TTRS Knife/Pistol Toggle
Key1: 1
Key2: None
Pressed: *if(kOz_bWeaponKey_1==0) {kOz_bWeaponDummy=1; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;} else {kOz_bWeaponDummy=2; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;};
Released: kOz_bWeaponKey_1=!kOz_bWeaponKey_1; ctl_bSelectWeapon[kOz_bWeaponDummy]=0;
Button
Name: TTRS Shotgun/Machinegun Toggle
Key1: 2
Key2: None
Pressed: *if(kOz_bWeaponKey_2==0) {kOz_bWeaponDummy=3; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;} else {kOz_bWeaponDummy=4; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;};
Released: kOz_bWeaponKey_2=!kOz_bWeaponKey_2; ctl_bSelectWeapon[kOz_bWeaponDummy]=0;
Button
Name: TTRS Rocket/Grenade Launcher Toggle
Key1: 3
Key2: None
Pressed: *if(kOz_bWeaponKey_3==0) {kOz_bWeaponDummy=5; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;} else {kOz_bWeaponDummy=6; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;};
Released: kOz_bWeaponKey_3=!kOz_bWeaponKey_3; ctl_bSelectWeapon[kOz_bWeaponDummy]=0;
Button
Name: TTRS Laser/Cannon Toggle
Key1: 4
Key2: None
Pressed: *if(kOz_bWeaponKey_4==0) {kOz_bWeaponDummy=8; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;} else {kOz_bWeaponDummy=9; ctl_bSelectWeapon[kOz_bWeaponDummy]=1;};
Released: kOz_bWeaponKey_4=!kOz_bWeaponKey_4; ctl_bSelectWeapon[kOz_bWeaponDummy]=0
Hope this helps you :)
:) kill-O-zap
AbyssGazer
07-23-2001, 01:36 PM
hi...i tried using the script above to toggle rl/gl and ran into some problems so i was hoping someone could help me out (as i know nothing about this stuff)...
i guess an example would be easiest:
i have both rl & gl - i hit button to use rl
done with rl, i switch to knife
now i try to switch back to rl, but the script calls up the gl instead...
that's the problem - it keeps "going forward" and not "restarting from scratch"...i'd rather have:
1 tap = rl, 2 taps = gl (assumimg i have both of course)
otherwise i will always forget which is "due" next... and by the time i figure out that i have gl instead of rl, combined with sloooow wpn-swithching in ssam, i'm in big trouble...
the related problem is this:
i have rl but NOT gl
i switch to rl, then to knife
now when i try to switch back to rl i have to hit button TWICE...on the first tap it tries to switch to gl which is not there...so, again, big problems...
so, can anyone help me out?
Alen Ladavac
07-24-2001, 02:24 AM
Perhaps I can give you a hint guys...
Cvar 'wpn_iCurrent' contains index of the currently selected weapon. That should be enough to write the kind of script you need.
HTH,
Alen
kill O zap
08-01-2001, 05:24 AM
Thanks for the hint, Alen! I'll give it a try ...
Perhaps you can give us another hint where to find a full description of all cvars and commands ?
:-) kill-O-zap
Alen Ladavac
08-14-2001, 11:15 AM
Help\ShellSymbols.txt?
Alen
AbyssGazer
08-14-2001, 08:12 PM
you're joking right? it's not even complete...plus, some of the stuff in there isn't even in the game and vice versa...
Alen Ladavac
08-16-2001, 11:23 AM
How do you mean not complete? Which symbols are not documented?
Alen
AbyssGazer
09-07-2001, 06:38 PM
there's no /wpn commands there for example...it should be much easier for you guys to make a list, but i will if i get the time...
Grand Master Shinobi
09-07-2001, 07:45 PM
the command hud_icrosshairtype is in the shellsymbols file but not in the game which sux cause i cant script a crosshair change for my zoom script now :-(
vBulletin v3.6.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.