Want to make my game open world

Malicee

New Member
Mar 4, 2018
13
0
So I'm making a game which I won't spoil on, but I'm having issues with making my game open world since this is my first. Here's a template of how I want it to be: bedroom.png
My problem begins with the coding of this, I know that it's supposed to go under the screens.rpy, but I can't figure out the coding. Can someone give me a template of how the coding goes? It will be much appreciated.
 

thengineer

Moonlight Sins
Game Developer
Nov 19, 2018
191
771
The file you define the screen function (if it can be called a function) on doesn't really matter, it can be done on screens.rpy or in idontevenknow.rpy
Whenever you want something clickable, you resort to imagebuttons. First, you need to define your screen, in screens.rpy for example, by doing something like:

Code:
screen houseIcons(displayBathroom,displayLivingroom):

    if(displayBathroom):
        imagebutton idle "bathroomicon.png" action Jump("labelwhereyouwanttojumpto")

    if(displayLivingroom):
    ...
where displayBathroom/displayLivingroom are booleans (meaning they can be True or False)

You don't have to include these variables and if statements, it's just so you can have full control when you use it on your main script. The function has been created, and now you just need to show that screen by doing:

Code:
show screen houseIcons(True,False)
This is why using these variables (displayBathroom and displayLivingroom) can be a good idea: let's say the user is already in the living room. Then you can simply show screen houseIcons(True,False), so he's only able to see the bathroom icon. If he was in the bathroom, you'd do (False,True) and he'd only be able to see the living room icon, and you wouldn't need to create a separate screen function for each.

Anyway, I haven't tested the code and I haven't touched ren'py in a week or so, so I might have made a mistake or two. But yeah, that's the general idea. Hope it helped!
 

Malicee

New Member
Mar 4, 2018
13
0
The file you define the screen function (if it can be called a function) on doesn't really matter, it can be done on screens.rpy or in idontevenknow.rpy
Whenever you want something clickable, you resort to imagebuttons. First, you need to define your screen, in screens.rpy for example, by doing something like:

Code:
screen houseIcons(displayBathroom,displayLivingroom):

    if(displayBathroom):
        imagebutton idle "bathroomicon.png" action Jump("labelwhereyouwanttojumpto")

    if(displayLivingroom):
    ...
where displayBathroom/displayLivingroom are booleans (meaning they can be True or False)

You don't have to include these variables and if statements, it's just so you can have full control when you use it on your main script. The function has been created, and now you just need to show that screen by doing:

Code:
show screen houseIcons(True,False)
This is why using these variables (displayBathroom and displayLivingroom) can be a good idea: let's say the user is already in the living room. Then you can simply show screen houseIcons(True,False), so he's only able to see the bathroom icon. If he was in the bathroom, you'd do (False,True) and he'd only be able to see the living room icon, and you wouldn't need to create a separate screen function for each.

Anyway, I haven't tested the code and I haven't touched ren'py in a week or so, so I might have made a mistake or two. But yeah, that's the general idea. Hope it helped!
I seem to get the idea, but the one thing I'm confused about is u'jump' is not a keyword or valid child for the imagebutton statement. Do you know the fix to this? I've tried to fix the lines and separate things but nothing yet.
 

thengineer

Moonlight Sins
Game Developer
Nov 19, 2018
191
771
I seem to get the idea, but the one thing I'm confused about is u'jump' is not a keyword or valid child for the imagebutton statement. Do you know the fix to this? I've tried to fix the lines and separate things but nothing yet.
Jump is capitalized in screen language. Ren'py is confusing because the screen language works differently, refer here to the list of actions you can do inside a screen: