icytease
Newbie
- Apr 5, 2024
- 22
- 15
- 13
hihi, so I decided to try making a personal mod that I can plop into an AVN's game folder to add two keyboard shortcuts for myself:
- A - toggles auto-forward, with a little message
- P - makes a normal save in the next available slot
Python:
init -999 python:
config.developer = True
config.console = True
is_forwarding = False
def toggle_forwarding():
"""
Toggles Auto-Forward with a little notification in top-left
"""
global is_forwarding
is_forwarding = not is_forwarding
if is_forwarding:
renpy.notify("Auto-forwarding!")
renpy.run(Preference("auto-forward", "enable"))
else:
renpy.notify("Back to Normal")
renpy.run(Preference("auto-forward", "disable"))
def save_in_next_available_slot(save_name_string=""):
"""
Finds the first empty save slot and saves the game to it.
Looks like 3-6 , where 3 is the page and 6 is the slot
"""
slots_per_page = gui.file_slot_cols * gui.file_slot_rows
for page in range(1, 101):
for slot in range(1, slots_per_page+1):
slot_name = f"{page}-{slot}"
if not renpy.can_load(slot_name):
renpy.save(slot_name, save_name_string)
renpy.notify(f"Game saved to slot {slot_name}")
return
renpy.notify("No empty save slots found in the range 1-100.")
# Assign "a" to auto-forward and "p" to saving in next slot
try:
if 'K_a' in config.keymap['game_menu']:
config.keymap['game_menu'].remove('K_a')
if 'K_p' in config.keymap['game_menu']:
config.keymap['game_menu'].remove('K_p')
except:
pass
config.underlay.append(renpy.Keymap(K_a=toggle_forwarding))
config.underlay.append(renpy.Keymap(K_p=save_in_next_available_slot))