Jump to content

Home

Force Grip, Duration, and other stuff


count_coder

Recommended Posts

Hello, I am brand spanking new to ja coding. I spent the better part of yesterday reading through thousands of lines of code. Anyway, I am a little confused as to how duration works. Duration seems to be a simple int declared in the void WP_ForcePowerStart( gentity_t *self, forcePowers_t forcePower, int overrideAmt ) function, correct? So could I write something like

case FP_GRIP:
	hearable = qtrue;
	hearDist = 256;
	self->client->ps.fd.forcePowersActive |= ( 1 << forcePower );
	self->client->ps.powerups[PW_DISINT_4] = level.time + 60000;
if (self->client->ps.fd.forcePowerLevel[FP_GRIP] == FORCE_LEVEL_3)
	{
		duration = 900000;
	}

	break;

and Force grip level 3 would last for that ammount of time?

 

Also, I really want to make force grip like a one shot deal. You use it then let go of the button and it continues to do its work until its duration is over... Would that be hard to do? I tried looking in GripAction Function(line 3940) and WP_ForcePowerStop function (Line 3814) but I didn't see anything about if button is released, stop gripping..

 

One last thing, I promise :) Are there any other forums like this? All the other forums I found seemed to be dead or just dedicated to mapping.. So, for right now.. You people are my only hope :)

 

Thank you so much :)

Link to comment
Share on other sites

at line 4500

case FP_GRIP:

	powerSucceeded = 0; //always 0 for nonhold powers
	if (self->client->ps.fd.forceButtonNeedRelease)
	{ //need to release before we can use nonhold powers again
		break;
	}

	if (self->client->ps.fd.forceGripEntityNum == ENTITYNUM_NONE)
	{
		ForceGrip( self );
	self->client->ps.fd.forceButtonNeedRelease = 1;
	}

	if (self->client->ps.fd.forceGripEntityNum != ENTITYNUM_NONE)
	{
		if (!(self->client->ps.fd.forcePowersActive & (1 << FP_GRIP)))
		{
			WP_ForcePowerStart( self, FP_GRIP, 1 );
			BG_ForcePowerDrain( &self->client->ps, FP_GRIP, GRIP_DRAIN_AMOUNT );
	self->client->ps.fd.forceButtonNeedRelease = 1;


		}
	}

	break;

 

the problem is I'm not sure what to change.. what i should say.. im not sure what forceButtonNeedRelease and powerSucceeded does.. If I commented out WP_ForcePowerStart( self, FP_GRIP, 1 ); (why would i want to do that?) I notice that you still do the grip choke hand animation but it stays on if you release the button for a little bit.. Which is what I want.. So I was thinking the problem has to do with that one function?

 

Thanks for the reply :)

Link to comment
Share on other sites

hmm, i'm not sure what that line would do, but try messing with

 

powerSucceeded = 0; //always 0 for nonhold powers

 

 

line and

 

 

self->client->ps.fd.forceButtonNeedRelease = 1; line, i believe those 2 should get you to what you want. and instead of commenting out try changing

 

WP_ForcePowerStart( self, FP_GRIP, 1 );

 

 

to

 

WP_ForcePowerStart( self, FP_GRIP, 0 );

 

anytime bro :), btw, i've searched the internet and all my help has been through contacting good modders, rove searching through this forum or going to http://www.planetquake.com/code3arena/

Link to comment
Share on other sites

I tried putting

WP_ForcePowerStart( self, FP_GRIP, 0 );

it did nothing diffrent.. I also looked at force rage and speed to see where they had their power succeeded and self->client->ps.fd.forceButtonNeedRelease = 1; and changed it around.. nothing seems to change it.. and sometimes it just doesn't work at all.. I still think it has something to do with wp_forcePowerStart.. I just don't know what..

 

Did you ever get your custom game type to work? Also do you have aim or msn messenger or yahoo or some such? I would like to have some friend who knows about ja coding :)

 

 

Thanks again for the reply

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...