Louis Ferina
Member
Example Scenario:
I have 5 crates in a room. When the player destroys a crate, it's id is saved to an array. When you reenter that room, the array ids are matched against the crates and if the id's match, then the object is destroyed.
This works fine, however, I noticed that as I add or delete crates in the room, the save file breaks because the id changes. I've seen suggestions of saving the room + object_index + x + y, but that would also break if I changed the placement of the crates. Is there another way to identify an object without hand coding a specific variable for each object that needs to be saved?
I have 5 crates in a room. When the player destroys a crate, it's id is saved to an array. When you reenter that room, the array ids are matched against the crates and if the id's match, then the object is destroyed.
This works fine, however, I noticed that as I add or delete crates in the room, the save file breaks because the id changes. I've seen suggestions of saving the room + object_index + x + y, but that would also break if I changed the placement of the crates. Is there another way to identify an object without hand coding a specific variable for each object that needs to be saved?