.:: 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 > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#21)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 16-02-2004

Quote:
Originally Posted by Pierre-Marie Baty
Regarding ServerActivate(), yes, it is called everytime a new map boots in. Actually a new map means a new server ; each time you change level (even in single player with level transitions), or force a level restart, in whatever manner you want, you will force a call to ServerDeactivate() immediately after the last StartFrame() in which the command was triggered, and a call to ServerActivate() immediately before the first StartFrame() of the new map.

<facultative>
Why I'm reluctant to using HLTV messages is that HLTV is an "external" application using a not-so-well defined protocol, that changes very often. And the purpose of HLTV messages is not for notifying players of a round change, actually if this code is specific to a round change in CS it's pure coincidence ; and on the contrary, notifying clients of a change in the round timer is exactly the point of RoundTime messages...
</facultative>
I see your points, but in my case I need to know about round starts no matter if there are players in game or not, so my options are limited to those that do not depend on players being in the game.

I do think that HLTV would need to know about round starts even if there are no players in the game - no?


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#22)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 16-02-2004

If you're looking for round events try looking in pfnAlertMessage.

The at_logged event should have something like...
"world" triggered "Round_Start", ect.

Unfortunately, the site that hosted information about logs and the standard format is gone so I'm going by memory on this.
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#23)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

Quote:
Originally Posted by Lazy
If you're looking for round events try looking in pfnAlertMessage.

The at_logged event should have something like...
"world" triggered "Round_Start", ect.

Unfortunately, the site that hosted information about logs and the standard format is gone so I'm going by memory on this.
The log message looks like this:
L 01/01/2004 - 01:25:55: World triggered "Round_Start"

You can also look for this one:
L 01/01/2004 - 01:25:55: World triggered "Game_Commencing"

and this
L 01/01/2004 - 01:26:21: World triggered "Round_End"

Thanks Lazy for this idea


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#24)
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: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

It works ! I side with this method too.

If you're interested I have updated my PMTools plugin to make it hook pfnAlertMessage()s and send them directly on the listenserver's HUD.



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: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#25)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

Quote:
Originally Posted by Pierre-Marie Baty
It works ! I side with this method too.

If you're interested I have updated my PMTools plugin to make it hook pfnAlertMessage()s and send them directly on the listenserver's HUD.
Looks like a simple and reliable method. I'll give it a try. Will get the updated PMTools of course - can't live without it


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#26)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

That's funny, I always thought that you're aware of this message and simply don't reply upon it because of some timing issues :-)
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#27)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

Bah! I'm back with the HLTV method. Take a look at this test log.

Code:
00:42:00 2004 :: World triggered "Round_End"
00:42:05 2004 :: THE ROUND HAS REALLY STARTED 
00:42:12 2004 :: World triggered "Round_Start"
Look at the times above, the "Round_End" pfnAlertMessage happens just before the round really ends. It is issued as soon as the round timer goes to zero, but the round does not switch to a new round until about 5 seconds afterwards. The pfnAlertMessage "Round_Start" does not happen until the countdown delay completes. In other words, it gets issued a few seconds after the round really starts (the delay is 7 seconds in the example).

This may work fine for other people, but it is no good to me as I need to know exactly when a round really starts.

*edit*

Quote:
That's funny, I always thought that you're aware of this message and simply don't reply upon it because of some timing issues :-)
LOL just saw your message after I posted - yes, this is funny because I can't use it because of the timing issues!

*edit*

FYI: the Round_End message gets sent only when a round times out. It will not get sent if the round is cut short by other means.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut

Last edited by botmeister; 17-02-2004 at 10:07..
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#28)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

The Round_Start message is send when the "freezetime" is over? In that case you could use for other purposes :-)
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#29)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

OK, I've finally settled on a solution that works great for me. For those who are interested, I've done the following:

1. Hook onto pfnServerActivate. This tells me when a new round has starting after a map load. I set a bool flag indicating that a round is just about to start: RoundStart = true;

2. Hook onto message "HLTV". If the two bytes in the message are both zero, then this tells me a round has just started. RoundStart = true; Note: This message is sent ONLY after a round is ended and at the same time the new round has started - there's no delay between the message and the start of the new round. It will get sent no matter how the round has been ended, and not just when the round times out.

3. Optional: Hook onto pfnStartFrame
Code:
If (RoundStart) 
{ 
	RoundStart = false;
	// round has started - do whatever is needed; 
 
}
This hook is optional because you could simply activate your round_start code in both the "HLTV" message hook, and in the pfnServerActivate hook.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut

Last edited by botmeister; 17-02-2004 at 22:15..
  
Reply With Quote
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#30)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

Quote:
Originally Posted by botmeister
OK, I've finally settled on a solution that works great for me. For those who are interested, I've done the following:
Clean!
Cool!

Botmesiter, you said:
"Hook onto message "HLTV". If the two bytes in the message are both zero, "

Could you please post some sample code on how to do this?
Thanks...

Last edited by Austin; 19-02-2004 at 23:58..
  
Reply With Quote
Reply


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

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