Ren'Py how to add side image

qwerty132

Newbie
Aug 3, 2017
44
5
how to add side images to the game Maid mansion

i tried this but it doesnt work
define yu = DynamicCharacter('yuu_name', color='#eee', image ="yu ")
image side yu = "yu.png"

thanks in advance
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
In theory, it should already work... sooooo...

Option1: It doesn't like the extra space character in the image="yu " parameter.

Option2:

Well, I learned something new...

Apparently DynamicCharacter() is the same as specifying with dynamic=True as an option. Allegedly.

Best guess, DynamicCharacter() doesn't honor the image=.

My first impression is that DynamicCharacter() is "older" code. Something that used to be a solution, until something better came along.
All dynamic=True seems to do is use the character's name field as a function instead of an actual name - in all the examples I've found so far... it just simply specifies the name of a variable that contains the real character name.
But every game I've seen in 2+ years does that by using square brackets wrapped around the name of a variable to do text substitution.

Therefore I think the solution is to try:

Python:
define yu = Character("[yu_name]", color="#eee", image="yu")

image side yu = "yu.png"

default yu_name = "Yuu".
I've removed that extra space and changed the definition to use Character() instead of DynamicCharacter().
I've changed the name field to make use of square brackets to refer back to a variable, rather than relying on dynamic=True.
I've also changed the single apostrophe characters ( ' ) to double quotes ( " ) because my OCD would't let me leave them alone.
I've shown a default yu_name= because I consider that good practice. Although the original code already has a default statement further down already.
 
Last edited:

qwerty132

Newbie
Aug 3, 2017
44
5
In theory, it should already work... sooooo...

Option1: It doesn't like the extra space character in the image="yu " parameter.

Option2:

Well, I learned something new...

Apparently DynamicCharacter() is the same as specifying with dynamic=True as an option. Allegedly.

Best guess, DynamicCharacter() doesn't honor the image=.

My first impression is that DynamicCharacter() is "older" code. Something that used to be a solution, until something better came along.
All dynamic=True seems to do is use the character's name field as a function instead of an actual name - in all the examples I've found so far... it just simply specifies the name of a variable that contains the real character name.
But every game I've seen in 2+ years does that by using square brackets wrapped around the name of a variable to do text substitution.

Therefore I think the solution is to try:

Python:
define yu = Character("[yu_name]", color="#eee", image="yu")

image side yu = "yu.png"

default yu_name = "Yuu".
I've removed that extra space and changed the definition to use Character() instead of DynamicCharacter().
I've changed the name field to make use of square brackets to refer back to a variable, rather than relying on dynamic=True.
I've also changed the single apostrophe characters ( ' ) to double quotes ( " ) because my OCD would't let me leave them alone.
I've shown a default yu_name= because I consider that good practice. Although the original code already has a default statement further down already.
THANKS