Page 1 of 1

Patch to add a horn to your tank

Posted: Wed Feb 28, 2007 4:13 am
by The Vaxorcist
A while ago, there was some discussion about adding a horn to bzflag http://my.bzflag.org/bb/viewtopic.php?t=3785, so I wrote a patch for it.

This is a patch, so to use it you have to compile your own client. If you don't know how to do this, forget about trying it out (unless someone is kind enough to make a binary).

To honk your horn, just send someone, or everyone the message "*HONK*" (Go ahead and bind this to a key). If they've patched their client (Their clientquery should show something - if I didn't screw up), they should here a sound coming from your tank. If you patched your client, you should here your own horn.

To use this patch, download the patch and patch the source. Google is your friend. Build BZFlag, then copy the horn sound into the data directory. You can then test your client by going to an empty server and honking your horn.

The horn sound isn't great, so if you can get a better one, let me know.

Also, this doesn't require a server modification, It'll work anywhere.

I wrote this for 2.1.1, but it will probably work just as well with 2.0.8. EDIT: no it won't, use horn-2.0.8 instead.

Finally, feel free to leave any comments or criticism.

Posted: Wed Feb 28, 2007 4:37 am
by Grace F
lol a horn? :D

hEhE dats kewlz! :) I would try it out only i dont know how to compile my own client :P

Oh well...

Posted: Wed Feb 28, 2007 4:50 am
by The Vaxorcist
If you use linux, you might be able to add it without compiling. If you are using windows, I don't have the necessary setup. Sorry. I need to get around to setting up a cross compiler one of these days though.

Posted: Wed Feb 28, 2007 4:49 pm
by ducktape
The Vaxorcist wrote:If you use linux, you might be able to add it without compiling.
How do I add it? (in linux)

Posted: Wed Feb 28, 2007 5:22 pm
by JeffM
what I'd like to know is how you expect to add a source code patch with out compiling.... as the act of compiling takes source code and converts it into a machine executable program.

The Vaxorcist
cross compiler won't cut it, it'll build an SDL build for windows. The normal windows builds don't use SDL.

Posted: Wed Feb 28, 2007 10:28 pm
by The Vaxorcist
JeffM2501 wrote:what I'd like to know is how you expect to add a source code patch with out compiling.... as the act of compiling takes source code and converts it into a machine executable program.
I was thinking of distributing a binary.
JeffM2501 wrote: The Vaxorcist
cross compiler won't cut it, it'll build an SDL build for windows. The normal windows builds don't use SDL.
I was wondering about that.
Darn.

I still want a cross-compiler for other stuff though.

Posted: Thu Mar 01, 2007 12:44 am
by ducktape
Well does someone want to Post a Binary?

Posted: Thu Mar 01, 2007 12:59 am
by The Vaxorcist
ducktape wrote:
The Vaxorcist wrote:If you use linux, you might be able to add it without compiling.
How do I add it? (in linux)
If you compile your own client, look up the patch command. Skip the rest.

Which version of bzflag?

Which package did you install BZFlag with? Where is bzflag installed? (try running "which bzflag")

Do you have root access?

Thanks

Posted: Thu Mar 01, 2007 5:33 pm
by ducktape
The Vaxorcist wrote:
ducktape wrote:
The Vaxorcist wrote:If you use linux, you might be able to add it without compiling.
How do I add it? (in linux)
If you compile your own client, look up the patch command. Skip the rest.

Which version of bzflag?

Which package did you install BZFlag with? Where is bzflag installed? (try running "which bzflag")

Do you have root access?

Thanks
Version: 2.0.8

I got bzflag in the Repository or Synaptic whatever.

its installed on all the acounts (is that what you mean?)

and yes I have root access.

thanks
-ducktape

Posted: Thu Mar 01, 2007 6:27 pm
by JeffM
you need to be able to compile from the source, so you will need the dev version of all the packages bzflag uses, as well as the source.

check the threads on how to compile.

Posted: Thu Mar 01, 2007 6:30 pm
by asciimonster
Is there any way to have personalised horns?

I want mine to be like the General Lee(Dukes of Hazard) had. 8)

Posted: Thu Mar 01, 2007 8:16 pm
by DTRemenak
You can crosscompile to windows without using SDL, if you have the right DirectX files; our mingw build system is pretty complete.

And there's nothing terribly wrong with an SDL build on windows anyway, it's just around 10% slower and has more limited joystick support.

Posted: Thu Mar 01, 2007 11:15 pm
by The Vaxorcist
OK - I've made a linux binary.

Download the file from http://sonic.net/~mnfynan/bzflag.gz

uncompress it then run

Code: Select all

cp /path/to/bzflag/file/you/just/decompressed `which bzflag`
as root (Those are backticks, btw, the key to the left of "1". also has tilde on it "~")

Then uncompress honk.wav (from my first post) and put it in /usr/share/bzflag/ (as root too)

You should be already to go.

BTW. You may want to make a backup of /usr/bin/bzflag or /usr/games/bzflag (I don't know which - it depends on your system) before you start. If your bzflag setup get's borked, It helps.

Posted: Mon Mar 05, 2007 6:41 am
by Grace F
Those of us who havent added the horn, can we hear those who have?

Posted: Mon Mar 05, 2007 1:10 pm
by blast
Grace F wrote:Those of us who havent added the horn, can we hear those who have?
No, both sides would need the patch. If someone didn't have the patch, they would just see the "*HONK*" chat message.

Posted: Mon Mar 05, 2007 4:19 pm
by A Vicious Muffin
It's a nice idea, but it would be very annoying to people who didn't have the patch.

Those who do could use it as a way to spam, by honking all the time. Plus, it's virtually useless to someone who doesn't have it unless they want their chat box filled up with "*HONK*s".

Posted: Mon Mar 05, 2007 4:29 pm
by ducktape
Well your right but it is a awesome patch nice work.

Posted: Tue Mar 06, 2007 12:55 am
by The Vaxorcist
No - Only the receiver needs the patch. If you know that someone has the patch, you can honk your horn and they will hear it. You won't, however.

Now, what would be nice would be to change what is sent on the clientquery to include something that says that you can hear horns. PM or email me if you know how to change this.


Spam, etc.
The fact that it's a chat message is the beauty of it. It gets caught by the server spam kick and people without the patch have some idea what's going on - all without a server modification.