Good flags timer

Need help seting up a server, or have a question on how to run one? This is the place.
Post Reply
MICH
Private First Class
Private First Class
Posts: 5
Joined: Sun Mar 10, 2013 7:43 pm

Good flags timer

Post by MICH »

Hello,
in bzfs configuration is an option to drop bad flags after defined time:
# Bad flags are automatically dropped after this many seconds.
-st 5

Is there any possibility to do the same with good flags?

I am planning to prepare small local tournament and I think that adding timer for both flags will be a nice option for the game balance.

Best regards
MICH
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Good flags timer

Post by blast »

There is a shot limit that you can set for each flag (-sl) and there is a kill limit plugin (that probably still needs to be updated to the 2.4 API). If you want an actual time delay, you'd have to write your own server plugin for that. I also don't think that you could make it show the countdown timer like it does for bad flags as that is likely hard-coded client behavior.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
MICH
Private First Class
Private First Class
Posts: 5
Joined: Sun Mar 10, 2013 7:43 pm

Re: Good flags timer

Post by MICH »

blast wrote:There is a shot limit that you can set for each flag (-sl)
I thought about this option, but it doesn't works for 'defensive flags' like narrow, cloak or high speed.
blast wrote:there is a kill limit plugin (that probably still needs to be updated to the 2.4 API)
Thanks, I will check this plugin.
blast wrote:If you want an actual time delay, you'd have to write your own server plugin for that. I also don't think that you could make it show the countdown timer like it does for bad flags as that is likely hard-coded client behavior.
It doesn't looks good. If it is true that client can't show timer for good flags I will have to prepare a special version of client.
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Good flags timer

Post by blast »

The timer is tied to the flag endurance being set to "FlagSticky", which means it cannot be dropped with the flag drop key. Making it possible to apply the countdown to good flags could get a bit involved, and would indeed need client modifications (just checked). This might impede your ability to get a tournament going as some players avoid using third party clients for fear of "evil things" (password theft, deleting files off their computer, etc). If you still want to go this route, I'd recommend working with some of the official developers (like myself) to get a client built, as it could then come from a trusted source. Also, you'd want to change the protocol version string so that stock clients don't see and can't join your custom game.

One easy solution would be to just have the server plugin send a chat message to the player, but that's certainly not as clean of a solution.

Also, for flag types that change the shot type, you could register new custom flags in your plugin with those shot types, but as bad flags.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
MICH
Private First Class
Private First Class
Posts: 5
Joined: Sun Mar 10, 2013 7:43 pm

Re: Good flags timer

Post by MICH »

Thanks for the comments.
You are right, custom client could be a problem during online phase (tournament will have online qualifications and LAN finals). Probably with this solution we will have more problems than profits.
In that case I will think deeply about flags with shot limit.
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Good flags timer

Post by blast »

Note that a plugin could still take away a flag after a period of time. It would just not be able to trigger the bad flag countdown timer.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Good flags timer

Post by joevano »

It could also "chat" at them I believe. Not as elegant, but it could be used for a primative countdown.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
MICH
Private First Class
Private First Class
Posts: 5
Joined: Sun Mar 10, 2013 7:43 pm

Re: Good flags timer

Post by MICH »

I understand that plugin with chat option will work quite the same as shot limit option, where player receive messages from a server?

Plugins are only for servers or clients have to install the same plugin?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Good flags timer

Post by JeffM »

Plugins are only on the server.
ImageJeffM
MICH
Private First Class
Private First Class
Posts: 5
Joined: Sun Mar 10, 2013 7:43 pm

Re: Good flags timer

Post by MICH »

Thanks,
I will try to write plugin.

Do you recommend tutorial by flying_popcorn http://forums.bzflag.org/viewtopic.php?f=78&t=13262 ?
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Good flags timer

Post by blast »

You could probably get a general idea from there, yes. However, based on the date, I'd imagine that is for 2.0 plugins, so some alterations would have to be made for the 2.4 API. There are quite a number of plugins that we include with the source, so you could read through their code. Additionally, there are wiki pages for this topic.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply