After I succeeded in adding new weapon calibers by editing the proto files, I thought maybe I could do the same to change the animation code (K-LASER, L-MINIGUN, M-ROCKET), and add a new one like N-CROSSBOW. I figured out that in a weapon proto, hex offset 3c stores the animation codes, and they are:
00 - None
01 - D-KNIFE
02 - E-CLUB
03 - F-2_HANDED_CLUB
04 - G-SPEAR
05 - H-PISTOL
06 - I-UZI
07 - J-RIFLE
08 - K-LASER
09 - L-MINIGUN
0A - M-ROCKET
So I changed that value to 0B and copied one of the existing animation sets to letter code N. I was hoping that it would just work, and if it did, that would mean I could edit the rifle frames and make them into crossbows.
Unfortunately, when I place a weapon configured to anim code 0B on the map, the player can't pick it up. Strangely it gives the message "you are at your maximum weight capacity" even though my inventory screen shows I am carrying 0 weight. And even if I wear power armor I still can't pick up the weapon.
My guess is that the code for loading the animation files is more complex than the code that associates ammo code with weapon. In that case, its just comparing two bytes ... if they match then the ammo is the right caliber. In the case of animation codes though, it would need to have code that builds the file name, or at least appends the animation code letter sequence (I, J, K, L, ...) to the base critter name (HMJMPS).
Damn. I want crossbows
EDIT: It should be possible to make new NPCs that use crossbows, by simple editing the rifle frames and drawing arcs on them. But then that character can't use rifles. And this can't be done for the player without giving up rifles. hee hee one idea though ... a certain armor type could magically turn rifle frames into crossbows.
00 - None
01 - D-KNIFE
02 - E-CLUB
03 - F-2_HANDED_CLUB
04 - G-SPEAR
05 - H-PISTOL
06 - I-UZI
07 - J-RIFLE
08 - K-LASER
09 - L-MINIGUN
0A - M-ROCKET
So I changed that value to 0B and copied one of the existing animation sets to letter code N. I was hoping that it would just work, and if it did, that would mean I could edit the rifle frames and make them into crossbows.
Unfortunately, when I place a weapon configured to anim code 0B on the map, the player can't pick it up. Strangely it gives the message "you are at your maximum weight capacity" even though my inventory screen shows I am carrying 0 weight. And even if I wear power armor I still can't pick up the weapon.
My guess is that the code for loading the animation files is more complex than the code that associates ammo code with weapon. In that case, its just comparing two bytes ... if they match then the ammo is the right caliber. In the case of animation codes though, it would need to have code that builds the file name, or at least appends the animation code letter sequence (I, J, K, L, ...) to the base critter name (HMJMPS).
Damn. I want crossbows

EDIT: It should be possible to make new NPCs that use crossbows, by simple editing the rifle frames and drawing arcs on them. But then that character can't use rifles. And this can't be done for the player without giving up rifles. hee hee one idea though ... a certain armor type could magically turn rifle frames into crossbows.