Jump to content

Force Grip (New Grip) and Force Choke (Old Grip)


Recommended Posts

The buttons are stored in a bit-field. 64 is the 7th bit (represented as "0100 0000", or 64)

In base, there are 12 buttons being used, so you'll have to make your new force-power be the 13th button, i.e. the 13 bit (represented as "0001 0000 0000 0000", or 4096)

You can then access it via /bind x +button12

Link to comment

Also, I'm trying to figure out how to loop the "BOTH_PULLED_INAIR_F" and "BOTH_PULLED_INAIR_B" anims for the new grip. Every time I lift someone up, the anim always freezes at it's last frame.

 

I recall a mod called "Telekinesis" on JK3Files, which replaced the choke anim for the old grip, but I've never swapped anims myself.

Link to comment

game/w_force.c

void ForceGrip( gentity_t *self )
Look for checks like:

	if ( !WP_ForcePowerUsable( self, FP_GRIP ) )
	if ( tr.fraction != 1.0 &&
		tr.entityNum != ENTITYNUM_NONE &&
		g_entities[tr.entityNum].client && // <---- HERE
		!g_entities[tr.entityNum].client->ps.fd.forceGripCripple &&
		g_entities[tr.entityNum].client->ps.fd.forceGripBeingGripped < level.time &&
		ForcePowerUsableOn(self, &g_entities[tr.entityNum], FP_GRIP) &&  // <---- HERE
		(g_friendlyFire.integer || !OnSameTeam(self, &g_entities[tr.entityNum])) ) //don't grip someone who's still crippled
Modifying those checks to allow non-client entities should work.

There might be other places in code that rely on the gripped object being a client. I'm not sure.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...