PDA

View Full Version : Character Customizations



RazorZero
June 1st, 2007, 09:13 PM
I'm trying to decide what's the best way to set up character customizations (for instance, during character creation) for my game but I'm not sure of the way to go. I think vector grapics will be the best idea to reduce the size of the game. However one of the main things I want to add is the ability to use a color picker (of some sort) and allow players to change the colors on their clothing, hair, eyes, skin, etc... plus some things might have multiple colors to change. An example would be grey armor with black highlights and change both of those to different colors.

Now here's my question, what does anyone think would be a good way to go about doing this? Is there a way to find a specific fill color in AS and replace it with a different one? That's the only way I can think of doing this besides manualy changing the colors in Flash and having each different setting be another frame of the main image (i.e. green might be gotoAndStop(39)). Any suggestions or ideas would help out greatlly.

I'm using Flash CS3 and AS2 (I started this game a year ago, and it would take many months to migrate all the code to AS3 :) )

Hansol
June 1st, 2007, 11:30 PM
You can place movieclips in your character movieclip, and when it enters the frame it goes to the specific frame for what ever item they have.

hells demand
June 2nd, 2007, 01:04 AM
Hansol is right but you could always just draw all the images for all the different possible colors you want and turn them into symbols then in the code give each symbol a varible value from 0 to what ever then have a varible that desides what your character's colors acualy are then make a button to change this varible and use this to display your character using code.

it may sound like it would take forever becasue it would and maby make te file size much larger but it is just somsthing else you could do and i think is easier to save the colors like this because you can only save varibles, i'm not that sure, never tryed anything like this.

RazorZero
June 2nd, 2007, 08:00 AM
What I was orignaly thinking was a set up like this (with the MC's stacked on top of each other on different layers):

baseCharImageMC + faceMC + hairMC + clothingMC

Each MC frame would be one "style" like frame 1 is short hair, frame 2 is long hair, etc. Then for each color in the image I could use action script code to let the players change the color to what ever they wanted. But for that to work I'd need to figure out a way to "locate" or "define" those colors and be able to change them and I'm not sure how to do that yet. I also don't know if that is the best way to do character customizations for a game either. Hense all the questions I have about the subject :)

randomagain
June 2nd, 2007, 02:55 PM
i think the best option is mc.visible = true;

have a character set up with different head mc in a master mc for example

then when the user selects a head... long hair

the code on that button would be something like



body.head.long.visible=true;
body.head.short.visible=false;
body.head.punk.visible=false;
etc....


i think this is the best option, from experience timeline wouldn't work

------

if you felt the need, though unecessary you could have a t-shirt colour selector

by having a master t-shirt mc, then within a duplicate which you control the colour of


body.tshirt.tshirtcol.setRGB= red hex code

RazorZero
June 2nd, 2007, 06:48 PM
mc.visible might be interesting. I don't know if it would be more efficient then using different frames though. It also might be kind of hard to manage a lot of images like that. I'll play around with it and see.

As for setRBG, doesn't that change the whole image to the set color? I think I tried that once and it did. I'll try it again to make sure though.

bombingTokyo
June 11th, 2007, 01:42 PM
I'm attempting the same thing, and I ran into the same problem. With my prototype i ended up creating about 3 head shapes, and about 20 different faces, and shirts, etc. Then i created a function which i attached to a color selection box that would change the color of the MC. I looped the face arrays through a main multidimensional array and stored the information in a MySQL database (which i'm sure you can also store in a SharedObject).

Then i added the characters values from the main array to the url string through php. I'm still working out the bugs on it, but it seems to almost be working. For some reason on occasion i end up without a face, or eyes floating.

I dnt know if this will help you or not, but if you get it to work let me know.