Progressive Flag Mode, NOT Python!

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Progressive Flag Mode, NOT Python!

Post by Theme97 »

It still needs more testing and will be configurable in the future.
However, here is the source in all of it's Beta glory.

Compiled versions and more info about the plug-in to be posted tomorrow.
Attachments
progFlag.cpp
Progressive Flag Mode Plug-in
(6.07 KiB) Downloaded 395 times
Image
pyr0
Private First Class
Private First Class
Posts: 144
Joined: Wed Jul 13, 2005 5:08 pm

Post by pyr0 »

looks pretty, i wont run it since i dont have a server and happen to be too lazy to set one up on OL, but all the same, the code looks pretty :)
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 »

Alrighty, much work has been done on it. Here is the current README.

Code: Select all

#################################
# Progressive Flag Mode Plug-in #
#       Idea By: A-Delusion     #
#    Written By: Theme97        #
#################################

Progressive Flag Mode is a plug-in which allows players to progress levels by killing, rewarding
them with flags. If a player teamkills, their level drops to -1. If the player is already below -1,
the plug-in will move them further down (-2). If the configuration specifies more than one flag to
give to a player, the plug-in picks a flag randomly from the list. Below is a list of options for
the plug-in:



+++ addlevel +++
"addlevel" is used to add a level with a specified number of kills. It accepts at least one
parameter, which is the number of kills needed to reach the level. An internal counter determines
the number of the level you are adding. "addlevel" accepts more than one parameter - you can add a
list of flags to it instead of using "addflag".
  ************************************************************************************************
  * =addlevel 2 # Adds level 1. To get to level one from level zero, you need to kill two times. *
  * =addlevel 1 # Adds level 2. To get to level two from level one, you need to kill one time.   *
  * =addlevel 4 GM # Adds level 3, four kills after level two, rewarding the player with a GM.   *
  ************************************************************************************************

+++ addflag +++
"addflag" accepts at least two parameters - the first is the level at which you are adding the flag
to, and the second (or more) is a list of flags to add. If you add a flag to a level that does not
exist yet (never added or added later in the conf), the plug-in will issue an error and it will be
skipped.
  *******************************************************************************************
  * =addflag -1 JM # Punish teamkillers with the Jamming flag.                              *
  * =addflag 0 US  # Give players US on spawn.                                              *
  * =addlevel 1    # Add level 1, 1 kill after level 0.                                     *
  * =addflag 1 L   # Reward players with Laser at level 1.                                  *
  * =addflag 2 GM  # This will bring up an error, since level 2 has not been specified yet. *
  * =addlevel 1    # Here's level 2! We should stick "=addflag 2 GM" after this line.       *
  *******************************************************************************************

+++ tk +++
Normally, the plug-in doesn't give the level -1 flag to a person who teamkills because the conf for
bzfs might not have the -tk option. However, if it does, you must specify "tk" in the plug-in conf
to let the plug-in know to give the level -1 flag to the teamkiller.

+++ message1, message2, message3, message4 +++
On a spawn or a kill, the server messages you telling you your current level, new flag (if you went
up a level), and the number of kills until the next level. It, by default, looks like this:
(Not Last Level :    New Flag) Level 1: Shield (1 kill until level 2)
(Not Last Level : No New Flag) Level 1 (1 kill until level 2)
(    Last Level :    New Flag) Level 8: Wings (Pwnage!)
(    Last Level : No New Flag) Level 8 (Still pwning!)
If you want to change the messages, you may use "message1" to change the first line listed above,
"message2" to change the second line above, and so on. The plug-in will replace the following:
%level%   The user's level.
%flag%    The user's flag.
%kills%   Number of kills until next level.
%s%       Plurality: "1 kill until level 2" or "2 kills until level 2".
%nextlev% Equal to %level% + 1.
Note: I have not tested putting each one of the values in the wrong spot (as in, putting %flag% in
"message2", or %kills% in "message3"), so if anything wrong happens, please let me know.
  *****************************************************************
  * =message1 L%level% :: %flag% :: %kills% kill%s% to L%nextlev% *
  * =message2 L%level% :: %kills% kill%s% to L%nextlev%           *
  *****************************************************************

+++ rogue +++
Use this option if you want Rogues killing other Rogues to count as a teamkill.
(This option won't be used that much, I might end up killing it in later versions.)
Still needs work. hmm...
Image
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 »

Here are a couple of example configurations.

This is what A-Delusion currently (as of the time of this post) uses:

Code: Select all

=addflag -1 B BY JM O RC RO TR WA
=addlevel 1 F
=addlevel 1 A QT V
=addlevel 1 SH SR
=addlevel 1 IB MG
=addlevel 1 N T
=addlevel 1 BU CL SB SW
=addlevel 1 ST
=addlevel 1 GM
=addlevel 1 L
=addlevel 1 WG
This is what I use, I call it the "superflags" scheme:

Code: Select all

=tk
=addlevel 1
=addflag 1 SW
=addlevel 2
=addflag 2 N ST T
=addlevel 3
=addflag 3 F MG
=addlevel 4
=addflag 4 GM
=addlevel 5
=addflag 5 L
=addlevel 6
=addflag 6 WG
Image
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

After a fitful startup this afternoon, a few slight changes were made, and now this plugin appears almost ready for release.
It ran for nine hours with lots of players and it seems a change in the way the delay timer works, (a player makes a kill, and there is a half-second delay before they receive their upgraded flag) has eliminated wrong-end-shot kicks and flag mismatch kicks.
I see a little bit of shot over-speed in the logs, but that can be attributed to other fast weapon settings I use. In fact... at different times I used tankSpeed 45, and raised other weapon speeds even faster than my usual over-speed settings, so if it ran with my settings, there should be no problem on a server with "normal" speed settings.
We tested rogues, the rogue teamkill setting is configurable, now.
It has NOT been tested on a CTF map. I'm not sure we are going to test that, either.

It actually operates somewhat as a cross between a no-flag server, and a with-flag server, because at any one time, half the players have a useless flag. I can see strategies for the shield flag evolving too.
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.
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 »

A-Delusion wrote:it seems a change in the way the delay timer works, (a player makes a kill, and there is a half-second delay before they receive their upgraded flag) has eliminated wrong-end-shot kicks and flag mismatch kicks.
Until someone can point out how to get miliseconds in a timer... well... I'm gonna have to stick to 25 ticks. :(
A-Delusion wrote:It has NOT been tested on a CTF map. I'm not sure we are going to test that, either.
Actually, I have to disable flag-giving to people who are zoned (or just have PZ if I can't figure that out) or have a team flag. People with OO are not given flags at the moment.
A-Delusion wrote:It actually operates somewhat as a cross between a no-flag server, and a with-flag server...
Well, if you have a flag cage, then it's somewhat as a cross, but without a cage... The game wouldn't work out. ;)
A-Delusion wrote:... because at any one time, half the players have a useless flag. I can see strategies for the shield flag evolving too.
Ah, but this is your configuration. My "superflag" configuration doesn't give any flags below level 1, all the flags are SUPER flags, and it's quite challenging (thus, fun :P)
Image
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

Oh, i thought you said you had changed the timer... I suggest adding 3 or 4 more ticks. It's almost there...

http://my.bzflag.org/bb/viewtopic.php?p=87811#87811
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.
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

Why not give a flag on bz_ePlayerDieEvent?
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 »

A Meteorite wrote:Why not give a flag on bz_ePlayerDieEvent?
Shot mismatch kick.
Image
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

Theme97 wrote:
A Meteorite wrote:Why not give a flag on bz_ePlayerDieEvent?
Shot mismatch kick.
Would sleeping for a few milliseconds do much harm to bzfs' loop? :)
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

the zone obj

Post by optic delusion »

Zones required, add them to the read me please.

# Progressive Flags plugin requires certain options in your .conf, and objects in your map.
# You need to specify a "flag jail" that is unreachable by tanks and,
# of course, have the flags specified in your .conf.
# you'll need about one of each flag for every two players, on the lowest flag levels
# on the higher levels... not so many.
# up to a maximum of 250 total flags, good and bad
# the array technically holds 255. make no more than 250 to be safe.

box
name goodbox
size 10 0 1
position 0 0 150
end

zone
name goodzone # thief, seer removed to allow them on the floor
size 9 9 1
position 0 0 151
flag A BU CL F G GM IB L MG N OO PZ QT SH SR ST SB SW T US V WG # TH SE
end


box
name badbox
size 130 30 0 1
position 20 20 150
end

zone
name badzone
size 9 9 1
position 30 30 151
flag BY TR B TR CB FO JM LT M NJ O RC RO RT WA
end
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.
Theme97
Private First Class
Private First Class
Posts: 221
Joined: Fri Nov 11, 2005 8:04 pm
Contact:

Post by Theme97 »

A Meteorite wrote:
Theme97 wrote:
A Meteorite wrote:Why not give a flag on bz_ePlayerDieEvent?
Shot mismatch kick.
Would sleeping for a few milliseconds do much harm to bzfs' loop? :)
When I tried it, sleeping caused a segfault. I think I did something wrong, but, still.

A =delay option has been added. If you mod your BZFS to not do shot mismatch checking, you can set =delay 0 and it won't delay.
Image
Post Reply