• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py coding a city map [NOOB]

Deleted member 3736421

Member
Game Developer
May 25, 2021
291
747
Hello,

First post ever. I have been in the development of my first VN Game. I have a decent grasp of the basic coding for chapters/scenes and the sort. However, I have come to the point where I would like to have a map of my city that you can click around on and go to different destinations. Attached is a map of my city.

I am searching far and wide to understand how to code this correctly. From my understanding image buttons is the way to go. However, I am unable to wrap my head around getting this off the ground and the tuts on youtube don't really cover what I am trying to accomplish. In short, as most of you are aware, the VN games out there have a clickable map that takes you to different locations.

Any help would be very much appreciated. I have animation/video editing/photoshop skills on LOCK. The renpy coding is really my weakness.
Thank you in advance <3
 

datdarnotaku

Newbie
Apr 11, 2021
70
30
Im sorry but im very very new when it comes to this problem i mostly deal with things like storyline and lore continuity
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,199
14,932
First post ever. I have been in the development of my first VN Game. I have a decent grasp of the basic coding for chapters/scenes and the sort. However, I have come to the point where I would like to have a map of my city that you can click around on and go to different destinations.
A search on this part of the forum would have brought you many answers. I mean, last time I wrote about this was this morning.

You create a screen that will handle the map. This screen will display both the background and the buttons for the location, each one will send you to the related part of the code.
Then you call the screen each time the player have to travel.

Code:
screen navigation():
    add "images/map background.png"

   imagebutton:
       auto "images/location_kitchen_%s.png"
       action Jump( "kitchen" )
       xpos 100 ypos 100

   imagebutton:
       auto "images/location_livingroom_%s.png"
       action Jump( "livingroom" )
       xpos 100 ypos 200

label kitchen:
    "You entered the kitchen"
    [whatever you want]
    call screen navigation

label livingroom:
    "You entered the living room"
    [whatever you want]
    call screen navigation
 

Deleted member 3736421

Member
Game Developer
May 25, 2021
291
747
A search on this part of the forum would have brought you many answers. I mean, last time I wrote about this was this morning.

You create a screen that will handle the map. This screen will display both the background and the buttons for the location, each one will send you to the related part of the code.
Then you call the screen each time the player have to travel.

Code:
screen navigation():
    add "images/map background.png"

   imagebutton:
       auto "images/location_kitchen_%s.png"
       action Jump( "kitchen" )
       xpos 100 ypos 100

   imagebutton:
       auto "images/location_livingroom_%s.png"
       action Jump( "livingroom" )
       xpos 100 ypos 200

label kitchen:
    "You entered the kitchen"
    [whatever you want]
    call screen navigation

label livingroom:
    "You entered the living room"
    [whatever you want]
    call screen navigation
Thank you for this, I am also new to forums haha like no joke I think this is the first I've ever joined. Much appreciated you are a life saver :)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,199
14,932
File "game/script.rpy", line 16: expected statement.
imagebutton:
imagebutton is a screen statement.
If you've put it on a screen, like in my example, and somehow made a typo, the error would say that it "is not a keyword argument or valid child for the screen statement". This while the error you get clearly state that you put it into a label.

Perhaps should you start by opening the directory where you put Ren'py SDK. There you'll find a directory named "doc", where you'll find Ren'py documentation.
Reading at least it's "Getting Started" part would be a good idea, since it will give you the basis information, like by example the difference between a label and a screen, and things like that.