Main character customization in game?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- TheGameGirl
- Newbie
- Posts: 6
- Joined: Sun Apr 06, 2014 1:06 pm
- Github: https://github.com/Sirencove
- Location: San Diego
- Contact:
Main character customization in game?
I feel the question I am asking is one that has been expressed many times but I could never seem to find a clear answer to it.
How does one implement a character customization option in their game?
I have seen it done, and entire programs are based on, for example iicharacter. I was hoping to implement something on a smaller scale like this for the players of my game. Simple things like changing their characters clothes, eye color, skin color, etc. On a side note, how do I also code it so the changes the player makes to the character will change the character on screen for the game. For example, if by default the character has blonde hair, and I change it to brown, how can I make it so the brown haired version is the one that shows up in the game?
Hopefully I have provided enough info for anyone to properly answer my question, thank you in advance for any help you can offer!
(PS I have programmed extensively on ren'py before but I have rarely been on this site or active on it so if I amde a mistake or something let me know!)
How does one implement a character customization option in their game?
I have seen it done, and entire programs are based on, for example iicharacter. I was hoping to implement something on a smaller scale like this for the players of my game. Simple things like changing their characters clothes, eye color, skin color, etc. On a side note, how do I also code it so the changes the player makes to the character will change the character on screen for the game. For example, if by default the character has blonde hair, and I change it to brown, how can I make it so the brown haired version is the one that shows up in the game?
Hopefully I have provided enough info for anyone to properly answer my question, thank you in advance for any help you can offer!
(PS I have programmed extensively on ren'py before but I have rarely been on this site or active on it so if I amde a mistake or something let me know!)
- 78909087
- Veteran
- Posts: 277
- Joined: Sat Aug 16, 2014 2:33 pm
- Completed: Dungeons and Don't Do It, Wake Up
- Projects: Lethe
- IRC Nick: Pacermist
- Contact:
Re: Main character customization in game?
From what I understand I believe you'll probably be using python.
I'm not an expert but maybe my rambling might help someone with better understanding to help you.
So saying you have four options with four choices; eyes-4 hair-4 clothes-4 skin-4, the total number of possible combinations is 24.
What I would do- which is a lot of coding, would have 24 possible character options for the code to put together at the end. Trust me this probably isn't the best choice.
eg; choosing
Brown eyes, Brown hair, Leather clothes, Olive skin.
then have batches of images arranged first by eye colour, then hair, then clothes, then skin.
so it would go
START
*chooses brown eyes*
jump Browneyes
*chooses brown hair*
jump BrowneyesBrownhair
*chooses leather*
jump BrowneyesBrownhairLeatherclothes
*chooses olive skin*
$ Characterimage = "BrownBrownLeatherOlive.jpg"
Then use the python defined image Characterimage where its needed, I guess...
Sorry I wish I was more helpful, ahaha.
I'm not an expert but maybe my rambling might help someone with better understanding to help you.
So saying you have four options with four choices; eyes-4 hair-4 clothes-4 skin-4, the total number of possible combinations is 24.
What I would do- which is a lot of coding, would have 24 possible character options for the code to put together at the end. Trust me this probably isn't the best choice.
eg; choosing
Brown eyes, Brown hair, Leather clothes, Olive skin.
then have batches of images arranged first by eye colour, then hair, then clothes, then skin.
so it would go
START
*chooses brown eyes*
jump Browneyes
*chooses brown hair*
jump BrowneyesBrownhair
*chooses leather*
jump BrowneyesBrownhairLeatherclothes
*chooses olive skin*
$ Characterimage = "BrownBrownLeatherOlive.jpg"
Then use the python defined image Characterimage where its needed, I guess...
Sorry I wish I was more helpful, ahaha.
- Ryuushiro
- Regular
- Posts: 64
- Joined: Fri Jun 29, 2012 8:24 pm
- Completed: Artist for "Maid With Perfection", Artist for "Love and Romance: a study of intimacy", art for "Sleepier & Sleepier", Backgrounds for "Panzer Hearts", Sketch backgrounds for "Caramel Mokaccino DEMO
- Projects: "Hunting Fable"
- Tumblr: wafflemeido
- Deviantart: WaffleMeido
- Skype: wafflemeido
- Location: Brazil
- Contact:
Re: Main character customization in game?
Hello, friend~
I've just sucessfully learned how to work with character creation, so I'll try to help by explanning what I did and what I've got~
First off,take a look at this topic:
http://lemmasoft.renai.us/forums/viewto ... 51&t=14559
It's a dress up game code by the talented leon. I worked on my code using that. I suggest you download the exemple with Hues made by Another (super talented too, of course) if you want different colors for the same hair, and work with that one.
Change the image files on the game folder with the ones you would like to use for your character, and if you want to make the character's name changeable by the player, you should to define the 'character' created by the dress up as the [name] you'll be using, if I'm not mistaken...This part kinda confused me a lot ;u; if you need help with it just say so and I'll checkmy script when I get home to see what I did to get that to work.
I also had a really hard time with changing the Hues to make it work properly, and my final result was obtained by trial and error, really.
This is what my character creation looked like when I replaced all images with my own drawings and changed the hair hues:
http://i.gyazo.com/b85a119f272f973e3b2051fdcbd4329d.gif
sadly I couldn't show all options on this little gif, but you get the idea. It also doesn't show the cursor but I was clicking those arrows to make changes.
okay so- this code has a side image implemented. So whatever changes you make, your character's portrait will show up as you made them.
Anyway, here is the working thing (on a very, VERY unfinished game ;u; just pay atention to the working side image, please!)
https://fbcdn-sphotos-h-a.akamaihd.net/ ... 440ea8e868
What I could not do though, was change the character's expression. For that, I would need to change her 'base' (where her mouth and eyebrows are drawn) in the middle of dialogues. I'm pretty sure there should be a way but I cannot for the life of me do it. Maybe someone will come along and help ;u;
That's kinda it, sorry if I'm not good at explainning things ;-;
So yeah! tl;dr: the dressup game code works just fine for character creation, but I did not manage to learn how to make expressions work along with it. But still, maybe it'll help you?
I've just sucessfully learned how to work with character creation, so I'll try to help by explanning what I did and what I've got~
First off,take a look at this topic:
http://lemmasoft.renai.us/forums/viewto ... 51&t=14559
It's a dress up game code by the talented leon. I worked on my code using that. I suggest you download the exemple with Hues made by Another (super talented too, of course) if you want different colors for the same hair, and work with that one.
Change the image files on the game folder with the ones you would like to use for your character, and if you want to make the character's name changeable by the player, you should to define the 'character' created by the dress up as the [name] you'll be using, if I'm not mistaken...This part kinda confused me a lot ;u; if you need help with it just say so and I'll checkmy script when I get home to see what I did to get that to work.
I also had a really hard time with changing the Hues to make it work properly, and my final result was obtained by trial and error, really.
This is what my character creation looked like when I replaced all images with my own drawings and changed the hair hues:
http://i.gyazo.com/b85a119f272f973e3b2051fdcbd4329d.gif
sadly I couldn't show all options on this little gif, but you get the idea. It also doesn't show the cursor but I was clicking those arrows to make changes.
okay so- this code has a side image implemented. So whatever changes you make, your character's portrait will show up as you made them.
Anyway, here is the working thing (on a very, VERY unfinished game ;u; just pay atention to the working side image, please!)
https://fbcdn-sphotos-h-a.akamaihd.net/ ... 440ea8e868
What I could not do though, was change the character's expression. For that, I would need to change her 'base' (where her mouth and eyebrows are drawn) in the middle of dialogues. I'm pretty sure there should be a way but I cannot for the life of me do it. Maybe someone will come along and help ;u;
That's kinda it, sorry if I'm not good at explainning things ;-;
So yeah! tl;dr: the dressup game code works just fine for character creation, but I did not manage to learn how to make expressions work along with it. But still, maybe it'll help you?
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
Re: Main character customization in game?
As for changing the expressions, it's not different from the clothes, except it's not up to user choice
quick & dirty:
Create the facial features you need, say "1 - neutral" "2-smile" "3-sad", and include them in the composite.
eg: (0, 0), "mood%d.png"%mood, with mood the new variable
To animate the text, you'll do something like:
it's probably cleaner to create 3 dynamic displaybles:
char neutral : composite with mood.1.png
char happy : composite with mood2.png
char sad : composite with mood3.png
This ways the text writing will revert to "normal" renpy syntax:
quick & dirty:
Create the facial features you need, say "1 - neutral" "2-smile" "3-sad", and include them in the composite.
eg: (0, 0), "mood%d.png"%mood, with mood the new variable
To animate the text, you'll do something like:
Code: Select all
$ mood=1
char " I experience mood swings"
$ mood =2
char "sometimes I'm happy"
$ mood =3
char "and sometimes I'm sad"
char neutral : composite with mood.1.png
char happy : composite with mood2.png
char sad : composite with mood3.png
This ways the text writing will revert to "normal" renpy syntax:
Code: Select all
char neutral " I experience mood swings"
char happy "sometimes I'm happy"
char sad "and sometimes I'm sad"
- Ryuushiro
- Regular
- Posts: 64
- Joined: Fri Jun 29, 2012 8:24 pm
- Completed: Artist for "Maid With Perfection", Artist for "Love and Romance: a study of intimacy", art for "Sleepier & Sleepier", Backgrounds for "Panzer Hearts", Sketch backgrounds for "Caramel Mokaccino DEMO
- Projects: "Hunting Fable"
- Tumblr: wafflemeido
- Deviantart: WaffleMeido
- Skype: wafflemeido
- Location: Brazil
- Contact:
Re: Main character customization in game?
Hmm somehow that's not really working for me, but I'm pretty sure I must have forgotten something (I'm very very slow, please forgive me ;-; )
I tried what you said and weirdly enough, it only works sometimes here (???)
Okay, so...here is what I did to the code:
then it does work after choosing the character's name:
But stops working at the actual game for some reason...
I must have done something terribly wrong ;u; ahaha
base1.png is neutral, base2.png is smilling and base3.png is sad.
I'm really confused hmm
I tried what you said and weirdly enough, it only works sometimes here (???)
Okay, so...here is what I did to the code:
Code: Select all
globals()["doll"] = im.Composite(
(361, 702), # image size
(0, 80), "base%d.png"%base,
(0, 80), "glasses%d.png"%glasses, # (0, 0) is the position of a dressup item. Because these images are saved with spacing around them, we don't need to position them.
(0, 80), im.MatrixColor("hair%d.png"%hair, huearray[hue]),
(0, 80), "shirt%d.png"%shirt,
(0, 80), "tie%d.png"%tie,
then it does work after choosing the character's name:
Code: Select all
$ base = 1
pov "My name is [povname]!"
$ base = 2
pov "Sometimes I'm happy"
$ base = 3
pov "Sometimes I'm sad."
pov "This is my default appearance."
pov "Let's change it to how you prefer."
$ base =1
But stops working at the actual game for some reason...
Code: Select all
l "That was the plan, remember?"
$ base = 2
pov "Yeah..."
"I gave her a small reassuring smile. Yeah, we talked a lot about that last year."
I must have done something terribly wrong ;u; ahaha
base1.png is neutral, base2.png is smilling and base3.png is sad.
I'm really confused hmm
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
Re: Main character customization in game?
I suspect it's because base is assumed to be a local variable when you assign to it, unless you specify
"global base" before
Since it's going to be a PITA to declare this in every label, i suggest going the "clean way",
by defining 3 images pov happy , pov sad etc
"global base" before
Since it's going to be a PITA to declare this in every label, i suggest going the "clean way",
by defining 3 images pov happy , pov sad etc
Re: Main character customization in game?
Here's one option to adapt your code:
Note: I see a lot of people use 0.1 for the refresh rate of their Dynamic Display, but there's usually no need unless you have some kind of animation : the display refreshes at every interaction anyway...
then
edit: I don't really know how/where glasses/hair etc are stored, and how you define them, so you might need to adapt a bit more.
I dabbled in a more complete "dress up" module, with :
- a character class, with "intrinsic" properties like .skin , .hair and a .wearing list
- a clothing class, with .name , .pic_path , .render_priority
then the function "draw doll" that use any "clothing" in character.wearing, with the mood passed as a variable...
It's a bit more complex at first, but it allows to specify individual clothing pieces and useful if there's a lot of possible combinations
I'll post if if anyone is interested...
Code: Select all
def doll(st,at,base):
return im.Composite(
(361, 702), # image size
(0, 80), "base%d.png"%base,
(0, 80), "glasses%d.png"%glasses, # (0, 0) is the position of a dressup item. Because these images are saved with spacing around them, we don't need to position them.
(0, 80), im.MatrixColor("hair%d.png"%hair, huearray[hue]),
(0, 80), "shirt%d.png"%shirt,
(0, 80), "tie%d.png"%tie) , None
image pov neutral = DynamicDisplay(doll(),base=1)
image pov happy = DynamicDisplay(doll(),base=2)
image pov sad = DynamicDisplay(doll(),base=3)
then
Code: Select all
pov neutral "My name is [povname]!"
pov happy "Sometimes I'm happy"
pov sad "Sometimes I'm sad."
pov neutral "This is my default appearance."
pov "Let's change it to how you prefer."
I dabbled in a more complete "dress up" module, with :
- a character class, with "intrinsic" properties like .skin , .hair and a .wearing list
- a clothing class, with .name , .pic_path , .render_priority
then the function "draw doll" that use any "clothing" in character.wearing, with the mood passed as a variable...
It's a bit more complex at first, but it allows to specify individual clothing pieces and useful if there's a lot of possible combinations
I'll post if if anyone is interested...
- Ryuushiro
- Regular
- Posts: 64
- Joined: Fri Jun 29, 2012 8:24 pm
- Completed: Artist for "Maid With Perfection", Artist for "Love and Romance: a study of intimacy", art for "Sleepier & Sleepier", Backgrounds for "Panzer Hearts", Sketch backgrounds for "Caramel Mokaccino DEMO
- Projects: "Hunting Fable"
- Tumblr: wafflemeido
- Deviantart: WaffleMeido
- Skype: wafflemeido
- Location: Brazil
- Contact:
Re: Main character customization in game?
Tried what you said and it gives me this error:
So I thought 'hey, maybe it's supposed to be 'dynamicdisplayable', but it still gives me an error, so I have no idea.
Well, this has proven to be quite the challenge for my very shallow knowledge of coding. I think I'm trying to bite off more than can chew haha ;u; *keeps trying to make it work somehow*
Code: Select all
While executing init code:
File "game/script.rpy", line 119, in script
image pov neutral = DynamicDisplay (doll(),base=1)
File "game/script.rpy", line 119, in <module>
image pov neutral = DynamicDisplay (doll(),base=1)
NameError: name 'DynamicDisplay' is not defined
So I thought 'hey, maybe it's supposed to be 'dynamicdisplayable', but it still gives me an error, so I have no idea.
Code: Select all
While executing init code:
File "game/script.rpy", line 119, in script
image pov neutral = DynamicDisplayable(doll(),base=1)
File "game/script.rpy", line 119, in <module>
image pov neutral = DynamicDisplayable(doll(),base=1)
TypeError: 'Composite' object is not callable
Well, this has proven to be quite the challenge for my very shallow knowledge of coding. I think I'm trying to bite off more than can chew haha ;u; *keeps trying to make it work somehow*
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
Re: Main character customization in game?
Sorry, I was typing from memory, on my iphone; so I probably made a typo. I'll correct it when I get access to my PC again later tonight
Edit:
You're right that the correct syntax is DynamicDisplayable.
Can you post the full code for doll ? No typo in 'im.Composite' ?
Edit Edit: Brasileiro ?
Edit:
You're right that the correct syntax is DynamicDisplayable.
Can you post the full code for doll ? No typo in 'im.Composite' ?
Edit Edit: Brasileiro ?
- Ryuushiro
- Regular
- Posts: 64
- Joined: Fri Jun 29, 2012 8:24 pm
- Completed: Artist for "Maid With Perfection", Artist for "Love and Romance: a study of intimacy", art for "Sleepier & Sleepier", Backgrounds for "Panzer Hearts", Sketch backgrounds for "Caramel Mokaccino DEMO
- Projects: "Hunting Fable"
- Tumblr: wafflemeido
- Deviantart: WaffleMeido
- Skype: wafflemeido
- Location: Brazil
- Contact:
Re: Main character customization in game?
Okay, I see no typos but maybe I just didn't noticed them... I'm just going to post the whole thing here, because I'm pretty sure that I changed so much stuff that I actually messed up at some point and forgot to change some particular part or replaced something that I shouldn't.
I'll just take out the actual game and dialogue, since I think that has nothing to do with the current error.
That's how it looks at the moment. Hmmm...
ps: Sim, brasileira! > u <
I'll just take out the actual game and dialogue, since I think that has nothing to do with the current error.
Code: Select all
init python:
dressup_button_show = False
base, hair, glasses, tie, shirt, pants = 1, 1, 1, 1, 1, 1 # default dressup items
base_num, hair_styles_num, glasses_styles_num, tie_styles_num, shirt_styles_num, pants_styles_num = 3, 9, 4, 4, 4, 3 # number of styles (files) for each dressup item
# define images as:
# "base.png" for the base image
# "hair1.png", "hair2.png", "hair3.png", ... - start with 1 and end with (hair_styles_num)
# "glasses1.png", "glasses2.png", "glasses3.png", ... "tie1.png", "tie2.png", ... "shirt1.png", "shirt2.png", ... "shirt1.png", "pants2.png", ...
import os, time, pygame
def draw_char(st, at): # combine the dressup items into one displayable
# hue1 = im.matrix([ 1, 0, 0, 0, 0,
# 0, .9, 0, -.1, 0,
# 0.85, 1, -1, 0, 0,
# 0, 0, 0, 1, 0 ])
hue8 = im.matrix([ 1, 0, 0, 0, -.4,
0, 1, 0, -.08, -.3,
0.30, 1, -1, 0, 0,
0, 0, 0, 1, 0 ])
hue2 = im.matrix([ 1, 0, 0, 0, -.4,
0, .9, 0, -.1, -.3,
0, -0.1, -1, 0, 0,
0, 0, 0, 1, 0 ])
hue3 = im.matrix([ 1, 0, 0, 0, -2,
0, 1, 0, 0, -.04,
0, 0, 1, 0, .04,
0, 0, 0, 1, 0 ])
hue4 = im.matrix([ 1, 0, 0, 0, .4,
0, 1, 0, 0, .04,
.23, 0, 1, 0, .04,
0, 0, 0, 1, 0 ])
hue5 = im.matrix([ 1, 0, 0, 0, .04,
0, 1, 0, -.1, .04,
-.3, 0, 1, 0, .04,
0, 0, 0, 1, 0 ])
hue6 = im.matrix([ 1, -1, 0, 0, -.8,
0, 1, 0, 0, .2,
0.85, 0.7, 1, 0, 0,
0, 0, 0, 1, 0 ])
hue7 = im.matrix([ 1, 0, 0, 0, -.1,
0, .9, 0, -.1, -.3,
0.28, 0.7, -1, 0, 0,
0, 0, 0, 1, 0 ])
hue1 = im.matrix([ 1, 0, 0, 0, .04,
0, 1, 0, 0, .04,
0, 0, 1, 0, .04,
0, 0, 0, 1, 0 ])
huearray = [hue1,hue2,hue3,hue4,hue5,hue6,hue7,hue8]
def doll(st,at,base):
return im.Composite(
(361, 702), # image size
(0, 80), "base%d.png"%base,
(0, 80), "glasses%d.png"%glasses, # (0, 0) is the position of a dressup item. Because these images are saved with spacing around them, we don't need to position them.
(0, 80), im.MatrixColor("hair%d.png"%hair, huearray[hue]),
(0, 80), "shirt%d.png"%shirt,
(0, 80), "tie%d.png"%tie) , None
if globals()["direction"] == -1:
globals()["doll"] = im.Flip(globals()["doll"], horizontal=True)
return globals()["doll"],.1
def draw_char_side(st, at):
return LiveComposite((361,702), (8,385), im.FactorScale(globals()["doll"], .65)),1
dressup_show = False
dressup_button_show = False
base, hair, glasses, tie, vest, skirt, hue = 1, 1, 1, 1, 1, 1, 0 # default dressup items
base_num, hair_styles_num, glasses_styles_num, tie_styles_num, vest_styles_num, skirt_styles_num, hue_styles_num = 3, 10, 6, 4, 3, 4, 7 # number of styles (files) for each dressup item
#
#
# DEFINE CHARACTERS HERE!!!!! <---------------------------------------------------------
#
define pov = Character(_("[povname]"), color="#FF69B4", show_side_image=DynamicDisplayable(draw_char_side))
define l = Character('Lea', color="#c8ffc8")
define a = Character('Aden', color="#AE0D0D")
define u = Character('???', color="#FFFFFF")
define t = Character('Teacher', color="#FFFFFF")
#
#
# BGS GO HERE!!!!! <---------------------------------------------------------
#
image ccbg = "bgcc.png"
image black = "black.png"
image classbg = "bgclass.jpg"
image hallway = "bghallway.jpg"
#
# CHARACTER SRPITES GO HERE!!! <---------------------------------------------
#
image l neutral = "lea.png"
image a annoyed = "Aden annoyed.png"
image a neutral = "Aden neutral.png"
image a pleased = "Aden pleased.png"
#
#
#
image pov neutral = DynamicDisplayable(doll(),base=1)
image pov happy = DynamicDisplayable(doll(),base=2)
image pov sad = DynamicDisplayable(doll(),base=3)
#
#--------------------------------------------------------------------------------
label start:
scene black with fade
"In this game you play as a girl. You can change your character's appearence and name."
"Let's start with the name."
python:
povname = renpy.input("Type your character's name bellow.")
povname = povname.strip()
if not povname:
povname = "Emily"
"[povname], is that right?"
label justtobesure:
menu:
"Yes":
jump iamsure
"No":
$ povname = ""
jump redoname
label redoname:
python:
povname = renpy.input("Well, what is your name?")
povname = povname.strip()
if not povname:
povname = "Emily"
"[povname], is this right?"
jump justtobesure
init:
image char = DynamicDisplayable(draw_char) # using DynamicDisplayable ensures that any changes are visible immedietly
$ mc_name = Character(pov, color="#FF69B4", show_side_image=DynamicDisplayable(draw_char_side))
$direction = 1
$doll = im.Composite(
(361, 702), # image size
(0, 0), "base%.png",
(0, 0), "glasses1.png",
(0, 0), "hair1.png",
(0, 0), "shirt1.png",
(0, 0), "tie1.png",
(0, 0), "pants1.png"
) # We have to set the variable at start, but Ren'Py will sometimes crash ("can't construct the image in draw_char()") if we set it to None
# show screen dressup_button Taking those off because I don't need a constant dress up buttom- I only need the creator to run once.
# $ dressup_button_show = False
label iamsure:
show char
hide char
pov "My name is [povname]!"
pov "This is my default appearance."
pov "Let's change it to how you prefer."
#screen dressup_button: # a button to call the dressup game
# if dressup_button_show:
# vbox xalign 0.01 yalign 0.01:
# textbutton "Change look." action ui.callsinnewcontext("dressup")
scene ccbg with fade
label dressup:
show char:
xpos 250
python:
# display the arrows for changing the dress:
y = 100
ui.imagebutton("arrowL.png", "arrowL.png", clicked=ui.returns("hueL"), ypos=y, xpos=220)
ui.imagebutton("arrowR.png", "arrowR.png", clicked=ui.returns("hueR"), ypos=y, xpos=600)
y += 80
ui.imagebutton("arrowL.png", "arrowL.png", clicked=ui.returns("hairL"), ypos=y, xpos=220)
ui.imagebutton("arrowR.png", "arrowR.png", clicked=ui.returns("hairR"), ypos=y, xpos=600)
y += 90
ui.imagebutton("arrowL.png", "arrowL.png", clicked=ui.returns("glassesL"), ypos=y, xpos=220)
ui.imagebutton("arrowR.png", "arrowR.png", clicked=ui.returns("glassesR"), ypos=y, xpos=600)
y += 90
ui.imagebutton("arrowL.png", "arrowL.png", clicked=ui.returns("shirtL"), ypos=y+80, xpos=220)
ui.imagebutton("arrowR.png", "arrowR.png", clicked=ui.returns("shirtR"), ypos=y+80, xpos=600)
ui.textbutton("Start Game", clicked=ui.returns("Start Game")) # image button version: ui.imagebutton("return.png", "return_hover.png", clicked=ui.returns("goback"), ypos=0, xpos=0)
$ picked = ui.interact()
# based on the selection, we increase or decrease the index of the appropriate dress up item
if picked == "hueL":
$ hue = hue - 1 # if previous hair is chosen
if hue < 0: # making sure we don't get out of index range (index -1 is not allowed)
$ hue = hue_styles_num
if picked == "hueR":
$ hue = hue + 1 # if next hair is chosen
if hue > hue_styles_num : # making sure we don't get out of index range (index musn't be bigger than hue_styles_num)
$ hue = 0
if picked == "hairL":
$ hair -= 1 # previous hair
if picked == "hairR":
$ hair += 1 # next hair
if hair < 1: # making sure we don't get out of index range (index 0 is not allowed)
$ hair = hair_styles_num
if hair > hair_styles_num: # making sure we don't get out of index range (index musn't be bigger than hair_styles_num)
$ hair = 1
if picked == "glassesL":
$ glasses -= 1
if picked == "glassesR":
$ glasses += 1
if glasses < 1:
$ glasses = glasses_styles_num
if glasses > glasses_styles_num:
$ glasses = 1
if picked == "shirtL":
$ shirt -= 1
if picked == "shirtR":
$ shirt += 1
if shirt < 1:
$ shirt = shirt_styles_num
if shirt > shirt_styles_num:
$ shirt = 1
if picked == "pantsL":
$ pants -= 1
if picked == "pantsR":
$ pants += 1
if pants < 1:
$ pants = pants_styles_num
if pants > pants_styles_num:
$ pants = 1
if picked == "Start Game":
jump confirmlook
jump dressup # we don't want to return on every click, this jump loops until we click on "back" button
label confirmlook:
"Is this how your character looks?"
menu:
"Yes":
jump continuegame
"No":
jump dressup
label continuegame:
scene black with fade
hide char
pov "This is how I look!"
"Your character is done."
ps: Sim, brasileira! > u <
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
Re: Main character customization in game?
Wow... It's a mess
1/ Consistency: you still have both the draw_char and the doll function, both trying to do the same thing. the char image calls draw_char and the doll function is doing nothing...
2/ Indentation: the doll function shouldn't be indented, (and you should remove the def draw_char at the top, which is empty now...
3/ Correct syntax is DynamicDisplayable(doll,base=1) (and not "doll(), base=1)
There's probably a lot of cleanup to do even after this, but it's a start
1/ Consistency: you still have both the draw_char and the doll function, both trying to do the same thing. the char image calls draw_char and the doll function is doing nothing...
2/ Indentation: the doll function shouldn't be indented, (and you should remove the def draw_char at the top, which is empty now...
3/ Correct syntax is DynamicDisplayable(doll,base=1) (and not "doll(), base=1)
There's probably a lot of cleanup to do even after this, but it's a start
- Ryuushiro
- Regular
- Posts: 64
- Joined: Fri Jun 29, 2012 8:24 pm
- Completed: Artist for "Maid With Perfection", Artist for "Love and Romance: a study of intimacy", art for "Sleepier & Sleepier", Backgrounds for "Panzer Hearts", Sketch backgrounds for "Caramel Mokaccino DEMO
- Projects: "Hunting Fable"
- Tumblr: wafflemeido
- Deviantart: WaffleMeido
- Skype: wafflemeido
- Location: Brazil
- Contact:
Re: Main character customization in game?
Oh god I know right? ;7; LMAO as you can see, I'm clearly trying, but I kinda have no idea what I'm doing. I'm learning, though.
I'll try to fix those things...@_@
Thanks
I'll try to fix those things...@_@
Thanks
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
VISIT MY WEBSITE FOR COMMISSIONS: { HERE }
█ Deviantart █ Patreon █
________________
Who is online
Users browsing this forum: No registered users