.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
CS time... special?
Old
  (#1)
Fierce Recon
Guest
 
Status:
Posts: n/a
Default CS time... special? - 11-01-2004

Is there anything special about gpGlobals->time in cs, because in a lot of plugins, i saw that they somehow used timelimit and timeleft...

If there's a difference could someone explain it to me?
  
Reply With Quote
Re: CS time... special?
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: CS time... special? - 11-01-2004

AFAIK, "timelimit" and "timeleft" don't exist in the Half-Life globalvars_t structure. These are variables that are computed out of gpGlobals->time. Let's say timelimit is the date at which the round will end, and timeleft is what it says.

Code:
// on round start
timelimit = gpGlobals->time + CVAR_GET_FLOAT ("mp_thecvarthatholdstheroundduration");
 
// anytime
timeleft = timelimit - gpGlobals->time;



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: CS time... special?
Old
  (#3)
Fierce Recon
Guest
 
Status:
Posts: n/a
Default Re: CS time... special? - 11-01-2004

so otherwise there's no change to gpGlobals->time that's done by mp.dll?

when i say timelimit and timeleft, i mean that they use cs cvars...

I noticed this in the amx, where OLO uses those 2 for timers, so I got a little confused, why not do
Code:
...
float last_ticked;
...
struct timer {
...
float waitleft;
float wait;
...
}
...
void timertick()
{
...
if (timer->waitleft - (gpGlobals->time - last_ticked) <= 0)
...
last_ticked = gpGlobals->time;
}
Instead of what he does (which just plainly scares me)
  
Reply With Quote
Re: CS time... special?
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: CS time... special? - 12-01-2004

What's the difference ? ???

gpGlobals->time is always different each frame, and it can't be "paused". I'm not sure I understand what you are doing here...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: CS time... special?
Old
  (#5)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: CS time... special? - 13-01-2004

mp_timelimit is in minutes by the way, and gpGlobals->time is in seconds, so you need to multiply mp_timelimit value by 60 first before comparing it with gpGlobals->time

  
Reply With Quote
Re: CS time... special?
Old
  (#6)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: CS time... special? - 13-01-2004

not all mods support mp_timelimit. DoD does not where TFC does. I do not know about other mods.

Your better off with timeleft = mp_timelimit - gpGlobals->time






  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com