• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM How to save created objects in a room

A

ABI7ITY

Guest
Hi all :)

I am looking for some help on saving the objects in my game room.
What I am doing is creating cards that add certain amounts per second to a global.points, this is all working fine, once the player reached lets say level 10 a card is unlocked that gives the player 1 point per second but I am creating varies cards with different "buffs", the cards all work but I want to make a "load out" where the player selects the 3 cards they want to use based on their own preferences, I have created a way for the player to choose 3 unlocked cards but my problem is when I start up the game the player then needs to re choose the 3 cards as the objects are created when chosen but not saved.

How can I get game maker to save which 3 cards (objects) the player chose so that when they go back to the game those 3 specific cards are still there?

I hope this makes sense, I am not very good at explaining :)

Much Love
ABI7ITY
 
S

Supercoder

Guest
You could write whatever cards you want into a text file (using numbers or strings to represent each card), then read that file the next time the game is opened. A look through the file handling section of the Gamemaker manual would definitely be helpful.
 
A

ABI7ITY

Guest
Hi :)

I was not sure where in the manual to look but I shall do a search for file handling and look into it :)
I will update the thread with the outcome.
 
A

anomalous

Guest
Consider the above, open a text file for writing, then just write whatever data structure you are using to store the data, to the file. It's all built-in stuff.

file_text_open_write/read/close
Common data structure read/write:
ds_list_write/read
ds_map_write/read
ds_grid_write/read

Look at the bottom of each manual entry and there are Examples too.
 
Top