Hello!
In my game the player can call two different characters, out of a total of 5, to come to a room.
For that I created two "slots" for the room. When the player enters the room, he has the option of calling one character to slot 1 (left) and another to slot 2 (right).
However, let's say that after choosing the BOB character to occupy slot 1 and the RICK character to occupy slot 2, the player changes his mind and decides that he will call the character MARCO to slot 1.
To do this, I'll need to use the "hide bob" command so that it disappears, followed by the "show marco at left". But would it be possible for me to use the hide command on any character that is currently occupying slot 1, without having to write the name of the image?
Since I'm new to Renpy, I'm not sure how to do this. I thought of creating specific layers for each slot and have the contents of these layers erased if the player decides to call another character, but I do not know if this is feasible or recommendable.
Thank you.
Use the hide command to hide any characters that are present?
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.
Use the hide command to hide any characters that are present?
Last edited by tcassat on Wed May 16, 2018 8:30 am, edited 1 time in total.
Re: Use the hide command to hide any characters that are present?
I bet someone is going to correct me and it'll be a revelation for me - but I found that this is slightly more complicated than expected because Renpy doesn't have a "hide expression" statement. I assume you're using show expression statements at the moment to dynamically show the character you wanted currently, but without hide expression you're stuck?
Well we just need to dig a little deeper into renpy functions: https://www.renpy.org/doc/html/statemen ... renpy.hide
That will hide bob, or more likely:
Since you'd have a variable holding the character name already.
Your idea of using a separate layer would work as well, but seems excessive in this case - so long as you know who the character is you should be able to do it.
Well we just need to dig a little deeper into renpy functions: https://www.renpy.org/doc/html/statemen ... renpy.hide
Code: Select all
$ renpy.hide("bob")
Code: Select all
$ renpy.hide(char_name)
Your idea of using a separate layer would work as well, but seems excessive in this case - so long as you know who the character is you should be able to do it.
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Use the hide command to hide any characters that are present?
If you did:
show expression chosen_char[0] as left_char at left
You could then just either hide or overwrite using the alias left_char:
hide left_char
show expression chosen_char[0] as left_char at left
You could then just either hide or overwrite using the alias left_char:
hide left_char
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot]