Page 2 of 2

Re: PassTheFlag 1.0.3 released (bugfix)

Posted: Wed Sep 22, 2010 6:27 pm
by FiringSquad
Version 1.0.3 released to fix bug mention in previous post.
Available for download from initial post on first page.

Re: PassTheFlag 1.0.4 released (bugfix)

Posted: Thu Sep 23, 2010 9:03 pm
by FiringSquad
Version 1.0.4 released. BugFix version, although some debugging enhancements have been added to facilitate remote debugging.

Re: PassTheFlag 1.0.5 released (Please Test)

Posted: Wed Oct 06, 2010 1:27 pm
by FiringSquad
This version fixes the bug where things got confused when you dropped one flag while sitting on another. The server thought you had the flag, but no clients were informed.
For those interested in the technical details:
This problem was due to corruption of the flag-grab message caused by sending a flag-update before the flag-grab event was complete.
I fixed it by sending a flag-update message using a local message buffer, thus leaving the main message buffer undamaged.

I also added more flexibility in choosing which flags are passable.

Finally, I set the default maxwait value to 0.1
If this is too small, then you should see the flag being passed when some other effect was expected.
If you see this happening on your map, then you will need to increase this value in the loadplugin parameters.

Re: PassTheFlag 1.0.5 released (Please Test)

Posted: Mon Oct 11, 2010 9:15 pm
by FiringSquad
Updated Readme.txt for Version 1.0.5 to include info about debugaccess.

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Thu Oct 14, 2010 8:31 pm
by FiringSquad
I fixed a bug in the "customflags" command of the "-loadplugin" command-line.

Note: The flags must now be enclosed in square brackets for the command line. bzfs had problems dealing with multiple flags within braces as a plugin parameter due to Brace-Expansion. A silly oversight on my part.

Example command-line:

Code: Select all

./bzfs/bzfs -loadplugin ../plugins/passtheflag/.libs/,customflags=[T,sw,G*],pass2anykiller,dist=9 etc.
The in-game commands "customflags" and "toggleflags" still use braces, i.e. "/fpass toggleflags={t,sw}" so as to avoid confusion with the BNF-like notation of the in-game help.

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Fri Oct 15, 2010 12:43 am
by blast
FiringSquad, you might also consider having a configuration file instead of lots of custom parameters like that. As an example, the serverControl plugin does this (it has some parser for reading the config file). Just something to think about.

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Fri Oct 15, 2010 12:17 pm
by FiringSquad
Good idea. The configuration options just keep growing[sup]1[/sup]. :-)
I just had a look at the code and it looks pretty simple to implement[sup]2[/sup].
Thanks for the heads-up.

I won't implement it just yet, but the next version should have it.

1. Whodathunk I'd be producing bloatware for my first plug-in. Jeez!
2. Of course I thought this plug-in would be a lot simpler to implement before I actually started typing.

What's with the "sup" and "hr" tags?
Ahh! That's right, superscript & Horizontal-line is not implemented here yet. One can but hope. :-)

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Wed Oct 20, 2010 10:46 am
by Yrogirg
Dirty hint: If FairCTF is enabled you still can pass the flag to your base. If teams are unbalanced just grab the flag while moving towards your base.

Maybe in this case FairCTF plugin only encourages abuse of weaker team.

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Wed Oct 20, 2010 12:02 pm
by FiringSquad
Thank you for the suggestion, but I don't think I will implement this feature in this plugin, as there are other ways to achieve this effect and it probably belongs in the in the fairCFT plug-in anyway, rather than here.
Perhaps you can make the suggestion in the fairCTF thread, here.
My code is available for download and I would certainly offer any support I could to that plugin's developer, L4m3r, though I doubt he needs it.

I have tried to give this plugin as invisible a footprint as I can. It should be able to be bolted on to any map with any plugins installed and should still work.
If I start to introduce code that interacts with anything other than the server, then I would need to modify the code (or at least verify it) every time those plug-ins are modified.
And that would be a recipe for disaster. :-)

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Thu Oct 21, 2010 1:02 pm
by FiringSquad
I may need to modify the plug-in to be compatible with the fairCTF plug-in (or vice versa).
When the flag is dropped by the fairCTF plugin, it passes. It should stay in the same place.
Not sure when I'll have time to check this, but I'll keep you posted.

Hmmm... After a quick inspection, it looks like the only way to solve this, would be to create a version of the fairCTF plugin that drops the flag without calling bz_removePlayerFlag().
I don't want to do this as it would mean creating a version that would not be universally compilable.
If this becomes a problem for anyone and they are running a non-Windows server, then I can produce a version of the fairCTF plugin that will work for you.

Note: If the PassTheFlag plug-in is configured with "dist=0.0" then this problem will not occur.

Re: PassTheFlag 1.0.6 released (Please Test)

Posted: Thu Oct 21, 2010 2:39 pm
by FiringSquad
Forgot to change the version number in the source file.
New version of Source uploaded.

Re: PassTheFlag 1.0.6 released

Posted: Wed Jan 26, 2011 10:09 pm

Code: Select all

bool getPlayerPosition(int playerID, float PlayerPos[3])
	bz_PlayerRecord* player = bz_getPlayerByIndex(playerID);
	if (!player) {
		return false;
	memcpy(PlayerPos, player->pos, sizeof(float[3]));
	return true;
I was under the impression if you didn't bz_freePlayerRecord(player) something bad would happen (SCADOOSH).
JeffM wrote:The server does not track player positions over time in 2.0.x.In 3.0 it does a simple linear interpolation. There is no accurate way to get a player's position at any time. All you can do is get the last updated position.
Since 3.0 can do a simple linear interpolation serverside (and it is done in 2.0 clientside), there is no reason why we can't do it pluginside. Call it hacky but it works well. I think the biggest source of inaccuracy is the rounding of the playerUpdateEventData floats to (the lowest) 0.02.

In some plugins it doesn't matter, but in FlagThrow or PassTheFlag your intended direction can be off by up to 45 degrees (for that one update per second without changing speed/angular). And I used to think it was something to do with spinning the ball :book:
Pedantics are more important in league play when inconsistency can damage one's ego :gross:

PM me if you want the code for it.

Re: PassTheFlag 1.0.6 released

Posted: Wed Jan 26, 2011 11:45 pm
by FiringSquad
I'm happy for others to make amendments to the code and release newer versions.
I do not wish to own the code or claim any rights to it.
If you already have code that works then feel free to release a new version.
The plug-in (code included) belongs to everybody. :-)

The suggestion is a good one. I actually thought of it, but the anomaly was predictable for me, so I just considered it a quirk that the user would need to learn.
Be careful that you are predicting angle and not just position.

re bz_freePlayerRecord()
I should be taken out and shot.
Thanks for the heads-up. I was under the impression from other sample code (e.g. CustomFlagSample.cpp) that it was returning a reference to a pre-existing instance, but upon closer inspection, it does indeed return a reference to a newly created instance.
If you intend to modify the code for better location & rotation prediction, I would be grateful if you could fix this too.
If you want me to make the change then it will probably have to wait until next week at the earliest.

Re: PassTheFlag 1.0.6 released

Posted: Thu Jan 27, 2011 9:13 am
by zaphod
can't wait to see it getting even better then it is already!!!

Re: PassTheFlag 1.0.7 release for BZFlag 2.4

Posted: Sun Jul 13, 2014 2:04 am
Upgraded plugin to compile for bzflag 2.4
Tested :mrgreen: