Jump to content

Home

Weapons.


keo718

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...