Page 1 of 1

UselessMine - Create mines with the Useless flag

Posted: Wed Mar 07, 2007 7:57 am
by Enigma
Included files: UselessMine.cpp, UselessMine.so (Mac PPC build), and README.txt.

You can get the plugin here: http://users.adelphia.net/~devin_d/bzfl ... ne.tar.bz2

To make this quick, here are the contents of the readme file:

Code: Select all

========================================================================
    DYNAMIC LINK LIBRARY : UselessMine Project Overview
========================================================================

The UselessMine plugin allows players to lay proximity mines within the map.  There are three different mine types: a shock wave mine, a mine that fires bullets in a spherical pattern , and a mine that fires bullets in a cylindrical pattern.  Typing /mine will print a usage message.  To set a mine in the map one would type /mine <mine> when he or she has the useless flag.  When a mine is set, the point where the user typed /mine is recorded and that person's flag is dropped.  If someone comes within the distance _shockOutRadius to that recorded point, the mine blows up (whoever set the mine cannot cause it to blow up).


========================================================================
NOTES
========================================================================

This plugin requires the Boost library to compile.  The Boost library is available at http://boost.org/, and is basically an extension to the C++ Standard Library.  After it is installed, you just have to add -I/path/to/boost/headers to CPPFLAGS in the makefile.  For instance, on my computer it is -I/usr/local/include/boost-1_33_1/.  You can, of course, change the code to not use boost at all.

Also, the mines are invisible.  I have not found a way to draw something that represents a mine, which is probably not possible.

========================================================================
KNOWN PROBLEMS
========================================================================

BzFlag only allows a limited number of shots to exists a once.  That number can be reached by using SphericalRegMine and CylindricalRegMine.  Thus, only one mine can blow up at once.
 
Sometimes BZFlag will create a shot with an id withing the range [kMineShotID, kMineShotIDMax], resulting in a call to sendMineDeathMessage(), which shouldn't be called.

========================================================================
POSSIBLE PROBLEMS
========================================================================

I'm not sure if the shock wave world weapon uses _shockOutRadius to control how big it is.
[edit]
Also, you shouldn't need to install Boost to use the .so I provided, since it was just a bunch of template code that was included. I used boost::array and boost::shared_ptr.

Also, the Mac build I provided will probably only work on Mac OS 10.3.9 and later. If I remember correctly, versions of Mac OS before 10.3.9 only included a static version of libstdc++; whereas, later versions of Mac OS include a static and dynamic libstdc++. I believe UselessMine.so was linked dynamically and should only work on Mac OS 10.3.9 and later, but don't hold me to this.
[/edit]

Here is a screenshot of one of the mines blowing up.

Posted: Wed Mar 07, 2007 9:01 am
by Grace F
Nice Job Slayer++

I always wondered what was going on everytime i got blown up with no-one around :P

so, i just type "/mine" to set a mine? or "/mine <type>"?

Posted: Wed Mar 07, 2007 9:21 am
by Enigma
Grace F wrote:
so, i just type "/mine" to set a mine? or "/mine <type>"?
You would type /mine <mine_type>, where type is one of these: sw, sr, or cr.

The naming convention I'm using for the mine types is very simple. The first character stands for the firing pattern, and the second character stands for the type of bullet; SR = Spherical pattern with Regular bullets, CR = Cylindrical pattern with Regular bullets, and SW, under this definition, means Spherical Wave (actually I used SW because if fires a shockwave and then made up spherical wave).
Grace F wrote: I always wondered what was going on everytime i got blown up with no-one around
:lol-old:

Posted: Wed Mar 07, 2007 11:02 am
by Grace F
oh ok :) Awesome ima do that right now! lol

Posted: Thu Mar 08, 2007 3:59 am
by Davy Jones
Awesome plug-in and i liked the testing, although you said there were three types, there are only two that you listed.....


Nice

Posted: Thu Mar 08, 2007 5:20 am
by blast
Davy Jones wrote:Awesome plug-in and i liked the testing, although you said there were three types, there are only two that you listed.....


Nice
He specifically listed all three types in both of his posts.

Posted: Thu Mar 08, 2007 5:31 pm
by CannonBallGuy
Slayer++
Great idea on the proximity aspect and the different mine types.

Quite a while back now, I asked Theme97 if he could make a US flag fire a SW when it was picked up - he wrote the plugin that evening and we played endlessly on a random map with tank speed at some ridiculous value.
We'd race across the map, often grabbing a US flag in the process - only we were travelling so fast the SW always fired behind us.

Still, this is a great improvement on the more basic version Theme wrote. :)

Posted: Sat May 26, 2007 1:29 am
by big_daddy2
can anyone make a windows version of this? i cant compile

Posted: Sat May 26, 2007 4:08 am
by Enigma
big_daddy2 wrote:can anyone make a windows version of this? i cant compile
The only difference between my plugin and other plugins is mine requires boost. If you haven't done so, you must either install boost or rewrite the plugin so that it does not use boost. To link to boost, I just added -I/opt/local/include to Minefield_la_CXXFLAGS in makefile.am, since that is where boost is installed on my system (I use macports).


BTW, it compiles fine for me. I wish I could help more, sorry.

I did a quick "make clean," and here is the plugin. It doesn't do anything more than the previous one; I just changed a few things, and separated it into multiple files.

Posted: Mon Jul 09, 2007 3:07 pm
by LeGeeko
>Enigma:

If I understand you correctly, the contents of your Minefield.tar are already compiled?

Posted: Tue Oct 09, 2007 11:25 pm
by Cruel dog
Could anyone make a LINUX release of that plugin? (.so) thanks!

Posted: Wed Oct 10, 2007 12:09 am
by macsforme
Cruel dog wrote:Could anyone make a LINUX release of that plugin? (.so) thanks!
Here's mine from my Ubuntu server... no idea if this will work on other distributions. Compiled with 2.0.10RC3. http://fairserve.net/const/UselessMine.so.gz.

EDIT: it also contains my modifications so that teammates cannot trip the mine.

Posted: Wed Nov 21, 2007 6:18 am
by optic delusion
Some possible memory leaks fixed by Thumper, tested against 2.0.10

Posted: Tue Dec 11, 2007 10:13 pm
by LeGeeko
Thanks Constitution.

Posted: Tue Dec 11, 2007 10:46 pm
by macsforme
LeGeeko wrote:Thanks Constitution.
Heh, no problem. :) Also note that ProximityMine (the next generation of UselessMine) has been released... see http://my.bzflag.org/bb/viewtopic.php?t=11828.

Posted: Tue Dec 11, 2007 10:59 pm
by LeGeeko
Er... I can't seem to load the plugin. I start a local (random-map) server, add flags, set the admin password, log on, and become admin. So far so good. When I type /loadplugin UselessMine.so, I get an "unknown command: /loadplugin UselessMine.so" error. I'm running BZFS 2.0.8 BTW.

Posted: Wed Dec 12, 2007 1:51 am
by F687/s
1. If you're on Windows, you can't load .so files.
2. Correct me if I'm wrong, but you need to enter the file's absolute path in order for it to work.
3. I'm also somewhat sure that you need to use --enable-shared in your BZFS for it to work. Try using the load-time -loadplugin /path/to/UselessMine.so command and see if that works. Using -d in your config also helps a lot.

Posted: Wed Dec 12, 2007 3:07 am
by AAA
F687/s wrote: 2. Correct me if I'm wrong, but you need to enter the file's absolute path in order for it to work.
Absolute paths work, but you can specify relative paths, relative to the current working directory bzfs is running in. My servers are run in a directory, with plugins, logs, recordings, and database/bans/configs in their own directories, so I can type "/loadplugin plugins/timedctf" for example.

Posted: Fri Dec 14, 2007 4:08 pm
by LeGeeko
Nevermind... I had been using a version of BZFS that was not compiled with plugin support. I have a newly compiled version that works now. Thanks anyway!

Posted: Wed Jan 16, 2008 9:43 pm
by Gears of War!
what "-" command in the conf would that be to make them able to set mines?

Posted: Wed Jan 16, 2008 10:25 pm
by F687/s
There is no config command. You have to set them all yourself, with the Useless flag.

Posted: Wed Jan 16, 2008 10:29 pm
by macsforme
Gears of War! wrote:what "-" command in the conf would that be to make them able to set mines?
First of all, this plugin is obselete... you should be using ProximityMine.

Use

Code: Select all

-loadplugin /path/to/UselessMine.so
More info: http://my.bzflag.org/w/Plug-ins

Re: UselessMine - Create mines with the Useless flag

Posted: Mon Jul 06, 2009 4:59 pm
by MATSTERMIND
can you post better detailed instructions?

Re: UselessMine - Create mines with the Useless flag

Posted: Mon Jul 06, 2009 8:11 pm
by blast
MATSTERMIND wrote:can you post better detailed instructions?
The information posted should be all you need.