Jump to content

Home

Level.Time


count_coder

Recommended Posts

How does this work in JA? Basically, I want the force regen to wait about 20 seconds or so then to regen 20 and repeat..

void WP_ForcePowerRegenerate( gentity_t *self, int overrideAmt )
{ //called on a regular interval to regenerate force power.
if ( !self->client )
{
	return;
}

if ( overrideAmt )
{ //custom regen amount
	self->client->ps.fd.forcePower += overrideAmt;
}
else
{ //otherwise, just 1
	this is what i commented out//self->client->ps.fd.forcePower++;
self->client->ps.fd.forcePower = level.time + 10000;
self->client->ps.fd.forcePower += 20;
}

 

It doesn't seem to wait at all.. In fact I think the force power regens at + 10000 instead of waiting..

 

What about using self->nextThink? I tried that and it compiles but still it doesn't seem to work..

Link to comment
Share on other sites

i see.. then what is the regen time? I should say, where is the call to forcepowerRegen located? it seems to be automatic and no calls is made for it unless you have a force boon.. anyway.. can you please explain to me why self->nextthink "whatever" doesn't seem to make it wait at all?

 

I dont see anything else inside this function..

 

Where is the regen time? It must be set somewhere else, but where?

 

 

 

Anyway, Thanks for your reply

Link to comment
Share on other sites

I beleive this function is the one called to add the force power to the player instead of controlling the regen rate. The rate is determined in the function(s) that call this one.

 

self->nextthink controls the next time the self->think function is called. It has nothing to do with what you're trying to do.

Link to comment
Share on other sites

do you happen to know which function calls this? i searched for WP_ForcePowerRegenerate and got a few results.. all of them were around the lines 5556.. it seems that if you are a jedi master they multiple the regen rate by 4 and 6.. and if you don't then its standered normal

if (g_gametype.integer != GT_HOLOCRON || g_MaxHolocronCarry.value)
		{
			//if (!g_trueJedi.integer || self->client->ps.weapon == WP_SABER)
			//let non-jedi force regen since we're doing a more strict jedi/non-jedi thing... this gives dark jedi something to drain
			{
				if (self->client->ps.powerups[PW_FORCE_BOON])
				{
					WP_ForcePowerRegenerate( self, 6 );
				}
				else if (self->client->ps.isJediMaster && g_gametype.integer == GT_JEDIMASTER)
				{
					WP_ForcePowerRegenerate( self, 4 ); //jedi master regenerates 4 times as fast
				}
				else
				{
					WP_ForcePowerRegenerate( self, 0 );
				}
			}

 

so if this updates every second.. how can i make it delay?

 

Thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...