[Hide Chat]

Loading... Send a message to load content

Log in to chat!



Page


abeperk



User
7 posts
Last seen: 4 years ago
GM Version: Studio

4 years ago
Is this something that can be done?
At the moment I have a loading script where it loads like this:
"GMech_Profile_Read_Real("level",global.level);
GMech_Profile_Read_Real("hp", global.hp);
GMech_Profile_Read_Real("maxhp", global.maxhp); ........"

and a saving script that does this:

"GMech_Profile_Write_Real("level",global.level);
GMech_Profile_Write_Real("hp", global.hp);
GMech_Profile_Write_Real("maxhp", global.maxhp);...."

When I have them loading and saving I also used in a step:
if(!GMech_Profile_Uploading())
{
instance_deactivate_all(true);
draw_text(x,y,"Saving..."); //or loading
}else
{
instance_deactivate_all(false);
}

When I call for a load the defaults kick in. My defaults are set in the log in screen, while the title screen has a new game and a continue button. I want the new game button to save all the defaults, and the continue button to load all the new data (after the player saves, exits, then comes back.)

Game Dev

Luke Escude



Administrator
64 posts
Last seen: 1 year ago
GM Version: Studio

4 years ago
The GMech_Profile_read functions return a value, so you need to set them like you set a variable:

variable1=GMech_Profile_Read_String("section","variable","DefaultValue")

GMechanism Creator

abeperk



User
7 posts
Last seen: 4 years ago
GM Version: Studio

4 years ago
Haha Thanks! I figured out another one of my problems is that it slipped my mind that Real = numbers I had some booleans that I was trying to save as real >.< is there a way to save boolean's that does not involve converting them to strings? And will I need to convert them back to true/false somehow or will it do that automatically?

Meaning if I convert true to a string and it saves as "true" will I need to put a loop that says

if(this == "true") this = true;

Game Dev

Luke Escude



Administrator
64 posts
Last seen: 1 year ago
GM Version: Studio

4 years ago
Actually booleans ARE reals. True=1 and false=0. So you should be able to use the real functions with booleans.

GMechanism Creator

abeperk



User
7 posts
Last seen: 4 years ago
GM Version: Studio

4 years ago
Good to know then it was my loading that was off thanks!!

Game Dev

Page




Copyright © GMechanism 2013-2015. All Rights Reserved.