Inside3D!
     

Backwards running clock?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Fri Jun 11, 2010 2:50 am    Post subject: Backwards running clock? Reply with quote

CRMOD and a few other deathmatch mods run the clock backwards.

For instance, at the beginning of a match the clock might show 20:00 and runs down to 0.

How is it possible to have the time on a server be reversed?
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Fri Jun 11, 2010 11:24 am    Post subject: Reply with quote

The time isn't reversed. They have a separate timer, which starts with a value, and gets decreased each frame with frametime, or perhaps a think function every second which subtracts a second from it.

Don't mess with the server time Razz
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Fri Jun 11, 2010 12:19 pm    Post subject: Reply with quote

Or maybe a simple arithmetic: sv_timelimit - current time ?
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Fri Jun 11, 2010 5:18 pm    Post subject: Reply with quote

float gtime;

if (time == time +1);
{
gtime = gtime -1;
};

i havnt messed with .qc in a while but i think it would be something similar to this?
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Fri Jun 11, 2010 5:36 pm    Post subject: Reply with quote

ceriux wrote:
if (time == time +1);

Very Happy
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Fri Jun 11, 2010 6:53 pm    Post subject: Reply with quote

metlslime wrote:
ceriux wrote:
if (time == time +1);

Very Happy


Damn I LOL'd so loud my boss just stared at me Laughing
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Sat Jun 12, 2010 7:50 am    Post subject: Reply with quote

Code:

void (entity e, float m, float s) pqc_match_time =
{   
   local float msg_type;

   if (e == world)
      msg_type = MSG_ALL;
   else
   {
      msg_entity = e;
      msg_type = MSG_ONE;
   }

   WriteByte (msg_type, SVC_STUFFCMD);
   WriteByte (msg_type, 1);
   WriteByte (msg_type, PQC_MATCH_TIME);
   WriteBytePQ (msg_type, m);
   WriteBytePQ (msg_type, s);
   WriteString (msg_type, string_null);
};


this is what the quakeC side of pq_timer 1 looks like.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group