flagOnSpawn

Expand and mod your server.
Post Reply
User avatar
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

flagOnSpawn

Post by macsforme » Sun Oct 29, 2006 6:39 am

Author: Constitution
Description: Automatically gives tanks superflags upon spawn
Min Version: 2.0.8 (may work with earlier versions, but has not been tested)

This plugin gives superflags to tanks based on arguments specified when the plugin is loaded. Any configuration of teams/flag types is supported. The loading syntax is:

Code: Select all

/loadplugin /path/to/flagOnSpawn.so,FLAGID:TEAM[:FLAGID:TEAM][:FLAGID:TEAM]...
See the readme in the source zip for more detailed instructions. Bug reports and suggestions should be posted here. Enjoy!

Nov. 21, 2007
Updated to version 1.1. Thanks to Optic Delusion for the null pointer dereference fix.
Last edited by macsforme on Wed Nov 21, 2007 9:32 pm, edited 1 time in total.

User avatar
CannonBallGuy
Private First Class
Private First Class
Posts: 2083
Joined: Wed Apr 12, 2006 1:31 am
Contact:

Post by CannonBallGuy » Sun Oct 29, 2006 12:11 pm

L4m3r has already created this plugin, see: http://my.bzflag.org/bb/viewtopic.php?t=7401
Though I guess he never released it, so, nic work Constitution!
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
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Sun Oct 29, 2006 5:51 pm

CannonBallGuy wrote:L4m3r has already created this plugin, see: http://my.bzflag.org/bb/viewtopic.php?t=7401
Though I guess he never released it, so, nic work Constitution!
Yes, I made this plugin before the flag give function was even added to the API. ;) But I never added configureability or anything, which is why I didn't bother with a release.
Optimism is just a milder alternative to denial.

User avatar
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Sun Oct 29, 2006 8:49 pm

L4m3r wrote:But I never added configureability or anything, which is why I didn't bother with a release.
Yeah, this doesn't surprise me. It serves a fairly simple task, but I sought to make this as useful as possible within the simple functionality that it offers. Anyway, this will allow people to give specific teams specific flags, which could be useful. I won't claim that this is a novel idea... but at least this plugin should make this functionality easy for the public to use.

User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post by L4m3r » Sun Oct 29, 2006 10:58 pm

Constitution wrote:Yeah, this doesn't surprise me. It serves a fairly simple task, but I sought to make this as useful as possible within the simple functionality that it offers. Anyway, this will allow people to give specific teams specific flags, which could be useful. I won't claim that this is a novel idea... but at least this plugin should make this functionality easy for the public to use.
Yeah, I don't think I ever put it to practical use on a server... it was only for test purposes when I adapted /flag give to the API.

It does have some play possibilities, but in most cases the giving scheme needs to be more complex.
Optimism is just a milder alternative to denial.

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Mon Oct 30, 2006 11:20 pm

uh, oh! I'm having difficulty in getting this to work.
I'm running Fedora Core 5 and the latest version of bzflag.
In my configuration file, I used:

-loadplugin /home/ck/flagOnSpawn.so,V:-1:G:0

I got no errors upon starting the server, but I couldn't spawn with a flag, either.
Am doing something wrong?
Image

User avatar
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Tue Oct 31, 2006 1:36 am

Ck_asdf wrote:uh, oh! I'm having difficulty in getting this to work.
I'm running Fedora Core 5 and the latest version of bzflag.
In my configuration file, I used:

-loadplugin /home/ck/flagOnSpawn.so,V:-1:G:0

I got no errors upon starting the server, but I couldn't spawn with a flag, either.
Am doing something wrong?
Are you using the binary, or building from source?

Do /listplugins to be sure that the plugin is actually loaded. Enable debug level 4 (with '-d -d -d -d'), and check the output where it mentions flagOnSpawn. There also may be a problem with the flags... be sure to use +f V{number} and +f G{number} to ensure that those flags will be available to give to players. Also try using "/loadplugin /home/ck/flagOnSpawn.so,V:-1:G:0" as a server command during the game, and see if it spits out any errors.

If you still have problems... maybe post your complete config file, and the complete output of '-d -d -d -d'?

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Tue Oct 31, 2006 4:11 am

"Are you using the binary, or building from source?"
I'm using the second download provided in the original post, which is a zipped .so file.

" /listplugins "
While in the server?

"Enable debug level 4 (with '-d -d -d -d'), and check the output"
Where is the output going to end up?

"ensure that those flags will be available"
Yeah, I have 5 high speed & 2 Geno flags.

"try using "/loadplugin /home/ck/flagOnSpawn.so,V:-1:G:0" during the game"
Yeah, it told me "unknown command" here, as well as when I typed "/listplugins" while in the game.

"post your configuration file"
I've linked it to keep things tidy in here:
http://random.id.googlepages.com/ck.txt
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 » Wed Nov 01, 2006 12:11 am

Ck_asdf wrote:" /listplugins "
While in the server?
Yes.
Ck_asdf wrote:"Enable debug level 4 (with '-d -d -d -d'), and check the output"
Where is the output going to end up?
In the terminal (or log if you have one).
Ck_asdf wrote:"try using "/loadplugin /home/ck/flagOnSpawn.so,V:-1:G:0" during the game"
Yeah, it told me "unknown command" here, as well as when I typed "/listplugins" while in the game.
That's the problem, if it tells you it's an unknown command when you do those, you do not have plugin support. You need to compile with the "--enable-shared" and "--enable-plugins" configure switches or get a binary with plugin support.
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Wed Nov 01, 2006 4:09 am

"you do not have plugin support."
That sucks - how come the linux version doesn't come with it automatically? Windows does...

"You need to compile"
Eh ... I'm still new to linux ... not sure how to compile apps.

"get a binary with plugin support."
Where can I find that?
Image

User avatar
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Thu Nov 02, 2006 2:05 am

Ck_asdf wrote: "You need to compile"
Eh ... I'm still new to linux ... not sure how to compile apps.
If all of your development tools are installed (e.g. compiler, autotools, etc)...

1. Uninstall your current bzflag package. Not sure how the package manager for Fedora Core works... perhaps "apt-get remove bzflag"?
2. Download the current bzflag source code:

Code: Select all

cvs -d:pserver:anonymous@bzflag.cvs.sourceforge.net:/cvsroot/bzflag login
(Hit enter when prompted for a password)

Code: Select all

cvs -z3 -d:pserver:anonymous@bzflag.cvs.sourceforge.net:/cvsroot/bzflag co -P -r v2_0branch bzflag
Your "bzflag" directory now contains the bzflag source code.
3. Build bzflag:

Code: Select all

cd bzflag; ./autogen.sh; ./configure --enable-optimized --enable-shared --enable-plugins --disable-client --disable-bzadmin; make
Note: these commands can also be run one at a time. If it spits out errors, you need to install some packages.
4. Install:

Code: Select all

sudo make install
There are also many other howtos on this subject if you need additional help.

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Fri Nov 10, 2006 10:12 pm

I've been busy, so I haven't tried this. I recently installed the new Fedora Core 6, so I went ahead and left BZ out of the install, so I could install how you directed above. Unfortunately, I'm not sure where to enter the first two lines you have above, about CVS. The konsole? If so, I tried in there, and it gave me an error.
"bash: cvs: command not found"

Does that mean I don't have the development tools installed?
If not, which ones do I need to install?

Thanks for your help so far.
Image

User avatar
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Wed Nov 15, 2006 5:04 am

This is not really the right place to discuss compilation and installation issues. I would recommend that you post your question on how to compile somewhere in the correct section. In summary, yes, you were to type those commands in the console, terminal, or whatever you want to call it. The output that you quoted states that you do not have cvs installed, so you will need to install that. You'll probably need to install several other things too. I would recommend that you visit the #bzflag IRC channel sometime and ask for help. There ought to be some linux experts who will be able to help you.

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Thu Nov 23, 2006 7:34 pm

Okay, I've reinstalled FC6, and I chose to install the development packages, so now I have CVS. I ran the above commands, and got as far as

Code: Select all

cd bzflag; ./autogen.sh; ./configure --enable-optimized --enable-shared --enable-plugins --disable-client --disable-bzadmin; make
Is this supposed to take a long time?
Okay, it just finished ... and so you know, I changed "disable" to enable on the client & bzadmin options, because I want those ... that didn't screw anything up, did it?

I ran the sudo command, typed the root password, it said wrong password, typed my password, and got this error:
"ck is not in the sudoers file. This incident will be reported."

What next? Do the same procedure, except as root?
Image

User avatar
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Sun Nov 26, 2006 2:10 am

Yeah, that generally takes a long time. The entire configuration and compilation of the bzflag source code happens in that line.

Not sure why you would need a bzflag client on the server, but I think what you typed should work.

As far as the sudo problem, that just means that you haven't configured the /etc/sudoers file. This can be done in several ways... not sure what's the best way for your particular flavor of Linux. In debian, I think you just add the user "ck" to the group "admin" (with "usermod -a -G admin ck" as root), and in other operating systems I think you use the "visudo" command as root. You'll probably want to add yourself to the sudoers list for other reasons... but all you really need to do to finish the installation is become root before running "make install". You can do this with the "su" command.

Hope that helps.

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Sun Nov 26, 2006 2:53 am

okay, I just ran it as root earlier today, and it worked, though sometimes when I try to run bzflag, I get a segmentation fault error. I run it from the console, since it's not in the games folder of the K menu. And I'm not sure it's related, but several times today, I went "not responding," even though I wasn't doing a lot of other stuff, AND I have DSL, so yeah.

Wonder what has been going on?
Image

User avatar
Ck_asdf
Private First Class
Private First Class
Posts: 112
Joined: Sat May 06, 2006 6:53 pm
Location: 28655
Contact:

Post by Ck_asdf » Sun Nov 26, 2006 4:52 am

yaaay, I got the plugin to work properly. :)
unfortunately, every time I try to run as observer when playing, I get that segmentation fault error I was talking about above.


Oh, and you asked why have the client, etc ... I like to run servers, play the game, and do all kinds of stuff ... but mainly, I have the server to test my maps, before I offload them to Tadd or my school to run, for my puny bandwidth isn't near enough to support decent traffic.

That, and the plugin support is merely a toy to me. :D I like doing various things offline with bots, and seeing what I can do. If any of them are interesting, I will see if I can petition Tadd to get his supported, and then do that stuff. Whee!

Later, peeps.
Image

User avatar
Psyche
Private
Private
Posts: 3
Joined: Fri Jul 20, 2007 1:24 am

Post by Psyche » Mon Jul 23, 2007 3:15 am

Can someone please provide me with a compiled .dll of this plugin? I can't figure out for the life of me how to get this working. ;-;

User avatar
optic delusion
Special Forces
Special Forces
Posts: 986
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion » Wed Nov 21, 2007 7:20 am

I use this on my borg cube map, Thanks Constitution!
Attachments
flagOnSpawn.zip
fix null pointer dereference
(5.02 KiB) Downloaded 462 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
macsforme
General
General
Posts: 2023
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme » Wed Nov 21, 2007 9:33 pm

Optic Delusion wrote:I use this on my borg cube map, Thanks Constitution!
Thanks for the fix; the source code and linux binary have been updated on the initial post.

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 757
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: flagOnSpawn

Post by allejo » Wed Jul 13, 2011 9:21 pm

Plugin updated to 2.4
Attachments
flagOnSpawn.cpp
BZFlag 2.4
(7.59 KiB) Downloaded 128 times
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest