lfnetwork.com mark read register faq members calendar

Thread: Level.Time
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 08-31-2004, 01:43 PM   #1
count_coder
Rookie
 
Join Date: Aug 2004
Posts: 16
Level.Time

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

Last edited by count_coder; 08-31-2004 at 03:27 PM.
count_coder is offline   you may: quote & reply,
Old 09-01-2004, 07:27 AM   #2
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
Dude, ps.fd.forcePower is the current force power of that player, not the regen time.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 09-01-2004, 09:05 AM   #3
count_coder
Rookie
 
Join Date: Aug 2004
Posts: 16
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

Last edited by count_coder; 09-01-2004 at 09:37 AM.
count_coder is offline   you may: quote & reply,
Old 09-01-2004, 01:21 PM   #4
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,171
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.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 09-01-2004, 02:17 PM   #5
count_coder
Rookie
 
Join Date: Aug 2004
Posts: 16
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
Code:
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
count_coder is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Level.Time

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:13 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.