Author Topic: Choose Colour In Colony Games  (Read 2074 times)

Offline zervan

  • Newbie
  • *
  • Posts: 4
Choose Colour In Colony Games
« on: May 29, 2007, 03:27:23 PM »
I've been reading some topics searching if it possible to change colour not only in multiplayer game, but colony games. I found one message that says that someone knew (in an ancient topic) how to do that, however i haven't been able to find it. Can you please help me?

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Choose Colour In Colony Games
« Reply #1 on: May 29, 2007, 05:19:40 PM »
Use a hex editor to find the player color values and hack them. Make sure all players use different colors (this will only be a problem if you want to be Red or Blue).

I think...
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline zervan

  • Newbie
  • *
  • Posts: 4
Choose Colour In Colony Games
« Reply #2 on: May 29, 2007, 06:21:11 PM »
Ok Sirbomber, I'll try to do that, and later i'll tell you how it works.

Welll, I forget that i have minimal knowledge in progamming. First of all, i'll look for an hex editor.
I'll try to change colours just by myself or by reading all the web, and if i'm not able to, i'll ask you

An hex editor is just like notepad? (Just, text editor) (i dont know if it is just that silly thing and i'm probably being a bit clown)..understand me, i know very little about programming, sorry
« Last Edit: May 30, 2007, 05:19:59 AM by zervan »

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Choose Colour In Colony Games
« Reply #3 on: May 29, 2007, 07:39:02 PM »
First of all, I really don't care but the people in charge do, so don't post more than once. Use the edit button to add on to your original post.

Second, no. Hex editor is not like notepad.

Third, I don't know where the player color settings would be in the dll files. I'll ask op2hacker. If he's around that is.

Also, which map(s) are you trying to change the colors on? And to what colors?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Choose Colour In Colony Games
« Reply #4 on: May 30, 2007, 01:43:29 AM »
Heh, yeah, I noticed that double/triple posting too.


If I remember that old discussion.... There are two main tools you'll probably need. A disassembler, and a hex editor. You can google for both things, and you should find some free downloads. I usually use OllyDbg for a disassembler, and XVI32 for a hex editor. Both were free downloads that I found with google.


Open the .dll file for the level, and search the imports for SetColor. (In OllyDbg, hit Ctrl+N from the main code window). The name will be decorated, so it will have lots of odd junk and symbols around it. Don't worry about it. Follow it in the code. Careful though, since it may be called a few times, and you'll want to find the right one. It will likely be called twice in a colony game, setting the color for each colony. Look in the code where it has CALL and then the decorated name. Look up a few lines. This part is a little different for each case. It might be the line directly above, or it might be a few lines above it. You should see something along the lines of PUSH 0 (or 1, 2, ..., 5). This is the player color being set. This is how you'll know if you've found the call for setting the right colony's color. That's the line you want to change. Change the number to the new value (0-5 is definately safe, maybe some odd effects beyond that).

What are the colors anyways? 0 = Blue? 1 = Red? 2 = ...?

If you want to write the changes permanently to a file with a hex editor, here's an easy way to do it. Take a look at the original code bytes and search for them. (To the left of the assembly instruction). When searching for those bytes *make sure they are unique!* You don't want to edit some random place in the file that may have been similar. You may have to add bytes for a few lines to make sure it's unique. When you edit the instruction, OllyDbg shows the new code bytes, overwrite the location you found in the hex editor with the new code bytes. There should only actually be one byte different, corresponding to the color value. Save the file and test it out.

Note: If you changed the instruction already and want to see the old code bytes, you can undo changes/patches in OllyDbg by highlighting that line and pressing Alt+BkSpc.




Another way to edit colors, is to change the actual palette of player colors. This affects the whole game globally. The changes aren't confined to just one level. You can also add truely new colors this way. Keep in mind that player colors aren't solid. They contain a slight gradient of colors. When editing them, you have to edit the whole range of Blues/Reds/whatever used by that player color value. You can do this with a hex editor alone, although it's easier with some sort of bitmap/palette editing tools.
 

Offline zervan

  • Newbie
  • *
  • Posts: 4
Choose Colour In Colony Games
« Reply #5 on: May 30, 2007, 05:26:52 AM »
Sorry for that triple posting. I've solved it by copying messages to the first message and deleteing the other two. I promised i won't do that again, i'm really sorry.

Sirbomber, I would like to change some colony games (as example, Plymouth starship II) to green color, just because i've never been aboe to play with another colours that blue and red. Outpost II is one of my favourite ones and i would like to personalize it more.

Thank you Hooman, i'll try to do that, let me some days to try it, :)
 

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Choose Colour In Colony Games
« Reply #6 on: May 30, 2007, 08:36:31 PM »
Join us on IRC and you can play multiplayer games with us. Then you can be any color you want without any annoying hacking.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials