Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Backwards running clock?

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Fri Jun 11, 2010 2:50 am Post subject: Backwards running clock? |

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 |

Urre Joined: 05 Nov 2004 Posts: 1073 Location: Sweden |

Posted: Fri Jun 11, 2010 11:24 am Post subject: |

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 _________________
Look out for Twigboy

Back to top |

frag.machine Joined: 25 Nov 2006 Posts: 728 |

Posted: Fri Jun 11, 2010 12:19 pm Post subject: |

Or maybe a simple arithmetic: sv_timelimit - current time ? _________________ frag.machine - Q2K4 Project http://fragmachine.quakedev.com/

Back to top |

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

Posted: Fri Jun 11, 2010 5:18 pm Post subject: |

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 |

metlslime Joined: 05 Feb 2008 Posts: 177 |

Posted: Fri Jun 11, 2010 5:36 pm Post subject: |

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

Back to top |

frag.machine Joined: 25 Nov 2006 Posts: 728 |

Posted: Fri Jun 11, 2010 6:53 pm Post subject: |

metlslime wrote:

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

Damn I LOL'd so loud my boss just stared at me
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Sat Jun 12, 2010 7:50 am Post subject: |

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 |

Display posts from previous:

| 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