View Full Version : New Weapon Problems...

06-14-2002, 01:09 PM
I tried to put in a new weapon into the game, loosely following the example on Q3A. When i had everything ready, so you would spawn with it and everything, i started up the game to test it. Once i joined the game, it would freeze and exit to windows. I went back in the game, and joined as a spectator, and everything seemed to work fine. I went back to the code, and commented out the part where i spawn with the weapon, and went to test it out. It worked fine again, i just didn't have the weapon. So, i went around and looked at different code that was referenced to. I found something, i think it was STAT_WEAPONS or something, that was set to 16. I set it up a little higher, and made my weapon so it should spawn with me, and tested it out. The game wouldn't' freeze this time, but it had really odd bugs. There were seeker drones all over, i had two shadows like things, that were different models than me, and the camera would go crazy. So i'm guessing setting that variable up was bad, but then how do i add a new weapon without it freezing?
Also, when the level loads with my new weapon (i just use the normal maps, because i don't know how to make my own), when it is going through the whole Loading...(weapon) thing, and gets to mine, it says Loading...??. I'm guessing i just forgot to name it at some point, but i found it quite odd.
The actual code to fire the weapon does work, because i can test that by replacing other weapons firing functions.

Thanks for any help you guys might be able to give me.

06-14-2002, 01:22 PM
you have run into the well-known 16 weapons limit
Quake uses a 32 bit variable to store weapon data (1 bit-1 weapon), but to save bandwidth transmits only 16, hence only 16 weapons are possible.
The available solutions break other parts of the code, such as powerups and/or maximum ammo

06-15-2002, 12:18 PM
I know that the Wirehead studios team for the Generations Quake 3 mod breaked the hard coded thing and found how to add more weapons than 16, but it's been in development for a very long time. You could ask to the lead coder on their forum, they're always on... but I don't remember the url.. sorry :(


06-15-2002, 12:29 PM
exactly what i said:
one solution is to add another array, this will enable 32 weapons. but you must store ammo for them somewhere, thus if they do not use the same type of ammo, you have to sacrifice the powerup array for them
Or make the maximum ammo count 8bit, freeing another 8bit to the ammo storage

i refer to the following post on the quake3 forums

06-16-2002, 07:36 AM
ASk you are the smartest coder I know in these forums-- Good job as always man! :D



And now you can return working.