killLimits

Expand and mod your server.
Post Reply
User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

killLimits

Post by L4m3r »

Sorry about sitting on this one so long, I've been getting smashed by coursework.

From the readme:
killLimits are a plugin-based replacement for flag shot limits.
Rather than limit the number of shots a player can take with
the flag, this plugin limits how many kills are allowed before
the flag is zapped.

In addition to standard kill limit functionality, there is also
The ability to set relative kill limits. These are determined
by the number of players currently on the server.
This is version 1.0. I'm sure revisions will come.

Thanks to theme97 for testing help and suggestions.

Enjoy.
Attachments
killLimits_source.zip
Source
(14.55 KiB) Downloaded 469 times
killLimits_windows.zip
Windows binary
(15.47 KiB) Downloaded 458 times
killLimits_linux.zip
Linux binary
(19.45 KiB) Downloaded 420 times
Optimism is just a milder alternative to denial.
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Significant

Post by optic delusion »

A great way to level the playing field between newbs and pros, especially on FFA. Newbs can fire away with GM or Laser, at least until they get a few kills. Pros are forced to find a new flag, after only a few seconds of camping. Finally a way to measure Genocide's output.
Then you added a way to tie kill limits to total #players on the server. A nice refinement.
This is a significant plugin L4M3R!

You have documented nicely as well, with a read me and sample configuration file. I decided the best way to introduce servers and perhaps some players to your plugin, was to paste your read me file into this post. It explains the concept and application well, without a download.



killLimits BZFlag plug-in
By L4m3r
Release 5/16/06

INTRODUCTION:
killLimits are a plugin-based replacement for flag shot limits.
Rather than limit the number of shots a player can take with
the flag, this plugin limits how many kills are allowed before
the flag is zapped.

In addition to standard kill limit functionality, there is also
The ability to set relative kill limits. These are determined
by the number of players currently on the server.

USING THE PLUGIN:

1. Setting up a configuration file

The easiest way to configure the plugin is by using the
sample provided. It explains the basic usage and syntax
of each parameter. Save the file in a logical place.

2. Loading the plugin

Like any plugin, this can be loaded ingame or via your
BZFS configuration file. I recommend the latter, because
it's a lot easier. You will need to pass the path of the
configuration file to the plugin:

-loadplugin /bz/plugins/killLimits.so,/path/to/killLimits.conf

3. Relative kill limits

To set a relative kill limit, add "n" directly after the
number in the limit. This will make the plugin alter the
actual number based on how many players are present. It
can work one of two ways. By default, it will multiply
the number given by the total number of non-observer
players on the server. Alternatively, you can specify
-onlycountopponents in the plugin config file, and it
will only count that player's opponents.

4. Cumulative vs. Non-cumulative genocide limit

By default, a limit set with the Genocide flag will only
be decremented for a direct hit with a geno bullet. In
other words, the limit sets how many times a player may
"geno" another team. This can be changed by setting
-usetotalgenokills in the configuration file. When this
is used, the plugin will count total kills made as a
result of geno.

Keep in mind that one mode may be better for a particular
use. For instance, the easiest way to let a player get
one hit in with geno would be to use a "normal" geno
limit of 1.

BEHAVIOR NOTES:

The way this plug-in works is limited by the API, so it's a good
idea to know some specific details about how it works and what
it will do in certain situations.

First off, some details about relative kill limits. Internally,
the plugin fetches the limit and sets it when a player makes
his/her first kill with a flag. Thus, when it determines a relative
kill limit, it does so when the player makes the first kill. It
will NOT change as players enter or leave the server; it will only
change as the flag is picked up and used by someone else.

And, a set of "what happens when" questions and andswers...

Q: What happens when the kill limit is reached?"
A: The flag is zapped (it vanishes and reappears elsewhere).
-
Q: What happens when a player drops his flag before reaching the
flag's kill limit?
A: It is dropped like a normal flag- if it's used all of its
"grabs" or is over an uneven/drivethrough surface, it will
vanish. Otherwise, it will fall in place. (Read on)
-
Q: What happens when the player grabs that same flag again?
A: That depends. In most cases, the kill limit will just resume
counting down from where the player had left it. However, if
he/she made a kill in between the time the flag was dropped
and picked back up, the counter will be reset.
-
Q: What happens when someone drops a half-used flag and someone
else then grabs it?
A: The counter starts at 0. The player can make the full number of
kills.
-
Q: What happens when a player drops a flag and then grabs another
flag of the same type:
A: Same thing as if it were the same flag to begin with (above).
This is because the plugin distinguishes types, but not
individual flags.

I realize that this leaves a lot of holes to potentially cheat the
kill limit, but in most cases exploiting them would be inconvenient
or unlikely. Also, flags will not last forever- they will vanish on
their own eventually. You can make this happen more often by
decreasing flags' lifespans. Do that by setting the BZDB variable
_maxFlagGrabs to a lower value.

Unfortunately given the API it's the best I can do for now. Please
do not post workarounds or questions regarding workarounds in the
plugin's release thread or elsewhere on BZBB, because it will only
give players ideas. If you have a suggestion to improve the plugin
in this regard, please just send me a PM (BZBB or IRC is fine) and
we can go from there.


Have fun! :)
L4m3r
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
TheAdventMaster
Private First Class
Private First Class
Posts: 24
Joined: Sat Feb 11, 2006 2:19 am
Location: Away from Planet MoFo

Post by TheAdventMaster »

It looks great! Heheh! Nice one L4m3r.
I will live forever, or die trying.
Much to live for, but something to die for.
I'm a pirate. Live it up.
Jo-W
Private First Class
Private First Class
Posts: 26
Joined: Sat Oct 01, 2005 9:33 pm

Post by Jo-W »

Sounds great,
ofcourse another usefull feature would be time limits
I Carry ThA BiG GuN

Owner@localhost
User avatar
tw1sted
Private First Class
Private First Class
Posts: 849
Joined: Tue Feb 21, 2006 10:21 pm

Post by tw1sted »

Jo-W wrote:Sounds great,
ofcourse another usefull feature would be time limits
wow, good idea. l4m3r, you should start working on that one.. good work though
User avatar
G-MAN
Private First Class
Private First Class
Posts: 85
Joined: Fri Aug 05, 2005 10:12 pm
Location: Location, Location, Location. This house has it all.

Post by G-MAN »

This is a great way to conserve shots. If your a newb you don't waste the shots. Very well done L4m3r!
User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 809
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: killLimits

Post by allejo »

Updated to 2.4
Attachments
killLimits.cpp
BZFlag 2.4
(11.29 KiB) Downloaded 198 times
Post Reply