Jump to content

Home

Basic Tutorials


XSeth2kX

Recommended Posts

I dunno if its possible to ADD new weapons in JK2, I haven't tryed that yet (I am still mapping the code areas), but it is possible on Quake 3 (as you may have observed on Code3Arena).

 

I've noticed some different coding on weapons in JK2 that differs on Q3; like there are some constants defined in 'g_weapon.c', and the weapons firing behavior are in there, and the missile behavior (the laser bolt or missile itself) is in g_missile itself.

 

I was under the impression (I haven't checked Q3 code) that some of the JK2 weapons code are a little more 'spreaded' around than Q3 one. But, the basic structure is there... My suggestion to you is: backup the code, and try it yourself anyway, and even when the Q3 codebase looks different find out where it is on the JK2, and modify it yourself. The search tool is a powerful ally... ;)

 

As for the scoreboard: At first glance, yes, and the same suggestion above remains...

 

I hope it helps...

Link to comment
Share on other sites

I was working on one that works with JK2, but it's largely incomplete. It is a part of my personal 'code' cliffnotes, I was able to add a copy of the Bryar Pistol using it, and make it fire rockets. There's a lot of stuff that I didn't get to, that appears to be client side 'friendly' code, basically when the item is precached it shows a "Loading ..... ??"

 

http://users.sisna.com/tokyopop/weaponchangetut.txt

 

Aside from what I have there, you'll also need to alter the actual firing function in g_weapons.c, as well as the alt-fire, and a

 

case WP_WHATEVER:
WP_FireWHATEVER( ent, altFire );
break;

 

in the void AnimEntFireWeapon( gentity_t *ent, qboolean altFire )

 

and then ... voila, you kind of have a weapon that you can place. You'll also have to alter the mp_entities def ...

 

as well as

inv.h

 

and one other place so the damn thing actually shows in game. I've been looking, but I'm not at an IDE right now to be able to find it. look for weapon_bryar_pistol, basically it's 'like' a spawn function, but it's not in g_spawn.c. I could be wrong, but I beleive this last part is essential so you can actually 'pick-up' the weapon, and place it and such.

 

Somebody more brilliant than I will add their extra bits of wisdom below:

Link to comment
Share on other sites

BTW I'll try later to make it work also, my Mod will also requires this implementation.

 

I actually was thinking JK2 could be restrictive about the creation of new weapons, and I was thinking (as a plan B) about making the 'new' weapons as their respective slots like: Weapon #1 for the Soldier is a gun X, while Weapon #1 for the Bounty Hunter is a gun Y, etc... So when a Bounty Hunter fires his weapon #1, the Mod will check his id and will go for Y, when its the Soldier fires, it'll be X and so on...

 

Thanks again.

Link to comment
Share on other sites

To answer the original question, yes, most of the stuff you can find on Q3 programming applies directly to JK2. The big difference is the Ghoul2 implimentation and the related .gla/.glm mess that Raven made. Some stuff is a bit different and other locations, but you can basically figure out everything, EXCEPT animation crap, from those tutorials.

Link to comment
Share on other sites

  • 2 weeks later...

Yeah, there's sections that I didn't even get to, I was just starting to crack that nut ;)

 

Anyway, I think I need to get myself educated in C all over again, so I'm starting to write some simpler stuff, then extra mover code, then weapons then animation (animation is so hard a nut, that only one coder that I know of has even begun to crack that nut)

Link to comment
Share on other sites

either way, you still have all the old stuff available, plus you could add new anims with the new skeletal system. only tough part might be making the two blend well in game.

 

guess ill tackle that in two years when im able if no one else has done so by then :p

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...