"Permanent" Side Images - How to? [Solved]
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.
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
"Permanent" Side Images - How to? [Solved]
Hello! For my VN, I'm trying to get my side image to stay, no matter who is talking. (I'll have to remove the side image once in a while, but for the most part I don't want it to move)
There's a game who did this - Get Dumped
Yet, I haven't found out how to do this anywhere.
I know how to get a side image and how to use conditional switches... but when someone else talks the side image disappears. I do not want it to. Please help!
Thank you
There's a game who did this - Get Dumped
Yet, I haven't found out how to do this anywhere.
I know how to get a side image and how to use conditional switches... but when someone else talks the side image disappears. I do not want it to. Please help!
Thank you
Last edited by Llunet1 on Thu Sep 04, 2014 7:14 pm, edited 1 time in total.
Re: "Permanent" Side Images - How to?
I am only planning to start using sideimages so my experience with them is 0 but wouldn't simply:
conditioning it though a couple of if/elif/else forks or using some form of conditioned displayable do the trick? I glanced at the documentation but it doesn't look like Ren'Py offers what you're looking for at face value, instead it simply makes it fairly easy to add the functionality yourself.
Code: Select all
add SideImage() xalign 0.0 yalign 1.0
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
Hmm... how would that code be used? (I haven't seen it formatted like that before... //although I haven't been using Ren'Py for long)
I was thinking that if I had an image permanently at the side, I could just overlap images in order to change the expression. Would that code do that? (Without having it attached to a character)
I guess I'll try it out to see~ Thank you for responding!
I was thinking that if I had an image permanently at the side, I could just overlap images in order to change the expression. Would that code do that? (Without having it attached to a character)
I guess I'll try it out to see~ Thank you for responding!
Re: "Permanent" Side Images - How to?
I believe what you want to do is have a side image there with every textbox?
If so you can open screens.rpy and find the say block:
Here you can specify the image you want there directly, so it will always be there when the textbox is on screen
I hope this is what you need
If so you can open screens.rpy and find the say block:
Code: Select all
##############################################################################
# Say
#
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
screen say:
I hope this is what you need
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
Ohh... I didn't know about that. Huh. Thank you.
However, I don't know how to program that... ^^; And the Wikipedia isn't clear enough for me. Could you please give me an example as to how I would write the code, if you don't mind? That should be enough for me. (Also, I need to be able to remove the side image sometimes. For example the beginning, which is all narration, and also when the main character doesn't have a name. How would I do that?)
However, I don't know how to program that... ^^; And the Wikipedia isn't clear enough for me. Could you please give me an example as to how I would write the code, if you don't mind? That should be enough for me. (Also, I need to be able to remove the side image sometimes. For example the beginning, which is all narration, and also when the main character doesn't have a name. How would I do that?)
Re: "Permanent" Side Images - How to?
The following imaging API can be used to add sideimage:
For more information, please go to this image tutorial
Code: Select all
void Page.AddImage(REImage img, float positionX, float positionY, ImageCompression compression);
Re: "Permanent" Side Images - How to?
You wouldn't know how from Wiki, it's pretty old...Llunet1 wrote:Ohh... I didn't know about that. Huh. Thank you.
However, I don't know how to program that... ^^; And the Wikipedia isn't clear enough for me. Could you please give me an example as to how I would write the code, if you don't mind? That should be enough for me. (Also, I need to be able to remove the side image sometimes. For example the beginning, which is all narration, and also when the main character doesn't have a name. How would I do that?)
Code: Select all
# If there's a side image, display it above the text.
if side_image:
add side_image
else:
add SideImage() xalign 0.0 yalign 1.0
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
Thank you As to how to remove it though? I tried a variable but it gave me an error. However I did not write the code like that either... I will have to try it. Thank you!
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
So I tried it out. It works! Thank you! I can probably get the variables to work. Thank you very much for your help! (I would never have figured this out)
I can't seem to be able to change the expression at the moment, however. I will continue trying this out and if I have any issues I'll write something again. Once again, thank you
I can't seem to be able to change the expression at the moment, however. I will continue trying this out and if I have any issues I'll write something again. Once again, thank you
Re: "Permanent" Side Images - How to?
I do not believe that it should throw errors, if some_var:Llunet1 wrote:I tried a variable but it gave me an error.
add "image"
should work as long as that variable is declared. If it doesn't, try accessing it directly in store but that seems redundant.
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
I got the variable to work, luckily. But, since I'm also trying to remove the side image sometimes or change expression, I need to know how to remove it. Do you know how? Or when adding the image, instead of putting the file name, how can I define the image with a name that will work in the screens.rpy?
I've looked around and tried multiple ways... But nothing has worked.
I've looked around and tried multiple ways... But nothing has worked.
Re: "Permanent" Side Images - How to?
I couldn't understand your post, please be as specific as possible on what needs to be done.
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
Ah, sorry. Let me rephrase. I was asking for a way to make the image disappear (because the hide statement will not work for an image like that). However, I found a way to get it to disappear.
But, I have a new problem. ^^;
I want the expressions to change as well. Here's my code in the screens.rpy:
The problem is, while I can get my image to disappear, I cannot get my side image to appear. Is there something wrong with my code, perhaps? I have no errors popping up, just the side image will not appear. Also, I tested my variable "side_chara" both true and false before the side image would appear to make sure it wasn't the cause of the problem, but but nothing changed. And when I put back the original code (below) my side image will appear.
And, also, I'm assuming that if I am able to get my side image to appear, it will appear above the image I set up, right? I can test that and figure it out later.
Thank you~
But, I have a new problem. ^^;
I want the expressions to change as well. Here's my code in the screens.rpy:
Code: Select all
if side_chara: #This variable indicates whether I want a side image or not
if side_image:
add side_image
else
add Image("pose1-normal-normal_a.png", xalign = 0.0, yalign = 1.0)
else:
if side_image:
add side_Image
else:
null
Code: Select all
if side_image:
add side_image
else:
add SideImage() xalign 0.0 yalign 1.0
Thank you~
Re: "Permanent" Side Images - How to?
You're missing a colon after else in the code you posted, and the original code uses side_image rather than side_Image (capitalization). Without knowing more about how you defined your images, set up your variables, etc, that's about all I can say.
If you only need one character's side image, I imagine it would just be simpler to use ConditionSwitch and add that particular image.
If you only need one character's side image, I imagine it would just be simpler to use ConditionSwitch and add that particular image.
Code: Select all
image character_side = ConditionSwitch(
"exp == 'happy'", "side_happy.png",
"exp == 'sad'", "side_sad.png")
# replace the add side_image part of the say screen with the following
if side_chara:
add character_side
label start:
$ exp = 'happy'
"test happy expression"
$ exp = 'sad'
"test sad expression"
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: "Permanent" Side Images - How to?
Oh wow. That's interesting. o__o How was my code even working?
Um... I have different outfits (they don't get used too often, but they are needed) and many expressions. (This character has 10, and 5 outfits)
I tried the ConditionSwitch method, ignoring that though. I can probably put in variables and I think it would work, but I get an error:
NameError: name 'character_side' is not defined
I defined it in my "Sprite.rpy" file, which is separate from my script.rpy file and is written as:
And for the screens.rpy, I used the exact same code as you wrote:
Once again, thank you for helping me. I really do appreciate this.
Um... I have different outfits (they don't get used too often, but they are needed) and many expressions. (This character has 10, and 5 outfits)
I tried the ConditionSwitch method, ignoring that though. I can probably put in variables and I think it would work, but I get an error:
NameError: name 'character_side' is not defined
I defined it in my "Sprite.rpy" file, which is separate from my script.rpy file and is written as:
Code: Select all
image character_side = ConditionSwitch(
"e == 'n1_normal'", "pose1-normal-normal_a.png",
"e== 'n1_speak'", "pose1-normal-speaking_a.png",
xalign = 0.0, yalign = 1.0)
Code: Select all
if side_chara:
add character_side