saving and loading

Posted By: Thiago_7

saving and loading - 02/20/08 16:24

Pardon me, but since i´m a newbie i have to ask these stuff. I´m trying to make a RPG. A complex one. I´m new to making games but not programming. This one is a question in my mind. How can i make my game to save like in an ordinary RPG? How can i create a save file to keep all my structs and lists of items from the last time i played? And how do i load directly to the last level or area i played with all my items, information and configurations??

PS: and if anyone knows how to also create a file with configurations and variable values in C++, i also would be very much aprecciated.

Thank you all.
Posted By: RicheyMB2

Re: saving and loading - 02/20/08 17:18

I've not used it but there is a game_save command which saves this kind of information.

You can also mark up to memory areas with add_struct.
Posted By: Thiago_7

Re: saving and loading - 02/21/08 09:45

thanks, but i dont understand that add_struct and marking up memory areas. What does it do?
Posted By: RicheyMB2

Re: saving and loading - 02/21/08 14:28

The manual states that add_struct is intended for external languages so it uses long instead of var.

Anyone know of a way to do this using lite-c?
Posted By: ultranet

Re: saving and loading - 02/21/08 15:41

You just need to write add_struct(struct_pointer, sizeof a struct) to mark the structs that you want to save.
When you use game_save(), remember to include SV_STRUCT or just SV_ALL which saves everything.

*one thing strange is that the last marked struct is not saved by game_save().
*so you may just mark a dummy struct to be the last one.
© 2024 lite-C Forums