My First Patch - Face Customizer
Moderator: OpenTTD Developers
- BoominGranny
- Engineer
- Posts: 85
- Joined: 18 Apr 2006 02:16
- Location: Wellington, New Zealand
- Contact:
My First Patch - Face Customizer
Hi Everyone,
This is my first - and im sure far from perfect patch.
This allows you to customize your face (ie change your eyes, chin, gender all seperate from one another)
Let me know what you think.
7/may/06:
Added Set Default button - that saves the current face as your default for new games
Moved Randomize Face - you now randomize your face by clicking on the picture!
10/may/06:
belugas kindly adopted my patch to meet the OTTD coding convention! thx
This is my first - and im sure far from perfect patch.
This allows you to customize your face (ie change your eyes, chin, gender all seperate from one another)
Let me know what you think.
7/may/06:
Added Set Default button - that saves the current face as your default for new games
Moved Randomize Face - you now randomize your face by clicking on the picture!
10/may/06:
belugas kindly adopted my patch to meet the OTTD coding convention! thx
- Attachments
-
- faceselection.png (4.95 KiB) Viewed 12377 times
-
- face_customizer_4749.diff
- (8.75 KiB) Downloaded 566 times
Last edited by BoominGranny on 10 May 2006 06:15, edited 3 times in total.
- BoominGranny
- Engineer
- Posts: 85
- Joined: 18 Apr 2006 02:16
- Location: Wellington, New Zealand
- Contact:
- Born Acorn
- Tycoon
- Posts: 7595
- Joined: 10 Dec 2002 20:36
- Skype: bornacorn
- Location: Wrexham, Wales
- Contact:
actually I'm not sure I like your window (now is the time to speak your mind )
I think it would be better if it could move though the list of stuff using the same style as in the news settings window. Also, as mentioned before, the old random face is missing. To make the arrow buttons and stuff, you need to make the window larger, which is ok.
I think it's a nice window for a first try. The window stuff in OpenTTD is not the nicest you can find. I can remember when I made my first window. It took days, but that was also because it was the autoreplace window, so I had to add support for two vertical scrollbars and some stuff regarding the pulldown menu. (tip: always start with something simpler than that)
I think it would be better if it could move though the list of stuff using the same style as in the news settings window. Also, as mentioned before, the old random face is missing. To make the arrow buttons and stuff, you need to make the window larger, which is ok.
I think it's a nice window for a first try. The window stuff in OpenTTD is not the nicest you can find. I can remember when I made my first window. It took days, but that was also because it was the autoreplace window, so I had to add support for two vertical scrollbars and some stuff regarding the pulldown menu. (tip: always start with something simpler than that)
- BoominGranny
- Engineer
- Posts: 85
- Joined: 18 Apr 2006 02:16
- Location: Wellington, New Zealand
- Contact:
Good points Bjarni, i've since added the Randomizer back into the window.
I know what you mean by in the message window - thouse left/right buttons? <= => they would work well. At least now you have some control over your face. The problem i have is that the face structure is all over the place so to implement buttons at all i had to set some bits randomly (thats what i did for the eyes) and to set the skin colour i just toggle 3 bits between 0 and 1 to get the skin colour to change, but without the exact structure of how the face works this is the best i (As a rookie C developer) can come up with.
structure as ive figured so far:
32 bits
123=don't seem to do anything
45=chin
6789=eyes/eye brows
10,11,12,13,14,15=mouth/nose
16,17,18,19=hair (also effects skin sometimes!)
20,21,22=clothes/eye colour
23,24,25,26,27=clothes (also effects skin sometimes!)
28,29,30=glasses
31=gender
I know what you mean by in the message window - thouse left/right buttons? <= => they would work well. At least now you have some control over your face. The problem i have is that the face structure is all over the place so to implement buttons at all i had to set some bits randomly (thats what i did for the eyes) and to set the skin colour i just toggle 3 bits between 0 and 1 to get the skin colour to change, but without the exact structure of how the face works this is the best i (As a rookie C developer) can come up with.
structure as ive figured so far:
32 bits
123=don't seem to do anything
45=chin
6789=eyes/eye brows
10,11,12,13,14,15=mouth/nose
16,17,18,19=hair (also effects skin sometimes!)
20,21,22=clothes/eye colour
23,24,25,26,27=clothes (also effects skin sometimes!)
28,29,30=glasses
31=gender
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
tie is counted seperate from jacket, you have eyes, and eye colour(remap), i think you also have hair colour(remap)
i can't remember everything, and i can't check because i am at work, and everything i used to make my avatar(which gave me a really good look at the faces sprites) is at home.
basicly saying make the eyes and the eye colour, and the hair and hair colour seperate, also, if possable, things like the hair, it kinda looks stupid to have some parts 1 colour, and other parts another, any chance on getting it to make all hair the same colour?
i can't remember everything, and i can't check because i am at work, and everything i used to make my avatar(which gave me a really good look at the faces sprites) is at home.
basicly saying make the eyes and the eye colour, and the hair and hair colour seperate, also, if possable, things like the hair, it kinda looks stupid to have some parts 1 colour, and other parts another, any chance on getting it to make all hair the same colour?
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
- PouncingAnt
- Transport Coordinator
- Posts: 357
- Joined: 09 Nov 2004 22:33
Your work seems very promising so far!
Ganbatte! (go for it)
Ganbatte! (go for it)
NB: the below challenges are still open for submission, so feel free to perform necromancy on them!
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4
Or try my scenario instead!
-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"
Patches:
Company Station Stats
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4
Or try my scenario instead!
-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"
Patches:
Company Station Stats
It's realistic though. I have ruddy hair and yet a blonde beard*. My dad had black hair and a ginger mustache. Genetics... fun.bobingabout wrote: basicly saying make the eyes and the eye colour, and the hair and hair colour seperate, also, if possable, things like the hair, it kinda looks stupid to have some parts 1 colour, and other parts another, any chance on getting it to make all hair the same colour?
*Actually it's more complicated than that. I have a blond streak that runs across the top of my scalp, which splits in two and runs down both sides of my mouth. If I had hair over my entire face it'd run down to around the bridge of my nose and then split there, as far as I can tell.
Brignell’s law of consensus: At times of high scientific controversy, the consensus is always wrong.
- BoominGranny
- Engineer
- Posts: 85
- Joined: 18 Apr 2006 02:16
- Location: Wellington, New Zealand
- Contact:
done!jez wrote:Looks great The 2 things I'd say are, as before, the random generator button should stay in the same way that it works now, and a Save/Load face would be great.
are you able to find this out for me when you get a chance and post it here? would be very helpful!bobingabout wrote:tie is counted seperate from jacket, you have eyes, and eye colour(remap), i think you also have hair colour(remap)
i can't remember everything, and i can't check because i am at work, and everything i used to make my avatar(which gave me a really good look at the faces sprites) is at home.
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
what i found out was simply by looking at the grf file decoded by GRFCodec. you'll probably be able to find out more by reading the code, but the only problem there is if its not well documented, knowing exactly what it does.
next time i'm on my laptop, I'll try and get a copy of the faces section uploaded for you to look at.
reason i know eyes and hair are remapable is, all eyes are (remap) blue, and all hair is black(IIRC). therefore, it shouldn't be too hard to make sure when it creates hair, eyebrows and facial hair, that it creates them all of the same colour.
also, you should be able to fudge in more tie colours by using the blue tie(like in my avatar) as a remapable version.
next time i'm on my laptop, I'll try and get a copy of the faces section uploaded for you to look at.
reason i know eyes and hair are remapable is, all eyes are (remap) blue, and all hair is black(IIRC). therefore, it shouldn't be too hard to make sure when it creates hair, eyebrows and facial hair, that it creates them all of the same colour.
also, you should be able to fudge in more tie colours by using the blue tie(like in my avatar) as a remapable version.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
- BoominGranny
- Engineer
- Posts: 85
- Joined: 18 Apr 2006 02:16
- Location: Wellington, New Zealand
- Contact:
Changes:
7/may/06:
Added Set Default button - that saves the current face as your default for new games
Moved Randomize Face - you now randomize your face by clicking on the picture!
(please use the diff on my first post - it has been updated with these changes)
MeusH - sure thing i'll remember for next time! i just didn't want to "SPAM" people about my patch...
bobingabout - when im at home i will try and have a look at how this colour mapping works in the file that draws the face... it was really confusing code the first time i looked at it... then i can perhaps redo the face drawing code and then have the face number so it includes the colours of face objects and makes a bit more sence (i will make the skin tone have its own bit - infact maybe i will make it 3 or 4 bits so there can be a few skin tones in there....)
7/may/06:
Added Set Default button - that saves the current face as your default for new games
Moved Randomize Face - you now randomize your face by clicking on the picture!
(please use the diff on my first post - it has been updated with these changes)
MeusH - sure thing i'll remember for next time! i just didn't want to "SPAM" people about my patch...
bobingabout - when im at home i will try and have a look at how this colour mapping works in the file that draws the face... it was really confusing code the first time i looked at it... then i can perhaps redo the face drawing code and then have the face number so it includes the colours of face objects and makes a bit more sence (i will make the skin tone have its own bit - infact maybe i will make it 3 or 4 bits so there can be a few skin tones in there....)
- BoominGranny
- Engineer
- Posts: 85
- Joined: 18 Apr 2006 02:16
- Location: Wellington, New Zealand
- Contact:
if you want to be able to save it for good:
open your openttd.cfg (after you've hit set with my patch)
look at the line near the very top under [misc]:
player_face = 594158407
copy the number and that is your players unique face value.
Perhaps i could make the screen so it shows it to you and allows you to enter it? It would be overkill imo to make a save/load just for a one number - its already saved in the savegame...
open your openttd.cfg (after you've hit set with my patch)
look at the line near the very top under [misc]:
player_face = 594158407
copy the number and that is your players unique face value.
Perhaps i could make the screen so it shows it to you and allows you to enter it? It would be overkill imo to make a save/load just for a one number - its already saved in the savegame...
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
well, the save/load i would want is press save, and it brings up a save face window, then you can enter a name, like for me Tash, then when i play again, instead of creating a new face, just press load and load the face Tash...
however, the unique number thing isn't too hard to do either.
about the face, it'll probably be easier for you to extract the files yourself, download GRFCodec
http://www.ttdpatch.net/grfcodec/
follow the instructions and use the command grfcodec -e trg1.grf, It'll create a PCX and somwhere in there will be the faces, just look for them. Problem is windows XP doesn't open PCX files by default, so, you might want to convert them using infanview. you should be able to come up with something good,
and maybe with the help of peter, or, someone else, add a NewGRF support for new face features? also, the ability to load a PNG file for the face is a good idea, you could have your freaky avatar ingame
however, the unique number thing isn't too hard to do either.
about the face, it'll probably be easier for you to extract the files yourself, download GRFCodec
http://www.ttdpatch.net/grfcodec/
follow the instructions and use the command grfcodec -e trg1.grf, It'll create a PCX and somwhere in there will be the faces, just look for them. Problem is windows XP doesn't open PCX files by default, so, you might want to convert them using infanview. you should be able to come up with something good,
and maybe with the help of peter, or, someone else, add a NewGRF support for new face features? also, the ability to load a PNG file for the face is a good idea, you could have your freaky avatar ingame
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Who is online
Users browsing this forum: No registered users and 13 guests