Dollmaker optional outfit pieces (Image composite)

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
RedAppleV1
Newbie
Posts: 6
Joined: Sat May 22, 2021 10:40 am
Tumblr: redapplev
Contact:

Dollmaker optional outfit pieces (Image composite)

#1 Post by RedAppleV1 »

Okay so, I was creating a dollmaker and I wanted to give my character optional clothing pieces. I used the conditional switch but I don't know how to implant it correctly... I am using an imagemap to show certain options, but I don't know how I can enable or disable certain clothing pieces. The optional piece I wanna do is backhair. (Please also note I am not a professional Renpy user)

Code: Select all

init:
    default skin_color = 1
    default hair_color = 1
    default front_hair = 1
    default front_hair_max = 10
    default back_hair = 1
    default back_hair_max = 9
    default back_hair2 = 1
    default eye_color = 1
    default eye_shape = 1
    default eye_shape_max = 3
    default eyebrows = 1
    default eyebrows_max = 8
    default topfem = 1
    default vest = 1
    default jacket = 1
    default bottom_choice = 1
    default socks = 1
    default socks_max = 6
    default shoe = 1
image girlbase = Composite(
    (467, 870),
    (0, 0), "Create_Character/Base/base[skin_color].png",
    (0, 0), "Create_Character/Socks/socks[skin_color].png",
    (0, 0), "Create_Character/Shoes/shoes[shoe].png",
    (0, 0), "Create_character/Eyes/eyes[eye_color].png",
    (0, 0), "Create_character/EyesShape/eyes[eye_shape].png",
    (0, 0), "Create_character/Mouth/mouth1_1.png",
    (0, 0), "Create_character/Eyebrows/eyebrows[eyebrows].png",
    (0, 0), "Create_character/Hair/hair[hair_color].png",
    (0, 0), "Create_character/Backhair/backhair[back_hair]_[hair_color].png",
    (0, 0), "Create_character/Bottoms/bottom[bottom_choice].png",
    (0, 0), "Create_character/Tops/top[topfem].png",
    (0, 0), "Create_character/Vests/vest[vest].png",
    (0, 0), "Create_character/Jackets/jacket[jacket].png",
    (0, 0), ConditionSwitch(
        "back_hair2 == False", Null(),
        "True", "Create_character/Backhair2/backhairf1_[hair_color].png"),
    (0, 0), "Create_character/FrontHair/fronthair[front_hair]_[hair_color].png",
)


screen dressfem():
    modal True

    imagemap:
        ground "Dressup_Screen/test.png"

        ##Fronthair##
        hotspot(65, 30, 41, 75) action If(front_hair > 1, SetVariable("front_hair", front_hair - 1), SetVariable("front_hair", 1))
        hotspot(553, 19, 41, 71) action If(front_hair < front_hair_max, SetVariable("front_hair", front_hair + 1), SetVariable("front_hair", front_hair_max))

        ##Backhair##
        hotspot(49, 148, 57, 86) action If(back_hair > 1, SetVariable("back_hair", back_hair - 1), SetVariable("back_hair", 1))
        hotspot(544, 138, 49, 75) action If(back_hair < back_hair_max, SetVariable("back_hair", back_hair + 1), SetVariable("back_hair", back_hair_max))

        ##Eye Shape##
        hotspot(639, 14, 49, 79) action If(eye_shape > 1, SetVariable("eye_shape", eye_shape - 1), SetVariable("eye_shape", 1))
        hotspot(1158, 11, 54, 85) action If(eye_shape < eye_shape_max, SetVariable("eye_shape", eye_shape + 1), SetVariable("eye_shape", eye_shape_max))

        ##Eye brows##
        hotspot(627, 456, 37, 74) action If(eyebrows > 1, SetVariable("eyebrows", eyebrows - 1), SetVariable("eyebrows", 1))
        hotspot(1136, 442, 55, 95) action If(eyebrows < eyebrows_max, SetVariable("eyebrows", eyebrows + 1), SetVariable("eyebrows", eyebrows_max))

        ##Skin Color##
        hotspot(78, 745, 57, 63) action SetVariable("skin_color", 1)
        hotspot(158, 743, 57, 63) action SetVariable("skin_color", 2)
        hotspot(241, 745, 57, 62) action SetVariable("skin_color", 3)
        hotspot(320, 742, 61, 63) action SetVariable("skin_color", 4)
        hotspot(403, 750, 58, 61) action SetVariable("skin_color", 5)


        ##Hair Color##
        hotspot(90, 367, 56, 60) action SetVariable("hair_color", 1)
        hotspot(167, 365, 58, 63) action SetVariable("hair_color", 2)
        hotspot(251, 363, 59, 65) action SetVariable("hair_color", 3)
        hotspot(333, 365, 56, 62) action SetVariable("hair_color", 4)
        hotspot(415, 363, 56, 59) action SetVariable("hair_color", 5)
        hotspot(92, 469, 57, 63) action SetVariable("hair_color", 6)
        hotspot(169, 470, 60, 58) action SetVariable("hair_color", 7)
        hotspot(254, 467, 56, 61) action SetVariable("hair_color", 8)
        hotspot(333, 464, 59, 63) action SetVariable("hair_color", 9)
        hotspot(413, 470, 60, 64) action SetVariable("hair_color", 10)
        hotspot(90, 576, 61, 63) action SetVariable("hair_color", 11)
        hotspot(171, 576, 60, 62) action SetVariable("hair_color", 12)
        hotspot(257, 577, 57, 61) action SetVariable("hair_color", 13)
        hotspot(336, 572, 57, 65) action SetVariable("hair_color", 14)


        ##Eye Color##
        hotspot(698, 259, 56, 62) action SetVariable("eye_color", 1)
        hotspot(780, 256, 55, 65) action SetVariable("eye_color", 2)
        hotspot(863, 258, 56, 61) action SetVariable("eye_color", 3)
        hotspot(941, 258, 57, 63) action SetVariable("eye_color", 4)
        hotspot(1019, 252, 61, 63) action SetVariable("eye_color", 5)
        hotspot(696, 363, 61, 60) action SetVariable("eye_color", 6)
        hotspot(780, 360, 54, 58) action SetVariable("eye_color", 7)
        hotspot(863, 355, 56, 66) action SetVariable("eye_color", 8)
        hotspot(943, 356, 57, 63) action SetVariable("eye_color", 9)

        ##Continue##
        hotspot(1661, 14, 236, 80) action Return()

        ##Clothes##
        hotspot(58, 876, 437, 137) action Show("schoolclothes"), Hide("dressfem")

    add "girlbase":
        size(1800, 2800)
        pos(-300, -50)
        zoom 0.5

screen schoolclothes:
    modal True

    imagemap:
        ground "Dressup_Screen/test2.png"

        ##tops##
        hotspot(126, 134, 56, 60) action SetVariable("topfem", 1)
        hotspot(206, 137, 58, 60) action SetVariable("topfem", 2)

        ##bottoms##
        hotspot(125, 928, 57, 64) action SetVariable("bottom_choice", 1)
        hotspot(205, 928, 57, 59) action SetVariable("bottom_choice", 2)
        hotspot(275, 928, 57, 61) action SetVariable("bottom_choice", 3)
        hotspot(352, 927, 60, 62) action SetVariable("bottom_choice", 4)

        ##Vests##
        hotspot(122, 345, 60, 63) action SetVariable("vest", 1)
        hotspot(205, 345, 57, 62) action SetVariable("vest", 2)

        ##Jackets##
        hotspot(102, 546, 59, 59) action SetVariable("jacket", 1)
        hotspot(181, 544, 61, 62) action SetVariable("jacket", 2)
        hotspot(252, 542, 61, 63) action SetVariable("jacket", 3)

        ##shoes##
        hotspot(120, 737, 61, 61) action SetVariable("shoe", 1)
        hotspot(199, 738, 63, 61) action SetVariable("shoe", 2)
        hotspot(273, 736, 59, 64) action SetVariable("shoe", 3)
        hotspot(353, 734, 61, 65) action SetVariable("shoe", 4)

        ##Back##
        hotspot(1783, 3, 99, 55) action Show("dressfem"), Hide("schoolclothes")
    add "girlbase":
        size(1800, 2800)
        pos(-300, -50)
        zoom 0.5

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Dollmaker optional outfit pieces (Image composite)

#2 Post by _ticlock_ »

RedAppleV1 wrote: Tue Dec 06, 2022 10:30 pm
1) You can simply use back_hair = 0 as index for null image:

Code: Select all

image girlbase = Composite(
    (467, 870),
    (0, 0), "Create_Character/Base/base[skin_color].png",
    (0, 0), "Create_Character/Socks/socks[skin_color].png",
    (0, 0), "Create_Character/Shoes/shoes[shoe].png",
    (0, 0), "Create_character/Eyes/eyes[eye_color].png",
    (0, 0), "Create_character/EyesShape/eyes[eye_shape].png",
    (0, 0), "Create_character/Mouth/mouth1_1.png",
    (0, 0), "Create_character/Eyebrows/eyebrows[eyebrows].png",
    (0, 0), "Create_character/Hair/hair[hair_color].png",
    (0, 0), ConditionSwitch(
    		"back_hair == 0", Null(),
    		"True", "Create_character/Backhair/backhair[back_hair]_[hair_color].png",
    		)
    (0, 0), "Create_character/Bottoms/bottom[bottom_choice].png",
    (0, 0), "Create_character/Tops/top[topfem].png",
    (0, 0), "Create_character/Vests/vest[vest].png",
    (0, 0), "Create_character/Jackets/jacket[jacket].png",
    (0, 0), "Create_character/FrontHair/fronthair[front_hair]_[hair_color].png",
)
In this case, you also need to change min_value of back_hair to 0:

Code: Select all

##Backhair##
        hotspot(49, 148, 57, 86) action If(back_hair > 0, SetVariable("back_hair", back_hair - 1), SetVariable("back_hair", 0))

RedAppleV1
Newbie
Posts: 6
Joined: Sat May 22, 2021 10:40 am
Tumblr: redapplev
Contact:

Re: Dollmaker optional outfit pieces (Image composite)

#3 Post by RedAppleV1 »

Late reply, but it works! Thank you!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Andredron, Bing [Bot]