Jump to content

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


Recommended Posts

Posted

After many tries, I finally got this one to work, except that it does the same thing as the old Grip whenever I set it to anything other than zero.

 

#define BUTTON_FORCEGRIP 64
#define BUTTON_FORCEGRASP 64
 
Is there anything I can do to fix this?
Posted

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

Posted

So if I were to make a 14th button, would I have to do 1 * 2 * 2 * 2 (and so forth) to get the proper value for it, and type that number in?

Posted

Yep. You can double the previous value.

You can only have up to 15 buttons in Raven's jamp.exe, and 16 in OpenJK without engine modifications.

Posted

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.

Posted

The quick explanation of what Circa is showing you is:

Animation name, the the starting frame of the animation, the number of frames in the animation, wheiter it plays once (-1) or loops (0), and the speed (normally 20 or 40)

Circa likes this
Posted

But if the animation was not designed to loop (last frame blending back to first frame) then it will probably have a noticeable glitch as it loops.

Indeed it will.

 

Posted

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.

Posted

This thread has peaked my interest. I have been asking for years how hard it would be to grip more than one person at a time depending on if they were in a certain proximity of each other.

Posted

I suppose you could grip multiple people if you hold down the "Use" button before gripping, like TFU1.

 

EDIT: Btw, it's different from the SP Grip; different lines of coding.

ChalklYne likes this

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...