=====================
With this recipe you can change the standard Ren'py save system into something more similar to console games.
Well, yeah, like Castlevania, Zelda or Tokimeki Memorial.
You have three slots to choose at the start of the game.
If you choose a void slot, you begin a game from scratch. If you chose an occupied slot, you continue the game from that point.
All progresses are saved in the chosen slot when YOU, the game designer, want for.
### WHY USE IT AND WHY NOT ###
This code is perfect for dating sims, RPG and all games that require control over game progress. The standard ren'py save system can destroy the game engagement.
This system allow the player to focus more on each move, without abusing of a save/reload mechanic.
In visual novels the save system work mostly as bookmarks, to avoid reading again long chunks of text. Saving as much as you want doesn't harm the gameplay. In fact, where is the gameplay??
So, if your game is mostly narrative, it's far better that you don't use it.
### HOW TO USE IT ###
1) Copy the long script that follow below, and paste it in place of a default script.
That's mean this script will overwrite that Eileen babbling about releasing the game to the world.
It's far much better if you begin by running the launcher, create a new project, then open 'script.rpy' file and overwrite the content with the arcade slot one.
2 )To have the game save, use this exact line:
Code: Select all
$ renpy.save(slot,extra_info=save_name)
That word appear in the slots. To change it, for example to state a chapter number or a route, simply use before:
Code: Select all
$ save_name="whatever you want"
The player will be unaware of the save, that will happen in the background.
This is an example of use...
Code: Select all
label turn:
$ day+=1
$ save_name="Chapter "+str(day)
"It's day [day]"
label adventure:
"Play there your adventure!"
label night:
"The day come to an end, and the game autosave in the proper slot."
$ renpy.save(slot,extra_info=save_name)
jump turn
Instead, your game begin with the next label, 'realstart', and you can proceed as usual.
### THE CODE ###
Code: Select all
# ARCADE SLOT FRAMEWORK
#######################
# Made by GAS, found on LemmaSoft Forum
# New Script.rpy
### Preliminary operations
init python:
config.has_autosave=False
default slot=0
### Your script begin there
label start:
$ save_name="Introduction"
$ _game_menu_screen=None
call screen slotscreen
$ slotn=_return
$ slot="1-"+str(slotn)
$ renpy.save(slot, extra_info=save_name)
$ _game_menu_screen="preferences"
### ... but the narration begin there below!
label realstart:
"The actual game begin there."
"Use '$ renpy.save(slot, extra_info=save_name)' to save the game in the proper slot."
return
#############################################################
### The screen to chose the slot to play in
screen slotscreen():
tag menu
add gui.game_menu_background
text _("Choose Game") xalign 0.5 size 30
hbox:
xalign 0.5
yalign 0.6
spacing 8
for i in range(1,4):
if FileLoadable(i):
# define the content
button:
xsize 300
ysize 400
background Frame("gui/frame.png")
vbox:
xsize 300
spacing 3
yalign 0.5
text "[i]" xalign 0.5
add Solid((100,100,100,255),xsize=200, ysize=200, xalign=0.5)
text FileSaveName(i):
style "slot_name_text"
text FileTime(i, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
style "slot_time_text"
action FileLoad(i)
key "save_delete" action FileDelete(i)
else:
# define the void slot
button:
xsize 300
ysize 400
background Frame("gui/frame.png")
vbox:
xsize 300
spacing 3
yalign 0.5
text "[i]" xalign 0.5
add Solid((50,50,50,255),xsize=200, ysize=200, xalign=0.5)
text "NEW GAME":
style "slot_name_text"
text "-- -- --":
style "slot_time_text"
action Return(i)
### modified screens
screen quick_menu():
zorder 100
if quick_menu:
hbox:
style_prefix "quick"
xalign 0.5
yalign 1.0
textbutton _("Back") action Rollback()
textbutton _("History") action ShowMenu('history')
textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
textbutton _("Auto") action Preference("auto-forward", "toggle")
textbutton _("Prefs") action ShowMenu('preferences')
screen navigation():
vbox:
style_prefix "navigation"
xpos gui.navigation_xpos
yalign 0.5
spacing gui.navigation_spacing
if main_menu:
textbutton _("Start") action Start()
else:
textbutton _("History") action ShowMenu("history")
textbutton _("Preferences") action ShowMenu("preferences")
if _in_replay:
textbutton _("End Replay") action EndReplay(confirm=True)
elif not main_menu:
textbutton _("Main Menu") action MainMenu()
textbutton _("About") action ShowMenu("about")
if renpy.variant("pc"):
## Help isn't necessary or relevant to mobile devices.
textbutton _("Help") action ShowMenu("help")
## The quit button is banned on iOS and unnecessary on Android.
textbutton _("Quit") action Quit(confirm=not main_menu)
There's a lot you can do there, as the system is very barebone, while functional.
1 - BASIC SLOT STYLES
The slots are styled two ways:
-They are buttons with a Frame() inside. You can just change the frame image.
-You can change text appearance at will, changing the GUI.RPY file, modifying voices used for 'slot'.
2 - ADD OTHER DATA TO SLOTS
To show other data on the slot you need to add a JSON function.
Think of a JSON as a post-it Ren'py can read before the slot is actually loaded.
Let's say for example you want to show the character name ('charaname'), the game day ('day') and the money collected ('money'). Add this at the end or start of your script. It create a function I've named 'myjson', that create a dictionary called 'jsondata'. What follow on square brackets are the 'key' name we'll use later, they are made out of thin air.
Code: Select all
default charaname="Gas"
default day=1
default money=21000
init python:
def myjson(jsondata):
jsondata["thename"]=charaname
jsondata["theday"]=day
jsondata["themoney"]=money
config.save_json_callbacks.append(myjson)
Code: Select all
#############################################################
### The screen to chose the slot to play in
screen slotscreen():
tag menu
add gui.game_menu_background
text _("Choose Game") xalign 0.5 size 30
hbox:
xalign 0.5
yalign 0.6
spacing 8
for i in range(1,4):
if FileLoadable(i):
# define the content
$ yourname=FileJson(i,"thename")
$ yourday=FileJson(i,"theday")
$ yourmoney=FileJson(i,"themoney")
button:
xsize 300
ysize 400
background Frame("gui/frame.png")
vbox:
xsize 300
spacing 3
yalign 0.5
text "[i]" xalign 0.5
add Solid((100,100,100,255),xsize=200, ysize=200, xalign=0.5)
text FileSaveName(i):
style "slot_name_text"
text FileTime(i, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
style "slot_time_text"
text "NAME: [yourname]"
text "DAY: [yourday]"
text "Money: [yourmoney]"
action FileLoad(i)
key "save_delete" action FileDelete(i)
else:
# define the void slot
button:
xsize 300
ysize 400
background Frame("gui/frame.png")
vbox:
xsize 300
spacing 3
yalign 0.5
text "[i]" xalign 0.5
add Solid((50,50,50,255),xsize=200, ysize=200, xalign=0.5)
text "START NEW GAME":
style "slot_name_text"
text "-- -- --":
style "slot_time_text"
text "NAME: ---"
text "DAY: --"
text "Money: ----"
action Return(i)
As the game save at given checkpoints, probably the screenshots will be terrible to use.
It's far better if you'll use some icon.
You have 2 options there:
A: Easy Option.
In the script, you'll see something like:
Code: Select all
add Solid((50,50,50,255),xsize=200, ysize=200, xalign=0.5)
You can have a 200*200 pixel image for an occupied slot and another one instead for a void slot.
Change the first 'add' like this:
Code: Select all
add "fullslot.png" xalign 0.5
Code: Select all
add "voidslot.png" xalign 0.5
B: Icon by story or goals
You can use a JSON function to determine a slot icon to show based on game values.
Let's pretend you have a value called 'lover', that register the character you're dating. There are 3 of them, with a value from 0 to 2 to identify them. If you're dating no one, you have your face instead.
Add the JSON function or modify the one you've coded already.
Code: Select all
init python:
def myjson(jsondata):
jsondata["thelover"]=lover
config.save_json_callbacks.append(myjson)
Code: Select all
default sloticons=["eileenslot.png","charlizeicon.png", "lindsayicon.png","yourface.png"]
Code: Select all
if FileLoadable(i):
# define the content
$ icon_numb=FileJson(i,"thelover")
$ img=sloticons[icon_numb]
button:
xsize 300
ysize 400
background Frame("gui/frame.png")
vbox:
xsize 300
spacing 3
yalign 0.5
text "[i]" xalign 0.5
add "img"
text FileSaveName(i):
style "slot_name_text"