Sorry if this is a bit long winded, I am very new to coding, and this is going to be an iOS app. I just have basically 2 outstanding items that I cannot get working. Also, everything is imagemaps.
Flow of the app:
Open up to Menu (options are play prologue, choose character, load game, and gallery)
Play Prologue
Redirect to Choose a Character's Route
Start His Route
What I cannot solve:
-Player Name
I have the prompt to enter the character name at the start of the prologue; however, there are several issues with this. When a person starts up without reading the prologue and goes straight into a character it doesn't store the name, also there is no way to change it later on. To make things worse, It doesn't appear to save once closing out and coming back in to the game either.
Coding:
call screen name_input
Then in the screens:
screen name_input():
default screenvar = False
imagemap:
ground "name_input.png"
#idle "name_input.png"
hover "name_input.png"
#selected_idle "name_input.png"
hotspot (321,348,642,408) action SetScreenVariable("screenvar",True)
if screenvar == True:
input default "" pos(350, 360) changed name_func
hotspot (671,345,748,409) action Return()
init python:
style.input.size = 35
style.input.color = "#120A8F"
Ideally, it should ask you upon opening the app. But only when you first download the game and it should be permanently stored. Additionally, there should be a button the player can press in the main menu to change the name at anytime and press confirm to save/ permanently store.
-Save/Load Screen
I have made a custom image map for the save and load screens. However, they are pretty much non-functioning as they are. They are displaying number date time and screenshot properly; however, when I load them up it takes me straight to the character selection menu whether than where I actually saved the game. Also, I can't figure out the auto save part to save my life.
Here is current coding for this in screens:
screen save():
# This ensures that any other menu screen is replaced.
tag menu
imagemap:
ground "savingscreen.png"
idle "savingscreen.png"
hover "savingscreen.png"
cache False
hotspot (117,157,470,263) clicked FileSave(1):
use load_save_slot(number=1)
hotspot (117,296,470,403) clicked FileSave(2):
use load_save_slot(number=2)
hotspot (117,436,470,542) clicked FileSave(3):
use load_save_slot(number=3)
#hotspot (593,157,945,263) clicked AutoSave(4):
#use load_save_slot(number=4)
#hotspot (593,296,945,403) clicked AutoSave(5):
#use load_save_slot(number=5)
#hotspot (593,436,945,542) clicked AutoSave(6):
# use load_save_slot(number=6)
hotspot (735,29,809,77) action Return()
screen load():
# This ensures that any other menu screen is replaced.
tag menu
imagemap:
ground "loadingscreen.png"
idle "loadingscreen.png"
hover "loadingscreen.png"
cache False
hotspot (117,157,470,263) clicked FileLoad(1):
use load_save_slot(number=1)
hotspot (117,296,470,403) clicked FileLoad(2):
use load_save_slot(number=2)
hotspot (117,436,470,542) clicked FileLoad(3):
use load_save_slot(number=3)
hotspot (593,157,945,263) clicked FileLoad(4, page="auto", confirm=True):
use load_save_slot(number=4)
hotspot (593,296,945,403) clicked FileLoad(5, page="auto", confirm=True):
use load_save_slot(number=5)
hotspot (593,436,945,542) clicked FileLoad(6, page="auto", confirm=True):
use load_save_slot(number=6)
hotspot (735,29,809,77) action Return()
screen load_save_slot:
$ file_text = "% 2s. %s\n%s" % (
FileSlotName(number, 4),
FileTime(number, empty=_("")),
FileSaveName(number))
add FileScreenshot(number) xpos 220 ypos 20
text file_text xpos 0 ypos 10 size 20 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2 #font "SWANSE_.TTF"
key "save_delete" action FileDelete(number)
key "x" action FileDelete(number)
init -2 python:
config.thumbnail_width = 90
config.thumbnail_height = 60
Ideally, I want the three spaces on the left to be save files, and the three on the right to be "auto save" files that the game makes automatically when a chapter is finished.
Issues with Game Menus (2) | Renpy to iOS game
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.
- papiersam
- Veteran
- Posts: 231
- Joined: Fri Aug 12, 2016 2:24 pm
- Completed: Gem Hunt Beta, 1/Probably, Animunch
- Projects: The Panda Who Dreamed
- Contact:
Re: Issues with Game Menus (2) | Renpy to iOS game
It doesn't appear to save once closing out and coming back in to the game either.
It has something to do with how Renpy saves data. You could use persistent data or python classes to permanently store the data.however, when I load them up it takes me straight to the character selection menu whether than where I actually saved the game
For the name issue, try looking into this.
(Note: using the
Code: Select all
Hope that helps.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Ocelot