Here is a plugin derived from trepan's for the 2.4.X servers. It is mostly a template for usage in further plugins.
What it does: Lets you send a Set Variable message to an individual client/player. This means that everyone can have a different set of variables running on their client! This opens up the possibility for many things, including player handicaps based on score (Slow down or speed up tanks), different bullet speeds. on a per player basis, along with even different effects showing up per player (Want the red team to see a red sky while the blue team sees a blue one?) Many new venues open up with the ability to change everyone's variables to a different set!
I would like to also mention how useful this could be for future custom flags. Give a flag that actually does slow tanks down, speed them up, faster/slower reloads, momentum, and more!
There is a limitation you have to keep in mind, the client actually sees the new variables with each change to them, but they aren't applied immediately. That is what is actually happening. So say we tried giving everyone different _shockOutRadius values. This won't work, since the shots look at what the current _shockOutRadius value is, and since it changes, it will be the same for everyone anyways. But values such as _tankSpeed, _tankAngVel, _wingsJumpCount, _friction, _skyColor, _radarLimit, and so on are only set when they are triggered by a variable modification notice. At least that is my understanding, so those can be set on a per-client basis. You can experiment to see which combinations work. There may be more fun hidden things I haven't found yet.
Enjoy, hope everyone finds it useful in some way or form or shape!
Below is a plugin sample showing how the skyColor is set to one of 5 picked colors whenever a player joins, so everyone sees a different color! Take this power and warp to your will!
You'll need bzfs.h to compile this, which brings up a few other dependencies you will need. They all come from the src/bzfs folder, so if you really want to, just take all those header file suckers and put them in the include/ directory before compile and you should be set.
Prototypes for the function are:
Code: Select all
sendPlayerBZDB(int playerID,string variable,string value);
sendPlayerBZDB(int playerID,string variable,float value);
Here is a screenshot showing two clients on the same server playing with different sky colors:
Released under the Public Domain, do what you will with it and harness the powers of variable changing! You can expect some very interesting things from me with this in the future.
[EDIT]: Thanks to blast for clarifying that the plugin is not able to be compiled with Windows due to its external dependencies outside of the BZFlag API. This had to be used in order to overcome such a feature.