UselessMine - Create mines with the Useless flag

Expand and mod your server.
Post Reply
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

UselessMine - Create mines with the Useless flag

Post 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.
Attachments
bzfi0059.png
(312.14 KiB) Downloaded 604 times
Last edited by Enigma on Wed Mar 07, 2007 9:52 am, edited 1 time in total.
User avatar
Grace F
Sergeant
Sergeant
Posts: 978
Joined: Sun Oct 01, 2006 12:29 pm
Location: Adelaide, AUSTRALIA

Post 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>"?
Image
Image
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Post 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:
User avatar
Grace F
Sergeant
Sergeant
Posts: 978
Joined: Sun Oct 01, 2006 12:29 pm
Location: Adelaide, AUSTRALIA

Post by Grace F »

oh ok :) Awesome ima do that right now! lol
Image
Image
User avatar
Davy Jones
Private First Class
Private First Class
Posts: 297
Joined: Thu Jan 04, 2007 4:39 am
Location: Davy Jone's Locker

Post 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
Owner @ The Twin Towers
Admin @ The Two Boxes
Cop @ Army Of One
Image
Image
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post 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.
"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
CannonBallGuy
Private First Class
Private First Class
Posts: 2083
Joined: Wed Apr 12, 2006 1:31 am
Contact:

Post 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. :)
Image

Merry Christmas!

"Look, if I don't buy booze for the kids, I don't get any incriminating pictures to show to their parents, my business goes down the sink, my girlfriend leaves me and the baby goes on ebay. So help me search..."

"go Play With Toys urself in a dark alley u donkey ******" - Lt-Kirby2007
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

Post by big_daddy2 »

can anyone make a windows version of this? i cant compile
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Post 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.
Attachments
Minefield.tar
(160 KiB) Downloaded 684 times
User avatar
LeGeeko
Private First Class
Private First Class
Posts: 21
Joined: Wed Jun 27, 2007 6:36 pm

Post by LeGeeko »

>Enigma:

If I understand you correctly, the contents of your Minefield.tar are already compiled?
People call me insane. :twisted:

I take it as a compliment. :wink:

I mean, what fun would life be if I wasn't? :)
User avatar
Cruel dog
Private First Class
Private First Class
Posts: 173
Joined: Sat Jul 16, 2005 9:32 pm
Location: Québec province, Canada
Contact:

Post by Cruel dog »

Could anyone make a LINUX release of that plugin? (.so) thanks!
Owner@ BZAddict.net
Admin @ bunch of servers
And much more!
"Even if I am named Cruel dog, I still am friendly! I just become Cruel with troublemakers! xD"
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post 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.
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

Some possible memory leaks fixed by Thumper, tested against 2.0.10
Attachments
UselessMine.zip
(7.38 KiB) Downloaded 538 times
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
LeGeeko
Private First Class
Private First Class
Posts: 21
Joined: Wed Jun 27, 2007 6:36 pm

Post by LeGeeko »

Thanks Constitution.
People call me insane. :twisted:

I take it as a compliment. :wink:

I mean, what fun would life be if I wasn't? :)
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post 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.
User avatar
LeGeeko
Private First Class
Private First Class
Posts: 21
Joined: Wed Jun 27, 2007 6:36 pm

Post 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.
People call me insane. :twisted:

I take it as a compliment. :wink:

I mean, what fun would life be if I wasn't? :)
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post 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.
User avatar
AAA
Private First Class
Private First Class
Posts: 79
Joined: Sat Aug 07, 2004 3:36 pm
Contact:

Post 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.
Admin and Senior Vice Executive Administrator of Network and System Architecture @ BZFX -- Core Admin @ CAN -- SF.net user diamondmagic -- irc.freenode.net nickname AAA_awright (#bzfx if not #bzflag)
User avatar
LeGeeko
Private First Class
Private First Class
Posts: 21
Joined: Wed Jun 27, 2007 6:36 pm

Post 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!
People call me insane. :twisted:

I take it as a compliment. :wink:

I mean, what fun would life be if I wasn't? :)
User avatar
Gears of War!
Private
Private
Posts: 3
Joined: Mon Jul 02, 2007 6:07 pm

Post by Gears of War! »

what "-" command in the conf would that be to make them able to set mines?
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post by F687/s »

There is no config command. You have to set them all yourself, with the Useless flag.
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post 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
MATSTERMIND
Private
Private
Posts: 4
Joined: Wed Jun 24, 2009 3:32 pm

Re: UselessMine - Create mines with the Useless flag

Post by MATSTERMIND »

can you post better detailed instructions?
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: UselessMine - Create mines with the Useless flag

Post by blast »

MATSTERMIND wrote:can you post better detailed instructions?
The information posted should be all you need.
"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