powerup plugin 0.3 alpha

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
The Vaxorcist
Private First Class
Private First Class
Posts: 134
Joined: Wed Mar 23, 2005 10:28 am
Location: Santa Rosa, CA

powerup plugin 0.3 alpha

Post by The Vaxorcist »

Now with:
a config file parser, no more constants.h :wink:
capping a flag 2 times in a row within a certain time period triggers a powerup
couple bug fixes
a couple refinements
Missing option to use random sky color - it would be easy to add, but I'll release while i'm ahead. :D

May be buggy, I didn't do a final test of it. Proceed with caution. But if it works, Hey! 8)

Post here if you need any help with anything.
Attachments
powerup.tar.gz
Powerup 0.3 alpha, "Slightly tempermental"
(5.37 KiB) Downloaded 438 times
Image
Where's Darwin when you need him?

Lagger@Everywhere
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

Ohhhh, a funky config file....

I dare you to post a sample config demonstrating the full scope of the plugin for me to base one off of....

Whats the defaults (if I didn't give it a config?)
...This has been a recording.
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post by Spazzy McGee »

when i tried to make it, it chucked out a load of errors

Code: Select all

g++ -fPIC -I../../include -g   -c -o powerup.o powerup.cpp
powerup.cpp:9:21: error: bzfsAPI.h: No such file or directory
poweruptracker.h:11: error: expected class-name before '{' token
poweruptracker.h:16: error: `bz_EventData' has not been declared
powerup.cpp:20: error: 'BZ_GET_PLUGIN_VERSION' does not name a type
powerup.cpp:37: error: expected constructor, destructor, or type conversion before "int"
powerup.cpp: In function `int loadconfig(const char*)':
powerup.cpp:73: error: 'bz_debugMessage' was not declared in this scope
powerup.cpp:125: error: 'bz_debugMessage' was not declared in this scope
make: *** [powerup.o] Error 1 
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

Spazzy Mcgee wrote:when i tried to make it, it chucked out a load of errors

Code: Select all

g++ -fPIC -I../../include -g   -c -o powerup.o powerup.cpp
powerup.cpp:9:21: error: bzfsAPI.h: No such file or directory
poweruptracker.h:11: error: expected class-name before '{' token
poweruptracker.h:16: error: `bz_EventData' has not been declared
powerup.cpp:20: error: 'BZ_GET_PLUGIN_VERSION' does not name a type
powerup.cpp:37: error: expected constructor, destructor, or type conversion before "int"
powerup.cpp: In function `int loadconfig(const char*)':
powerup.cpp:73: error: 'bz_debugMessage' was not declared in this scope
powerup.cpp:125: error: 'bz_debugMessage' was not declared in this scope
make: *** [powerup.o] Error 1 
Hmmm

Copy a file named "bzfsAPI.h" from /path/to/bzflag/include/bzfsAPI.h to where your powerup source is, THEN run make.
...This has been a recording.
User avatar
The Vaxorcist
Private First Class
Private First Class
Posts: 134
Joined: Wed Mar 23, 2005 10:28 am
Location: Santa Rosa, CA

Post by The Vaxorcist »

I_Died_Once wrote:Ohhhh, a funky config file....

I dare you to post a sample config demonstrating the full scope of the plugin for me to base one off of....

Whats the defaults (if I didn't give it a config?)
Read the README. (ie RTFRM)

here is mine, showing off the full capabilities:

Code: Select all

var POWERUP_PERIOD 5m
var POWERUP_PERIOD_VARIANCE 30
var POWERUP_DURATION 30
var POWERUP_DURATION_VARIANCE 15
var FLAG_CAP_PERIOD 2m

powerup
        name Speed
        desc Run fast. If you get autokicked, please flame the server owner
        var _tankSpeed 10
        var _shotSpeed 10
end

powerup
        name JumpHigh
        desc Hello
        var _gravity 5
end

powerup
       name Jump hig shoot + run fast
       desc blah blah blah
       var _gravity 5
       var _shotSpeed 5
       var _tankSpeed 5
end
I should mention too that in the:

Code: Select all

var [servervar] [value] 
[value] is how much to add to the server variables, so it can be negative if you want
Image
Where's Darwin when you need him?

Lagger@Everywhere
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

hmmmmm

So, I could do "custom" powerups then, like make it /set what I want, /say what I want, plus some? Impressive...

Most impressive...
...This has been a recording.
User avatar
The Vaxorcist
Private First Class
Private First Class
Posts: 134
Joined: Wed Mar 23, 2005 10:28 am
Location: Santa Rosa, CA

Post by The Vaxorcist »

not quite,

Code: Select all

powerup
       name Jump hig shoot + run fast
       desc blah blah blah
       var _gravity 5
       var _shotSpeed 5
       var _tankSpeed 5
end 
this sets the name, the description, which get /say'd. And, it will add 5 to _gravity, _shotSpeed, and _tankSpeed when the powerup is triggered.

simple, really.
Image
Where's Darwin when you need him?

Lagger@Everywhere
User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once »

So, it still does a "stage green" and "stage yellow" ?
...This has been a recording.
User avatar
The Vaxorcist
Private First Class
Private First Class
Posts: 134
Joined: Wed Mar 23, 2005 10:28 am
Location: Santa Rosa, CA

Post by The Vaxorcist »

Yes, and no. It doesn't say that anymore, but it still stacks powerups and indicates it with the sky color. In the next release, I will implement your idea of having a random sky color, It is easy enough, I just was tired of coding and I decided to release.

Oh, and the config file has no default values, if you omit something, you will either not notice anything, or wonder why your server is periodicly crashing. There is also nothing that checks the validity of the config file (actually, there is some, but don't count on it), so be careful.
Image
Where's Darwin when you need him?

Lagger@Everywhere
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

Is this planned to come out for windows?
Image
Sig Made By AlliedArmour

TGPH
User avatar
Tropican8
Private First Class
Private First Class
Posts: 312
Joined: Fri Mar 18, 2005 11:51 pm
Location: As close to the grove as you can get

Post by Tropican8 »

oliver browne wrote:Is this planned to come out for windows?
I believe you can compile the source in mingw to produce a windows .dll Don't forget to copy the API lib and header from your game directory.
User avatar
DJ Atomica
Private First Class
Private First Class
Posts: 145
Joined: Thu May 12, 2005 8:55 pm
Location: PA - USA

Post by DJ Atomica »

Will this ever go on? I liked the thought of it! Maybe a configuration file for it though.
DJ Atomica.........Scratching the records! :twisted:

Skype me! Skype name is "dj.atomica"!
matelich
Private First Class
Private First Class
Posts: 18
Joined: Mon Jan 23, 2006 9:32 pm
Location: spokane, wa

Post by matelich »

So, I've been using the powerup plugin for a while on linux w/ 2.0.4 quite happily, but its causing crashes now that I've moved to a WinXP server on 2.0.8.

I wanted to see if there was a new version before I start trying to debug it.

Thanks
Post Reply