Page 1 of 1

Plug-in Starter (Now for 2.4.x!)

Posted: Tue Feb 26, 2008 10:32 am
by L4m3r
I've written a simple PHP script to facilitate the plugin-writing process.

http://l4m3r.bzflag.net/scripts/plugin_starter.php

This will set up a skeleton of the C++ code, handling the events and commands of your choosing. While the primary intention is to make plug-in authoring faster (and less boring) for people who know the API, it may also be helpful for those trying to learn how it works.

It's currently in a testing stage. Please leave any comments and report bugs here. (there are sure to be typos...)

Posted: Tue Feb 26, 2008 11:26 am
by macsforme
Nice work! Looks very handy.

Posted: Tue Feb 26, 2008 2:10 pm
by dexter
I like the point on learning how to make plugins and how they actually function. I'm speaking for someone who has never gone into that direction at all so this might be a good and interesting start. Nice work.

Posted: Mon Nov 03, 2008 2:20 am
by flying_popcorn
This is very useful, thanks for making it :)

BTW, it has an error: too many arguments to function 'bool bz_removeCustomSlashCommand(const char*)'.
Removing a custom slash command only takes the command name, not a reference to the handler.

Re: Plug-in Starter

Posted: Wed Aug 01, 2012 8:27 am
by L4m3r
Sorry for the wait (it's been way too long), but I've finally gotten around to updating this script for 2.4.x. It should now include all API events that are in trunk as of today.

As before, there are bound to be typos or other bugs. Feedback is appreciated, of course.

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Wed Aug 22, 2012 10:02 am
by allejo
Not sure if you got my message on IRC, but just to be safe.

There are two typos that I've found so far. When you call on a slash command in the class (the virtual bool SlashCommand()) it's "bz_APIStringList" not "bzAPIStringList." Also, it's

Code: Select all

bz_registerCustomSlashCommand(const char*, bz_CustomSlashCommandHandler*)
not "bz_registerCustomSlashCommand(const char*)" so it should look like this:

Code: Select all

bz_registerCustomSlashCommand("myCommand", this)

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Sun Jun 16, 2013 9:30 pm
by Starmute
It appears that the link is not working.

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Thu Aug 22, 2013 4:45 am
by zel
Disappointed to have the same as Starmute. Does someone (the author?) have the PHP script? I can host it...

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Mon Dec 23, 2013 7:34 am
by allejo
Since l4m3r seems to have lost interest in this project, I wrote a replacement.

http://allejo.me/tools/bzflag-plugin-starter/

To avoid spamming this thread, please PM me any issues that you find or report them here. I do plan on adding some more features to this so let me know if you have any ideas. Like the majority of my code, the code for this website is open source and can be found here.

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Sun Jan 08, 2017 4:49 am
by allejo
I've rewritten this tool available here: http://projects.allejo.io/bzflagPluginStarter2/

The source code is available here and I welcome pull requests if any: https://github.com/allejo/bzflagPluginStarter2

Please note, this version is built entirely in JavaScript so be sure to have it enabled on your browser when visiting this website. Let me know if there are any errors in the generation of plug-in skeletons and I'll be more than happy to correct them. I'll be taking down the PHP version and having the previous URL redirect to the new one in the coming weeks.

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Fri May 05, 2017 8:02 am
by allejo
The project has moved to: https://bzflag-plugin-starter.allejo.org/

Version 1 of this tool has been shut down and automatically redirects to the current version.

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Tue Oct 29, 2019 5:34 am
by allejo
Greetings!

Last winter I had started a rewrite of my plug-in starter to be more modular and never managed to finish it; until a few days ago that I started development again.

My project has been split-up into three separate projects:

- aclovis (GitHub) - A TypeScript library for generating C++ programmatically
- bzfPluginGen (GitHub) - A TypeScript library using aclovis for generating a C++ BZFlag plug-in
- bzflagPluginStarter3 (GitHub) - A React.js website using bzfPluginGen to give you pretty buttons to generate a plug-in

The core project, bzfPluginGen, already supports generating all of the following:
  • Custom BZDB settings
  • Custom callbacks
  • Custom flags
  • Custom map objects
  • Custom poll types
  • Custom slash commands
  • Event registration
They just need a UI for them in the React.js project. If anyone is interested in learning React or knows React, feel free to submit a PR to the website GitHub repo. You just need to call the appropriate bzfPluginGen code, I've already taken care of all the thinking of how to generate C++.

Thanks for tanking with my projects and please submit any bug reports!

Re: Plug-in Starter (Now for 2.4.x!)

Posted: Thu Nov 28, 2019 8:15 am
by allejo
My plugin starter now has an editor for creating and registering custom map objects. With that, bzflagPluginStarter3 has reached feature parity with bzfPluginGen in that there's a UI for everything bzfPluginGen supports.