Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Save and Load Functions

akesi lili provides functions to save, load, and manage game data, allowing you to persist and retrieve game states or other important information. These functions are essential for implementing save and load functionality in your games.

save

|name: String, content: String| or |name: String, content: Map|

Saves the given content with the specified name.

Parameters

  • name: The name to save the content under.
  • content: The content to save (either a String or a Map).

Example

save("game_save", {level: 5, score: 1000})
save("player_name", "Alice")

load

|name: String|

Loads content from a save file with the specified name.

Parameters

  • name: The name of the save file to load.

Returns

The loaded content (String or Map), or throws an error if the save file does not exist.

Example

loaded_content = load("game_save")
print loaded_content.level

saves

||

Returns the names of all stored save files.

Returns

A List of strings representing the names of all stored save files.

Example

save_files = saves()
for name in save_files
  print name

rm_save

|name: String|

Removes a save file with the specified name.

Parameters

  • name: The name of the save file to remove.

Example

rm_save("game_save")

These save and load functions are crucial for implementing persistent game states and data management in akesi lili.