Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Force Grip, Duration, and other stuff

Page: 1 of 1
 count_coder
08-30-2004, 9:55 AM
#1
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 :)
 Tinny
08-31-2004, 12:39 PM
#2
hmm, look at the case files for the different force powers, i think under some of the case FP_....: there are things for button releasing values.
 count_coder
08-31-2004, 1:52 PM
#3
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 :)
 Tinny
08-31-2004, 5:15 PM
#4
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/)
 count_coder
09-01-2004, 9:10 AM
#5
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
Page: 1 of 1