Raised This Month: $ Target: $400
 0% 

all-player event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ajax
Veteran Member
Join Date: Jan 2005
Old 05-18-2005 , 13:04   all-player event
Reply With Quote #1

we need some way of running through all players in an event (or arbitrary client-triggered instance) which provides no player info. like @ round_end run a script (a stat-tracking script for example) on all players present. currently the best way to do this is to force all players to say something, but that's messy. sounds like a job for crevette, if you ask me ;)

if Mattie can't work this into ES somehow, does anyone have any ideas?

anyone know what the max userid# is? is there a limit? what happens when you exceed that limit? i could try a brute force approach, but that's not ideal.
ajax is offline
awuh0
Senior Member
Join Date: Apr 2005
Location: /dev/null
Old 05-18-2005 , 14:18  
Reply With Quote #2

no limit to userid's... they just keep incrementing untill your server is restarted.... as far as I know
awuh0 is offline
Send a message via ICQ to awuh0 Send a message via AIM to awuh0 Send a message via MSN to awuh0
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-18-2005 , 16:57  
Reply With Quote #3

Sounds like a good idea for a script pack.
__________________
ichthys is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 05-18-2005 , 17:26  
Reply With Quote #4

A thing like that is planned, a custom event, maybe Mattie can explain it to you, because i cant. ^^ (shhh its a secret)


Quote:
anyone know what the max userid# is? is there a limit? what happens when you exceed that limit? i could try a brute force approach, but that's not ideal.
I think its 64 for Css and Dod, 32 for others :
(but i never see >58 slots server...)

Code:
//===================================================================================================================
// Player Defines

// Max number of players in a game ( see const.h for ABSOLUTE_PLAYER_LIMIT (256 ) )
// The Source engine is really designed for 32 or less players.  If you raise this number above 32, you better know what you are doing
//  and have a good answer for a bunch of perf question related to player simulation, thinking logic, tracelines, networking overhead, etc.
// But if you are brave or are doing something interesting, go for it...   ywb 9/22/03
#if defined( CSTRIKE_DLL ) || defined( DOD_DLL )
	#define MAX_PLAYERS				64  // Absolute max players supported
#else
	#define MAX_PLAYERS				32  // Absolute max players supported
#endif
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-18-2005 , 17:53  
Reply With Quote #5

Something like this is on the feature list, but it's not planned soon. I've been trying to decide the most elegant way to support this.

I'm just brainstorming out loud, so don't start throwing rotten tomatoes.

Maybe we could build up a large server_var with all the userids.

For instance, in server.cfg:
Code:
es_setinfo execlist ""
In player_activate:
Code:
es_setinfo tempstring 0
es_format tempstring "ma_slap %1;" event_var(userid)
es_format execlist "%1%2" server_var(execlist) server_var(tempstring)
And then on round_end.cfg:
Code:
es alias endround server_var(tempstring)
endround
It seems like this would work for any case where you're okay if the command fails due to a userid being absent. I have no idea what the size limit is for a server variable.

Ooo... this thought exercise has given me some ideas for how to implement a linked-list and maybe even a stack in cfg files with EventScripts v0.7.6.1. Hmmmm...

Anyway, I'll keep thinking about this,
-Mattie
Mattie is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-18-2005 , 18:11  
Reply With Quote #6

Actually, this technique could be pretty handy for some things:

Code:
// server.cfg
es_setinfo tail 0
alias aliaschain aliaschain_0
alias aliaschain_0 ""
Code:
// whatever.cfg
es_setinfo aliasname 0
es_setinfo aliastailname 0
es_setinfo aliasinfo 0
// add something to the alias chain
es_format aliasname "aliaschain_%1" server_var(tail)
incrementvar tail 0 9999 1
es_format aliastailname "aliaschain_%1" server_var(tail)
// zero out the last alias in the chain
es alias server_var(aliastailname) ""
es_format aliasinfo "es_msg Whatever I wanna do;%1" server_var(aliastailname)
// this next line might not work right because of quoting issues
es alias server_var(aliasname) server_var(aliasinfo)
And then whenever you want to execute the chain of alias commands (i.e. your function), you just type "aliaschain". Interestingly, this could give you the ability to do lots and lots of cool things. Gotos, For Loops, etc.

I might write a utility .cfg file (sorta like IsGreaterThan.cfg) that takes advantage of this and hides a little of the complexity.

-Mattie
Mattie is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 05-18-2005 , 18:35  
Reply With Quote #7

Quote:
Originally Posted by Cr3V3TT3
Quote:
anyone know what the max userid# is? is there a limit? what happens when you exceed that limit? i could try a brute force approach, but that's not ideal.
I think its 64 for Css and Dod, 32 for others :
(but i never see >58 slots server...)

Code:
//===================================================================================================================
// Player Defines

// Max number of players in a game ( see const.h for ABSOLUTE_PLAYER_LIMIT (256 ) )
// The Source engine is really designed for 32 or less players.  If you raise this number above 32, you better know what you are doing
//  and have a good answer for a bunch of perf question related to player simulation, thinking logic, tracelines, networking overhead, etc.
// But if you are brave or are doing something interesting, go for it...   ywb 9/22/03
#if defined( CSTRIKE_DLL ) || defined( DOD_DLL )
	#define MAX_PLAYERS				64  // Absolute max players supported
#else
	#define MAX_PLAYERS				32  // Absolute max players supported
#endif
you are correct for max imum number of players. however userid#s just keep going as far as i can tell. do this test on an empty server...
Code:
bot_quota 30
bot_kick
bot_quota 30
bot kick
bot_quota 30
<etc...>
status
when you enter status you'll see the userid#s. i tested it up past 256 before stopping.

Mattie, i'll have to mull over some of your suggestions and get back to you.
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-18-2005 , 19:06  
Reply With Quote #8

Yeah, me too.
__________________
ichthys is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-18-2005 , 22:41  
Reply With Quote #9

Just went to write this script and I thought about something. There would be 2 ways to do this. To count total players and keep track of them in some sort of "array", more like collection of cvars using player_connect and player_disconnect. Then, you could also very easily keep track of alive players using player_spawn and player_death.
So this is what i'll be trying to get together soon.

Okay, so what i think i'll do now. (Was just browsing the forums) How about a player tracking script! Tracks team connects, disconnects, spawns, deaths, team, kill count.

Lets hope it works.
__________________
ichthys is offline
Reply



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


All times are GMT -4. The time now is 16:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode