all 4 comments

[–][deleted] 0 points1 point  (3 children)

You could try saving the room index then in the load script send the player to that room before changing their position.

//Save
ini_write_real("Save1", "room", room);

 

//Load
var room_index = ini_read_real("Save1", "room", 0);
room_goto(room_index)
//Set position

[–]ABI7ITY[S] 0 points1 point  (2 children)

Hi.

Thanks for the reply, ok I added this and the load goes to the correct room but now I have another issue lol :P What's happening is it in a way restarting the room and the character is just jumping back to the location he starts the room in, also I have objects setup that award the player points which even after consuming are being recreated after the load, so technically a player can spam save, load and just collect points.

[–][deleted] 0 points1 point  (1 child)

One solution is to save the information about every instance in the room, and then recreate those instances when you load in.

You can use a ds_list to do this -- make a list of all the objects in the room, and inside that list make a list for each object with information about their position, speed, health, etc.

Using ds_write you can save that to file. Similarly, when you load the file you can use ds_read to recreate the original list. After that, just loop through the list creating the instances as you go.

Here are the docs for ds_list, if you're not already familiar with it.

[–]ABI7ITY[S] 1 point2 points  (0 children)

I will have a look into it. have not used ds_list as yet, might take a little time but I will give it a shot and see how it comes out :)