G
Greg5000
Guest
I've been developing an open world game with one large room and a main menu. My room has multiple NPCs in it and so far I have used room persistence effectively to be able to quit the game to the main menu and continue from there, however I have recently implemented a simple save and load feature using INI files so I can stop using persistence and allow players to quit the game and load later.
I've figured out how to save and load variables to my INI such as player position etc. this is simple enough, but I can't get my head around how to save the positions of all NPCs and re-create them where they were when the room is re-entered. To complicate things further the player and each of the NPCs also have paths assigned which should be resumed on loading the INI.
How do you write each NPC's x and y coordinates and path to the INI and get the NPCs to be recreated in the correct positions with the associated paths re-assigned when loading the game? In essence it seems like such a basic thing to be able to do but it seems horribly complicated.
P.S. I've already tried out game_save and game_load, they didn't work for me, caused the game to crash and got too complicated trying to work around it's limitations.
I've figured out how to save and load variables to my INI such as player position etc. this is simple enough, but I can't get my head around how to save the positions of all NPCs and re-create them where they were when the room is re-entered. To complicate things further the player and each of the NPCs also have paths assigned which should be resumed on loading the INI.
How do you write each NPC's x and y coordinates and path to the INI and get the NPCs to be recreated in the correct positions with the associated paths re-assigned when loading the game? In essence it seems like such a basic thing to be able to do but it seems horribly complicated.
P.S. I've already tried out game_save and game_load, they didn't work for me, caused the game to crash and got too complicated trying to work around it's limitations.