How do you display a character based on a choice?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

How do you display a character based on a choice?

#1 Post by ArizaLuca »

So I'm creating a game, and I want to display a character based on a choice. The game involves about twelve different versions of the main character, and I want it so that if you pick a certain combination of choices, you get a certain version. However, I don't know how to code this.

An example of what I would like is if the game asks, "What gender is your character?" And you pick Female, for instance.

Then the game asks, "What ethnicity is your character?" And let's say you pick Asian as an option.

And then your character is the female asian variant.

I'm sorry if this is unclear, I don't know how to put it! Please consider it being something like... Minecraft Story Mode? (You pick a variant and the game displays that variant for the remainder of, well, the game.)

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: How do you display a character based on a choice?

#2 Post by rayminator »

what you want to is complicated to do.
what type of game are you planning to make and all age or adult?

you can look at this but it might not help as much but look at #1 it selecting characters gallery it have the characters image of themselves and it points to their gallery
How to make a character selection page for gallery

then you have change that code

but for each character you have point them to the proper line for each character

adult example

char A male
I'm going to cum inside you

char B female
Cum inside me

cause is the user choices to be a male it will have to point to the male line in the game
if the user choices to be a female it will have to point to the female line in the game

hopes this helps but i doubt it

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: How do you display a character based on a choice?

#3 Post by ArizaLuca »

It's not quite what I'm looking for, but thanks for the suggestion.

It's basically a Minecraft: Story Mode fangame; mostly for all ages (maybe some PG to PG-13 stuff, like violence or whatnot).

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: How do you display a character based on a choice?

#4 Post by mitoky »

I dont know if its the best way, but you can use condition switch and variables.

First, make for all images with condition switch.
Example:

Code: Select all

main character normal = ConditionSwitch(
    "main_character == 1", "main_two_normal.png",
    "main_character == 2", "main_two_normal.png",
    "main_character == 3", "main_three_normal.png",
    "main_character == 4", "main_four_normal.png",
    "main_character == 5", "main_five_normal.png",
    "main_character == 6", "main_six_normal.png",
    "main_character == 7", "main_seven_normal.png",
    "main_character == 8", "main_eight_normal.png")
And declare your variables, both for the choices and the character (1 is the default sprite/no changes)

Code: Select all

default main_character = 1
default eye_color = 1
default hair_color = 1
default skin color = 1
And now to your choices :

Code: Select all

"What is your eye color?"

menu:
    "Blue":
        pass

    "Brown":
        $ eye_color += 1        
        
"What is your hair color?"

menu:
    "Blond":
        pass

    "Brown":
        $ hair_color += 1 

"What is your skin color?"

menu:
    "Pale":
        pass

    "Dark":
        $ skin_color += 1  


"Summed Up..."

#character 1
if eye_color == 1 and hair_color == 1 and skin_color == 1:
    $ pass
#character 2
elif eye_color == 2 and hair_color == 1 and skin_color == 1:
    $ main_character += 1
#character 3
elif eye_color == 1 and hair_color == 2 and skin_color == 1:
    $ main_character += 2
#character 4
elif eye_color == 1 and hair_color == 1 and skin_color == 2:
    $ main_character += 3   
#character 5  
elif eye_color == 1 and hair_color == 2 and skin_color == 2:
    $ main_character += 4   
#character 6
elif eye_color == 2 and hair_color == 1 and skin_color == 2:
    $ main_character += 5   
#character 7
elif eye_color == 2 and hair_color == 2 and skin_color == 1:
    $ main_character += 6
#character 8
elif eye_color == 2 and hair_color == 2 and skin_color == 2:
    $ main_character += 7

show main character normal
"That is you?"

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: How do you display a character based on a choice?

#5 Post by ArizaLuca »

That looks like it might be right... thank you! I'll definitely try it.

Post Reply

Who is online

Users browsing this forum: No registered users