Page 1 of 1

Looking for Programmer for code assistance

Posted: Mon Sep 18, 2017 2:18 pm
by Supa
I am very new to the Ren'Py scene and new to general programming. While I'm trying to work entirely on my own with my dating sim, some coding hiccups occured that I don't know how to fix.

I want to try and implement a character creator portion to my game in which the final creation becomes the portrait art for the player character that appears next to their text. I managed to find a tutorial in the cookbook but I've run into coding issues that haven't seem to be resolved yet. The thread can be found here. It should include everything that I described that I want to accomplish for my game.

I have the opening scene before the character creation portion put into the script ready for tweaking once I add the appropriate assets, and I have placeholder assets for the images I plan to incorporate into the character creator all ready for testing the code if need be.

Please get in touch if you can help, I would very much appreciate it!

Link fixed - Taleweaver

Re: Looking for Programmer for code assistance

Posted: Mon Sep 18, 2017 8:53 pm
by Scribbles
Your link does not work for me...

It's actually fairly simple to do if you brush up on Condition Switch code and Dynamic Displayables:
https://www.renpy.org/doc/html/displaya ... tionSwitch

basically break all the images up into separate parts, layer them, and allow the user to adjust the variable with a text/imagebutton -- then define the images as a LiveComposite with Condition Switches. the site even has an example of the code, but here is a bit of code I used to help.

Code: Select all

image you = LiveComposite((345, 648), ##these numbers are the size of your sprite
                                        (0, 0), ConditionSwitch(
                                            "protagskin == 0", "protagskin0.png", ## if protagskin == 0 then use image "protagskin0.png"
                                            "protagskin == 1", "protagskin1.png",
                                            "protagskin == 2", "protagskin2.png",
                                            ),
                                        (0, 0), ConditionSwitch(
                                            "protaghair == 0", "protaghair0.png",
                                            "protaghair == 1", "protaghair1.png",
                                            "protaghair == 2", "protaghair2.png",

                                            ),
                                        )
you can do this with clothing/hair/ and so on. you just need to design a screen and then use text or image button actions to adjust the variable:

Code: Select all

textbutton "Hair Color ->" action SetVariable("protaghair", (protaghair+1)%3) ##three is the number of possible options
textbutton "<- Hair Color" action SetVariable("protaghair", (protaghair-1)%3)
there are a ton of ways to do this though, but hopefully that will atleast point you in the right direction. (sorry if I told you nothing new -- the link would not open anything for me it just went to an error page)