brugal / wolfcamql

quakelive/quake3 demo player
GNU General Public License v2.0
73 stars 15 forks source link

Grapple Rope Texture #48

Open Kr3m opened 1 year ago

Kr3m commented 1 year ago

I apologize in advance since this isn't really an issue with wolfcam at all, but I can't seem to find the asset that is used for the grapple rope when viewing demos. Assuming it is open source, I've been working on a mod and would prefer to use an open source texture for my grapple, but am not a huge fan of the one Open Arena has available. I tried to create my own, but it just doesn't look right. If this image isn't in fact open source, if I could see it, I could at least use it as a reference when scaling my own custom graphic which is also a chain link.

Thank you in advance and again apologies, I just didn't know the proper place to ask this question.

Below is the image I tried using, but of course it doesn't look right and I'm not quite sure how to scale it so it does.

9758

brugal commented 1 year ago

See 'void CG_GrappleTrail( centity_t ent, const weaponInfo_t wi )' in cgame/cg_weapons.c

The Quake3 version just uses a lightning shader:

beam.reType = RT_LIGHTNING;
beam.customShader = cgs.media.lightningShader;

Quake live added a chain one:

beam.reType = RT_GRAPPLE;  //RT_BEAM;  //RT_LIGHTNING;  //RT_RAIL_RINGS;  //RT_LIGHTNING;
//beam.customShader = cgs.media.lightningShader;
beam.customShader = trap_R_RegisterShader("grapplingChain");

That shader is in the Quake Live pak files and uses:

gfx/misc/grapplingchain.tga

I remember I had to add a new RT_GRAPPLE type to get it to look right. See 'void RB_SurfaceGrapple( void )' in code/renderergl*/tr_surface.c.

That is identical to 'void RB_SurfaceLightningBolt( void )' but modifies the length:

len = VectorNormalize( vec );
len *= e->width;  //0.5

'e->width' is hard coded to '4' for grapple in cgame.

Kr3m commented 1 year ago

Wow. That was above and beyond what I'd asked, and I truly appreciate it. I actually have the CPMA/E+ grapple working fine at the moment, but am hoping I might be able to use this solution along with that, to get it working. After, I get this looking right, my next task is to target a sound on each action (fire, deploy, hit, pull, and release).

At any rate, I've been kicking some serious butt with my mod development lately, and really appreciate you going out of your way to share this. =D