[solved] SideImage... seriously, how can this be so complicated?

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
Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

[solved] SideImage... seriously, how can this be so complicated?

#1 Post by Errilhl »

Okay, I'm trying to wrap my head around showing a character image when they're speaking, which seems to be a seriously complicated thing to do... (why?)...

Okay. I have this defined:

Code: Select all

define fS = Character("[fSinput]", window_left_padding=600, image="images/jshoulders")
In the images/-folder, I have two different images defined:
side jshoulders.png
jshoulders.png
(who in their right mind thought that having space-delimited "tags" was a good idea on any system?)

And in the screens.rpy, I have the following before a statement made by the character:

Code: Select all

show side jshoulders
In the say-screen in screens.rpy I have the following:

Code: Select all

    if not renpy.variant("small"):
        add SideImage() xalign 0.5 xpos 1450 yalign 1.0 ypos 1080
However - no matter how I define this, the image that gets loaded ALWAYS sits in the center of the screen, behind the dialogue-box. Also, the actual text in the dialogue box is being moved, so something is doing that (I assume it is the line in say-screen that does that).

Here's a screenshot of how it looks:
screenshot0001.png
So, what am I doing wrong, where can I find examples and code that actually work, and is not deprecated and/or useless? (Sorry for being a bit crass, it's just... this should be as simple as defining an image in the Character-class, or similar, which then should automatically be present unless you don't want it to be)
Last edited by Errilhl on Mon Nov 20, 2017 7:58 pm, edited 1 time in total.
Currently working on: Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: SideImage... seriously, how can this be so complicated?

#2 Post by Imperf3kt »

Did you read the documentation properly?

Do it this way:

Code: Select all

define fS = Character("[fSinput]", window_left_padding=600, image="jshoulders")

image side jshoulders = "jshoulders.png"
Now whenever you type jS "I'm talking.", the image will appear automatically.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: SideImage... seriously, how can this be so complicated?

#3 Post by Errilhl »

Well... a minor improvement, at least. That gives me this:
screenshot0002.png
Ah, nevermind, had to remove the show-statement. However, the alignment of the side-image... is off, to say the least. How do I modify its placement on the screen? The left-padding in the define doesn't seem to do anything (I tried changing it)

Ah, nevermind again! That was of course caused by the definition of SideImage() in screens.rpy. Modifying that, after the SideImage() actually started working was a lot better :) Now, I just need to get over the automatic naming/fetching stuff, and see how it works if I add more images into the mix.
Currently working on: Image

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: [solved] SideImage... seriously, how can this be so complicated?

#4 Post by Errilhl »

Oh, btw - I did read the documentation. The examples leaves a bit to be desired ;) https://www.renpy.org/doc/html/side_image.html
Currently working on: Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: [solved] SideImage... seriously, how can this be so complicated?

#5 Post by Imperf3kt »

I suppose the examples could use a bit of refining.
Glad you got it sorted.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: [solved] SideImage... seriously, how can this be so complicated?

#6 Post by Errilhl »

Yeah... a bit clearer wording, not to mention examples that actually work (by all means, what you said is there, it's just not obvious, at least not to me, that that is what you need to do to make it work). Thanks for your help :)
Currently working on: Image

Human Bolt Diary
Regular
Posts: 111
Joined: Fri Oct 11, 2013 12:46 am
Contact:

Re: [solved] SideImage... seriously, how can this be so complicated?

#7 Post by Human Bolt Diary »

The documentation has a 100% working example. Of course, you need to provide your own images.

If you feel the documentation did not describe Side Images in a way you found understandable, I encourage you to edit the docs with your own description and submit it as a Pull Request. Or, if you're less comfortable with git, file an issue with the suggested changes.

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: [solved] SideImage... seriously, how can this be so complicated?

#8 Post by Errilhl »

I might do that, eventually - but not right now. I have more than enough to do with just making the game I'm currently making :)
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], mold.FF