PDA

View Full Version : Weapons.


keo718
08-05-2002, 11:38 PM
There are mods which turn lightsaber into swords and other weapons. Is it possible to implement such weapon changes(example: The Royal Guard's force pike), without completely replacing sabers, even to make them selectable as different hilts?

Emon
08-05-2002, 11:58 PM
Sure. I don't know how, but sure.

keo718
08-06-2002, 08:29 PM
Hmm. Thats great news. Does anyone plan on doing this? This would bring a great deal of variety to the game I think.

icepool
08-06-2002, 09:42 PM
This is kind of funny. I was messing around with this today. I wanted the yuuzhann vong model to have a metal sword instead of a saber and the thing is it worked but the sound files replaced the lightsaber files so in the long run it didn't work so I gave up cause I ran out of time. So I definately believe its possible.

keo718
08-07-2002, 02:15 PM
I guess this is where the "different saber sounds" concept comes into play. I recall Dest and/or Jai De Herr stating that it was possible. Or perhaps the weapons need not replace the lightsaber, rather just be added.

ASk
08-07-2002, 02:29 PM
to add a new weapon to jk2 you would have either:

a) remove one of the existing ones, breaking the bots horribly and other parts possibly as well, then add a new one

b) change an existing weapon to be used as a saber. all "a" applies.

c) use one of two methods of overcoming the 16 weapons limit and either lose the max ammo count (lower it to only 255) or lose the powerups. This may not happen as saber does not need ammo, so no new type of ammo is needed, but every function that checks for Player having a weapon/Giving a weapon to him needs to be replaced by another function call that will pack/unpack the two words into a d-word and then check against it.

Chewcaca_Dookie
08-08-2002, 04:03 PM
Wow! I didn't know that! Thanks!

Mr.EFF
08-11-2002, 11:08 PM
Originally posted by Chewcaca_Dookie
Wow! I didn't know that! Thanks!

You scare me.

Joben
08-11-2002, 11:54 PM
a "d-word"? ...you meen like damn? :D :jawa

ASk
08-12-2002, 02:31 AM
obviously you are no programmer

basic data sizes:

byte
word=2 bytes
dword=2 words

Yun the Sith
08-16-2002, 10:37 PM
Originally posted by ASk
use one of two methods of overcoming the 16 weapons limit and either lose the max ammo count (lower it to only 255) or lose the powerups. This may not happen as saber does not need ammo, so no new type of ammo is needed, but every function that checks for Player having a weapon/Giving a weapon to him needs to be replaced by another function call that will pack/unpack the two words into a d-word and then check against it.

Why in the heck do they have a max weapon limit, and what does it mess up when you go over.

ASk
08-17-2002, 01:45 AM
They have the limit from 2 reasons:

a) Even without the other limitation, weapon data is stored in a 4 byte variable where each bit represents a weapon. SO that would mean 32 weapons max. (Perhaps more if you use techniques similar to overcoming the 16 weapon limit)
b) Now the bad part: in order to lessen the net bandwidth, the engine only transfers the first 16 bits of the variable. That brings us to 16 weapons limit.

Possible solutions:

Making another 32bit variable and use techniques of bit packing and unpacking (2 16-bit to 32 bit and vice-versa).

This presents a problem if every weapon uses a different type of ammo (or total ammo types is greater than 16). In that case you could use a powerups array to store the ammo count, leaving you without them.
The second solution would be using 1 byte of the ammo variable to store more types of ammo. That would leave you with 255 max ammo for each and every weapon.

IF you go over the limit without compensating, the game will crash. It will issue an Illegal Operation (most likely Access Violation, since we use too much memory space) just before the map finishes loading the general data and starts loading the clients.

Primesghost
08-18-2002, 08:49 PM
Just a quick question, I haven't looked at the weapon code much yet so forgive me if I would spot this as soon as looking at it.

If the netcode is limiting the amount of info from the variable being passed (i.e. half of the variable's memory capacity) in order to save on lag, couldn't we isolate that bit of code and increment it upwards based on the amount of new weapons we want to add?

I'm glad you explained this Ask. I knew there was a 16 weapon limit in the Quake 3 engine and I knew the work-arounds, but I never had someone paint a target on why it wouldn't work for me before, now I know what I'm hunting for :).

keo718
08-18-2002, 09:17 PM
Another weapon question. Is it possible to have a gun in each hand even as it is to have a lightsaber in each hand? That would work nicely for the Fetts. And if someone wanted to make his blaster, they could just replace one of the less desirable default weapons.

ASk
08-19-2002, 03:04 AM
it's not the netcode
It's built-in into the engine

Primesghost
08-19-2002, 06:42 PM
What do you mean buit-in? It's gotta be coded somewhere. Think you could give me an idea of where it's coded?

ASk
08-20-2002, 02:08 AM
the game EXE

It's the engine design, not the added netcode.
You can't find it anywhere in the source..people tried for months with Q3A.

Commodus
08-20-2002, 03:32 AM
Then how come Generations Arena has around 40 weapons (40 > 32) and has powerups?

ASk
08-20-2002, 05:45 AM
a) they may have limited the ammo amount
b) some weapons may share ammo

if you have 128 weapons that use 1 type of ammo, you just need to code the pack/unpack function for it.

The problem arises when you have more than 16 types of ammo, because that struct is in playerstate_t, hence unchangeable.

Jaii der Herr
08-20-2002, 07:06 AM
If you use a clip design you could use many weapons and ammo types too. You can even add a STAT_NEWWEAPON were u can set the flags for new weapons...

keto
08-21-2002, 05:31 PM
that sounds good for a magic system (if going for a fantasy themed mod) as mana coudl be a singular ammo type and that makes the possiblities for 128 spells that all use varying amounts of mana. this i think woudl also be applicable to the dbz mod as i beleive they would use "ki" for their special attacks

another question is how more sabers-like weapons woudl affect the memory size. specifically for having swords, hammers, axes, etc. sure the JediMod selectable hilt works for the look of it but what about the difference in damage between a rusted short sword and a great spiked maul.
is there a way to add more saber-like weapons? and how would it differ from the possible adding other other weapons that use ammo types?

thanks,
-keto