I am working on my first VN/sim and I'm pretty new to Ren'py and coding in general. I've searched various forums to try and find this answer, so I apologize if I overlooked it or didn't understand the solution I passed up was the right answer.
I'm trying to create a VN/sim with a "stress" stat, but don't want to have a stat bar. Instead, I'm wanting to have a character portrait (side image) that changes based on the percentage of the stress stat. I.E. when stress reaches 10% the character portrait changes. When it hits 20% it changes again. Ect. How would I code that in? I don't want to manually change it each time as I want random events to effect the stress stat, which automatically reflects on the character's side image.
Any help or pointers in the right direction would be very much appreciated!
[SOLVED] Display Side Image IF
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.
-
- Newbie
- Posts: 5
- Joined: Thu Aug 18, 2016 3:49 pm
- Location: Alabama, USA
- Contact:
[SOLVED] Display Side Image IF
Last edited by PandoraSoul on Thu Aug 18, 2016 10:08 pm, edited 1 time in total.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Display Side Image IF
You'll want a ConditionSwitch
https://www.renpy.org/doc/html/displaya ... tionSwitch
https://www.renpy.org/doc/html/displaya ... tionSwitch
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
-
- Newbie
- Posts: 5
- Joined: Thu Aug 18, 2016 3:49 pm
- Location: Alabama, USA
- Contact:
Re: Display Side Image IF
Thank you for your response. Could you be a little more specific with how I could make that work? I didn't find any examples or tutorials when I was looking into Conditionswitches that were doing what I need to do. The closest thing I could find did pertain to changing side images, but it had to be triggered manually.trooper6 wrote:You'll want a ConditionSwitch
https://www.renpy.org/doc/html/displaya ... tionSwitch
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Display Side Image IF
Well, I've never done it before, but I looked at the page I linked to, and the page on side images and made this tester, that works:
Code: Select all
define b = Character('Bill', color="#c8ffc8", image='bill')
default stress = 0
image side bill = ConditionSwitch(
"stress == 9", "face5.png",
"stress == 7", "face4.png",
"stress == 5", "face3.png",
"stress == 3", "face2.png",
"True", "face1.png")
# The game starts here.
label start:
b "Hello."
$ stress=3
b "Hello face 2"
$ stress= 5
b "Hello face 3"
$ stress=7
b "Hello face 4"
$ stress=9
b "Hello face 5"
return
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
-
- Newbie
- Posts: 5
- Joined: Thu Aug 18, 2016 3:49 pm
- Location: Alabama, USA
- Contact:
Re: [SOLVED] Display Side Image IF
Thank you! I guess I just didn't have a strong enough understanding of how the ConditionSwitch worked to realize that was my answer. I appreciate you taking the extra time to show me how to work it!
Who is online
Users browsing this forum: Sugar_and_rice