Jump to content

Home

Where is the code for guns?!?


Azrael666

Recommended Posts

Anyway, all i want is the code to make it so that when i kill someone with a saber, they disintegrate like with a kill from a disruptor. The best i have at the moment is replacing the shader for cuts on bodies with orange glow effect for the disruptor, which just look weird. I need to know either:

 

a. the code so that i can make kills from this saber disintergrate

 

or

 

b. where the code for the gun is kept, something more than just one files name, a file path within assets or something.

Link to comment
Share on other sites

OK, firstly realise that modding the .dlls is not necessarily trivial. They are stored in assets3.pk3 (if you have patched), but you will need to recompile (possibly just jampgamex86.dll), and put in your mod directory.

 

It would be easier if you have MS Visual C++ 7, or at least MSVC6.

 

This is the SDK you need. (IIRC there is also a modelling SDK).

 

Unzip it, go into the codemp directory it creates. Read the MakeAMod_readme.txt (not very helpful I'm afraid). The best intro I've read for Quake 3 engine modding is Code3Arena. Be aware though that JK:JA does not use QVMs, for reasons best known to Raven it uses .dll files for Windows and .so files for Linux.

 

Open up the project file in MSVC7, if you have MSVC6 there is a project converter here or here .

 

Open up g_weapon.c, find the function WP_DisruptorAltFire, and see why the disruptor disintegrates the target.

 

This seems to be the code:

			if (traceEnt->client && preHealth > 0 && traceEnt->health <= 0 && fullCharge &&
				G_CanDisruptify(traceEnt))
			{ //was killed by a fully charged sniper shot, so disintegrate
				VectorCopy(preAng, traceEnt->client->ps.viewangles);

				traceEnt->client->ps.eFlags |= EF_DISINTEGRATION;
				VectorCopy(tr.endpos, traceEnt->client->ps.lastHitLoc);

				traceEnt->client->ps.legsAnim = preLegs;
				traceEnt->client->ps.torsoAnim = preTorso;

				traceEnt->r.contents = 0;

				VectorClear(traceEnt->client->ps.velocity);
			}

 

Include something similar in the right place in w_saber.c and rebuild the .dll

 

You may need to add more code to get it to work, but I'll leave that to you :)

Link to comment
Share on other sites

Hmm, well, im not sure i actually have to mess around with the weapons, i just wanted to understand the code. I guess the thing to do would be to create a new kind of saber in .dll, so now all saber have this effect. So the if statement would be for the type of lightsaber (maybe if sabername=disintegrator&& health <=0 then: or something)

 

At eany rate, i proably need that in the saber file with a different if statement. Bonza.

Link to comment
Share on other sites

You'll need a compiler (which I assume Textpad doesn't include), and preferably an Integrated Development Environment. You'll have to find (or create) project files / Make files yourself if you use anything other than MSVC6/7 though (although AFAIK you'd only need to build the server side game project).

 

DevC++ is a very popular free solution. Maybe someone has already created the project files you'd need for this; ask on the coding forum.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...