TeamWeapons - just started

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

TeamWeapons - just started

Post by Enigma »

Requirements: Development BZFlag from svn at revision 19878.

This is a simple plug-in I started last night. The plug-in changes the shot types for specific teams. I believe at one point there was a plug-in that assigned flags to teams, where one team would always get laser, another would get guided missile, and so on. In contrast, the TeamWeapons plug-in allows you to pick up a wings flag or a cloaking flag and still have the shot type assigned to a team.

It is not finished. I posted the source code if anyone want to mess around with it.

**edit - The download is in a lower post. **
Attachments
bzfi0094.jpg
Screenie... The green team has Laser. The red team has GM.
(296.48 KiB) Downloaded 60 times
bzfi0095.jpg
Screenie... The green team has Laser. The red team has GM.
(311.41 KiB) Downloaded 53 times
Last edited by Enigma on Fri Sep 18, 2009 12:45 am, edited 1 time in total.
User avatar
clarahobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: TeamWeapons - just started

Post by clarahobbs »

Oh cool! That sounds amazing. I can imagine someone having cloaking/laser and never killing himself. And those graphics - I had no idea that BZFlag 3 had such beautiful laser beams!
FKA Ratfink
User avatar
Bambino
Private First Class
Private First Class
Posts: 1210
Joined: Mon Apr 21, 2008 10:27 pm
Location: Alberta, Canada

Re: TeamWeapons - just started

Post by Bambino »

Ahem, is there Guided Geno? :P

But really, that is a cool plugin. "Shot Switcher" <-- Name?
"Anyone who has never made a mistake has never tried anything new." -- Albert Einstein
GU League | Ducati League | OpenLeague
User avatar
mrapple
Sergeant Major
Sergeant Major
Posts: 460
Joined: Wed May 27, 2009 11:59 am
Location: Unknown
Contact:

Re: TeamWeapons - just started

Post by mrapple »

aww snap! me and flying_popcorn (i think it was him) were talking about releasing a pplugin and map just like that in 3.0!!!!! darnet :(
Image
User avatar
die muszx double
Private First Class
Private First Class
Posts: 44
Joined: Thu May 28, 2009 10:38 am
Location: In the UK playing BZflag

Re: TeamWeapons - just started

Post by die muszx double »

Lol, you could have CL and ST :D
My apple mac is natural

Image

die muszx double
Anxuiz
Private First Class
Private First Class
Posts: 31
Joined: Fri Sep 05, 2008 3:38 am

Re: TeamWeapons - just started

Post by Anxuiz »

die muszx double wrote:Lol, you could have CL and ST :D
No, actually. The API only supports the changing of shot types, not flag effects. And the API can only set the shot type to one shot type (so no guided geno or laser).

So for example you could have these shot & flag combos:
  • GM + WG
  • L + WG (that'd be interesting :shock:)
  • CL + WG
  • CL + L
  • G + WG
  • G + ST
  • etc.
But you couldn't have these:
  • G + L
  • WG + ST
  • L + GM
  • G + IB
  • etc.
Although I do believe that changing flag effects has been discussed before, but was never implemented ;)

- Yassen
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

Actually the there isn't a genocide shot type:

Code: Select all

typedef enum {
  eNoShot = 0,
  eStandardShot,
  eGMShot,
  eLaserShot,
  eThiefShot,
  eSuperShot,
  ePhantomShot,
  eShockWaveShot,
  eRicoShot,
  eMachineGunShot,
  eInvisibleShot,
  eCloakedShot,
  eRapidFireShot,
  eLastShotType
} bz_eShotType;
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

This is the current source code right now. I added a command to change the shot types while the plug-in is loaded.

The command works as follows:

Code: Select all

/tw <action> <param_1> <param_2> ... <param_N>
There are two actions as of posting this: set and info. The info action takes no parameters, and set requires two parameters. The set action has the following form:

Code: Select all

/tw set <team> <flag_code>
where

Code: Select all

team := red | green | blue | purple | rogue | hunter | rabbit;
and

Code: Select all

flag_code := standard | GM | L | TH | SB | PZ | SW | R | MG | IB | CS | F; 
For instance, to set the GM shot type for the red team, you would use

Code: Select all

/tw set red GM
Note that it is case sensitive.

The code is released under the MIT license. It is very non-restrictive, and I'm not too worried what people do with the code. Have fun.
Attachments
TeamWeapons.zip
Source code only! I will not post any binaries, at least not yet.
(62.78 KiB) Downloaded 241 times
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

I should also add, the shot types will not change until a flag is grabbed. Without a flag, everyone has the standard shot type. If someone is holding a flag while the shot type is changed, the changes will not take effect until the current flag is dropped and a new flag is grabbed.
User avatar
clarahobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: TeamWeapons - just started

Post by clarahobbs »

Oh wow, this sounds absolutely amazing. Changing the shot type for the rabbit team could be really useful, as it could actually give people some incentive to become rabbit. Would it be possible to make it change shot type for people in a certain area of a map specified in the .bzw file?
FKA Ratfink
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: TeamWeapons - just started

Post by joevano »

Ratfink wrote:Oh wow, this sounds absolutely amazing. Changing the shot type for the rabbit team could be really useful, as it could actually give people some incentive to become rabbit.
And being the only person to be able to score isn't enough incentive?
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

Ratfink wrote:Would it be possible to make it change shot type for people in a certain area of a map specified in the .bzw file?
Probably. It would require more code though. It would probably be better as a separate plug-in.
User avatar
mrapple
Sergeant Major
Sergeant Major
Posts: 460
Joined: Wed May 27, 2009 11:59 am
Location: Unknown
Contact:

Re: TeamWeapons - just started

Post by mrapple »

when you say that we must have revision 19878, do we actually need that revision?

Im pretty sure but im not positive, because when i compiled then loaded the plugin, it loaded fine and i could type /tw info, but it would not let me set shot types!

if we do need a specific revision, do you know if this is a bug and if so when you plan to fix it for the 3.0 release?

thanks enigma.
Image
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: TeamWeapons - just started

Post by blast »

More than likely that would be a minimum revision that 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
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

Blast is right. I meant it as the minimum revision. I'm not even sure if you would need that revision. It was the revision I tested the plug-in with, so it's more of a recommendation. Everyone should have a newer revision anyway.

What happened when you tried to set the shot types? If you type in the command wrong, you should get an error message. If you type it in correctly, you should get the message "Shot type set for ..."

Just in case you didn't see this...
Enigma wrote:I should also add, the shot types will not change until a flag is grabbed. Without a flag, everyone has the standard shot type. If someone is holding a flag while the shot type is changed, the changes will not take effect until the current flag is dropped and a new flag is grabbed.
User avatar
mrapple
Sergeant Major
Sergeant Major
Posts: 460
Joined: Wed May 27, 2009 11:59 am
Location: Unknown
Contact:

Re: TeamWeapons - just started

Post by mrapple »

Enigma wrote: What happened when you tried to set the shot types? If you type in the command wrong, you should get an error message. If you type it in correctly, you should get the message "Shot type set for ..."
i dont get that at all. it doesnt say command not recongized or anything. it just does nothing. so i type it and i get nothing, not even an error.
Enigma wrote: Just in case you didn't see this...
dont worry i saw that. i tried picking up neumerous flags that dont change shot types, ex: st, cl, mq, etc. nothing.
Image
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

Sorry about replying so late. I haven't been coming here lately. I'm going to compile it and test it, and I'll let you know what happens.
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

I just tried it. It works for me. I don't know why it doesn't work for you.
User avatar
mrapple
Sergeant Major
Sergeant Major
Posts: 460
Joined: Wed May 27, 2009 11:59 am
Location: Unknown
Contact:

Re: TeamWeapons - just started

Post by mrapple »

I havent tried it in a while but Ill compile it later today and let you know the results.

Thanks for your response Enigma :)
Image
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Re: TeamWeapons - just started

Post by Enigma »

I would have tested it sooner, but bzflag doesn't always build, but that is expected to happen. I had to rename the header TeamWeapons/include/EventHandler.h to get it to compile. The build system was getting it confused with bzflag/include/EventHandler.h for some reason.

Also, run "rm -rf *" in plugins/TeamWeapons/.libs before you build the plug-in.
Post Reply