Random Color Bike and Tail Every Round HACK

Something else for Armagetron? Goody!
RandomColorBike
Posts: 1
Joined: Sat Apr 29, 2006 7:49 pm

Random Color Bike and Tail Every Round HACK

Post by RandomColorBike »

Okay guys, this is the source code patch to make this work. I think its a horrible hack and could be done elsewhere but here it is:

in the armagetronad source directory, go under src/engine and edit ePlayer.cpp
and look for this:

void ePlayerNetID::WriteSync(nMessage &m){
lastSync=tSysTimeFloat();
nNetObject::WriteSync(m);
m.Write(r);
m.Write(g);
m.Write(b);

Change the above few lines to look like this:
void ePlayerNetID::WriteSync(nMessage &m){
lastSync=tSysTimeFloat();
nNetObject::WriteSync(m);

int bb=1+(int) (31.0*rand()/(RAND_MAX+1.0));
int rr=1+(int) (31.0*rand()/(RAND_MAX+1.0));
int gg=1+(int) (31.0*rand()/(RAND_MAX+1.0));
m.Write(rr);
m.Write(gg);
m.Write(bb);




Recompile and your car and tail will change colors every round. Also there is no way to turn it off yet, but someone could code a patch to easily do so.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Interesting idea. Really good way to confuse other players that happen to be trying to come after you ;).
Image
User avatar
iceman
Reverse Adjust Outside Corner Grinder
Posts: 2448
Joined: Fri Jan 09, 2004 9:54 am
Location: Yorkshire, England. Quote: Its the fumes, they make one want to play
Contact:

Post by iceman »

glad you finally made your patch public, good little hack 8)

shame that the colors are only updated between rounds, would look great if the colors changed constantly during game play giving multicolor walls but that would have a huge impact on bandwidth
Image He who laughs last, probably has a back-up
Image
Image
sorry about the large animated gif
User avatar
fool
Posts: 3
Joined: Sun Apr 30, 2006 12:32 am
Location: ARMAGETRON:ICEMAN_SERVER

Post by fool »

If its a patch can only you see it or can others because if it does very interesting!

or it could be my guess that inside the game it changes and i dont see anything .. am i right??

I kinda got confused with it heh..
Yeah im the real f0ol..
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

That patch seem to send your new color code to the network.

So yes, everybody would see it.

-ph
Canis meus id comedit.
User avatar
fool
Posts: 3
Joined: Sun Apr 30, 2006 12:32 am
Location: ARMAGETRON:ICEMAN_SERVER

Post by fool »

Thank you for letting me know..

[Edit : Uhmm by anychance do you mean the source files or the files that we installed because if your talking about the source i dont know where to get that and the files installed i cant find it .. maybe you can give me a clue or steps cuz im confused.. if you can thanks :lol: ]
Yeah im the real f0ol..
gnorty
Core Dumper
Posts: 187
Joined: Wed Nov 02, 2005 2:45 am

Post by gnorty »

source can be downloaded from the download page I think (maybe you need to follow the further link to the betas, it is certainly there).

You have to compilke the patched source yourself.
-={ID< Steven
Posts: 4
Joined: Sun Oct 08, 2006 3:12 pm

Re-

Post by -={ID< Steven »

Sweet, I'll try this out. Maybe it will work and I can figure it out.
-={ID< Steven
Posts: 4
Joined: Sun Oct 08, 2006 3:12 pm

Re-

Post by -={ID< Steven »

When I've copied the code into the source file, What do I do next? hehe.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Compile it?
There's no place like ::1
-={ID< Steven
Posts: 4
Joined: Sun Oct 08, 2006 3:12 pm

Re-

Post by -={ID< Steven »

I downloaded Code Blocks and I compiled the ePlayer File and it doesn't work. What file do I have to open?
User avatar
^}LC}<SolJah*KF
On Lightcycle Grid
Posts: 19
Joined: Sat Dec 16, 2006 1:55 pm
Location: Nebraska
Contact:

Post by ^}LC}<SolJah*KF »

i dont get it how do we put it in?
| / \ |
Why i did thatt? i do not know..
User avatar
^}LC}<SolJah*KF
On Lightcycle Grid
Posts: 19
Joined: Sat Dec 16, 2006 1:55 pm
Location: Nebraska
Contact:

Post by ^}LC}<SolJah*KF »

*BUMP*
| / \ |
Why i did thatt? i do not know..
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Compiling armagetronad on windows isn't exactly easy, and if you don't have any programming experience (scripting language knowledge probably won't help you either) I suggest you don't try it…
There's no place like ::1
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

wrtlprnft wrote:Compiling armagetronad on windows isn't exactly easy, and if you don't have any programming experience (scripting language knowledge probably won't help you either) I suggest you don't try it…
ya I have a little programming experience and still don't understand it.
Post Reply