lfnetwork.com mark read register faq members calendar

Thread: problem with eflags
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-06-2004, 09:53 PM   #1
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
problem with eflags

alright, i'm working on getting the awards system from q3 working again. (it's only ifdef'd out)

the awards are

capture- make a capture
defend- defend the flag or your flag carrier
assist- pick up a downed flag and return it or kill the enemy flagger which results in a cap

excellent - a double kill
impressive- 2 consecutive zoomed distruptor hits
saber- a saber kill


when the awards happen, the graphics are drawn over your head and on your hud (other people can see the one over your head)

if you have more than 10 of any of them, there is a graphic and the number you have accumulated under it


for playing sounds, the awards are placed into a stack and played in order
Code:
if (ps->persistant[PERS_CAPTURES] != ops->persistant[PERS_CAPTURES]) {
sfx = cgs.media.captureAwardSound;
		
pushReward(cgs.media.captureAwardSound, cgs.media.medalCapture, 
ps->persistant[PERS_CAPTURES]);
reward = qtrue;
Com_Printf("capture sound\n");
	}
this also takes care of the hud part

for the ballons over the players head look at
static void CG_PlayerSprites( centity_t *cent )

ok, when a player makes a cap, it gets flagged with a
[code]
#define EF_AWARD_CAP 0x00000800

like when a player makes a capture this in team_touchourflag
Code:
other->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | 
EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
	other->client->ps.eFlags |= EF_AWARD_CAP;
	other->client->rewardTime = level.time + REWARD_SPRITE_TIME;
	other->client->ps.persistant[PERS_CAPTURES]++;
and this happens client side every frame to check for and to display the balloon


Code:
if ( cent->currentState.eFlags & EF_AWARD_CAP ) 
	{
		CG_PlayerFloatSprite( cent, cgs.media.medalCapture );
		Com_Printf("capture spirte\n");
		return;
		
	}
when the award time runs out, this happens in clientThink_real

Code:
// clear the rewards if time
	if ( level.time > client->rewardTime ) 
	{
		client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | 

EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
	}
now, on to the problem


if i actually perform something to get an award or do a "/give capture" with cheats on, all the awards work right: meaning if i have 3 capture awards, 3 capture icons will display on my hud, but the balloon icon will only appear for a frame (wtf?)


all the other awards work perfectly,

in the q_shared.h there are several dataums called eFlags, i'm assuming that the one i'm working with here is the byte

the only thing that is different from capture and all the other awards is that the EF_CAP is at the end of the clear command for the byte

but i'm not really sure how to work with the byte datatype, and i assume that the line..

Code:
ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | 

EF_AWARD_DEFEND | EF_AWARD_CAP );
is resetting the flag for awards... but if none of the other flag clearing entrys in g_Active are actually mention the award flags, then how is it being taken off?

and btw, when i put on cheats and turn on the jet pack, the capture balloon STAYS on

heeelpp meee
stubert is offline   you may: quote & reply,
Old 08-07-2004, 03:04 AM   #2
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,187
Re: problem with eflags

1. What is REWARD_SPRITE_TIME defined as?
2. If the jetpack stuff is affecting your capture icon, it probably means that your eflags are conflicting. Make sure that your EF_AWARD_CAP value is not the same as the other eflags.


---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 08-07-2004, 03:30 AM   #3
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
yep, it was the same as one of the jetpack flags

i use EF_NOT_USED_5 for my capture now
stubert is offline   you may: quote & reply,
Old 08-07-2004, 04:42 AM   #4
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,187
Ok, I'm glad I could help. FYI, you can change eflag define names if you want to.

It won't break the eflag network code. Just don't go over the current bit transfer limit set by the external code files.


---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,
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 > problem with eflags

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 04:07 AM.

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