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.
screen map:
use navi
imagebutton auto "gui/map/zone_%s.png" xpos 390 ypos 720 action Jump('zone1') activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
This screen would make the jump to zone1, but giving it a right click would return to the screen and the initial point, so I would like it to make the jump once, hide the current screen and continue with the corresponding label.
label zone1:
hide screen map
player.location = "zone1" # if you have a variable that stores player location, I'm using player.location here but you should use whatever you're using
"Continue the game here"
Alternatively you can add the hide screen action to the button itself:
That's just if you have a variable that does extra things based on where your player's current location is. For example your game may want to check where the player is whenever they move to a room, you'll want to have a variable to store that.
I used player.location just as an example. In my example you'll basically have a player object that stores various information about the player (stats, location, cash, etc) then you can easily access it by calling player.variable_name. Alternatively you can just have variables named player_location, player_cash, player_health etc. I just prefer to put everything in objects myself.
Could you give a simple example of how to store the place and then how to use it? I've really only used the basic variables like, Variable = True, and the analysis of the use of the If
I can't really tell you without knowing how you're handling locations in your game. If you don't use any variables to store your player location then it may be completely pointless.
If I were to give you a very simple example (not tested), this code should allow your player to move around by calling the move_player() label and automatically change the background.
Thanks, I think I can get an idea of how to use it, now it only remains to see if even clicking on the right returns to the point where I open the screen or stay in the new place.