Created
May 27, 2018 08:02
-
-
Save teukstrid/5f35cdc8164d7c17bd56d795395d7193 to your computer and use it in GitHub Desktop.
ini_load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///@arg = file_name | |
var _file_name = argument0; | |
global.load = true; | |
ini_open(_file_name); | |
var _room_name = ini_read_string("Level", "Room", ""); | |
global.start_x = ini_read_real("Level", "Start x", 0); | |
global.start_y = ini_read_real("Level", "Start y", 0); | |
global.player_health = ini_read_real("Player", "Health", 1); | |
global.player_max_health = ini_read_real("Player", "Max Health", 1); | |
global.player_stamina = ini_read_real("Player", "Stamina", 1); | |
global.player_max_stamina = ini_read_real("Player", "Max Stamina", 1); | |
ini_close(); | |
if _room_name == "" { | |
show_error("No save data", false); | |
} | |
var _room = asset_get_index(_room_name); | |
room_goto(_room); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment