o/ hello all! so I've been creating a level editor for a game I'm making, I have most of it finished except for saving/loading and I have no clue on how to do this, I store the tiles/objects/entities in separate tables (all tiles in tiles table, etc.) I have no experience in saving data at all. so, any suggestions/ideas/help?
Tiles = {} -- all tiles
Entities = {} -- all living things (excluding player)
Objects = {} -- all props
-- -- --
-- later on in code --
function spawn_tile(x,y,t,id)
if get_tile(x,y) == true then remove_tile(x,y) end -- removes any tiles with the same x/y
local tile = {}
tile.x = x
tile.y = y
tile.t = t -- tile
tile.id = id -- subtile
tile.tex = _G["t_"..t.."_"..id]
table.insert(Tiles,tile)
end
-- I have similar setups for Objects and Entities, all just have different variables
Last edited by Schwender.exe on Mon Oct 16, 2017 9:36 pm, edited 1 time in total.
Don't use outdated libraries from abandoned amateur projects, especially if you're a newbie. It's a recipe for disaster and very few people will be able to help fix shit once it starts hitting the fan. Keep looking for better alternatives. Here's a starting point, and here's another one. The keyword you're looking for is "serialization".
grump wrote: ↑Mon Oct 16, 2017 9:15 pm
Don't use outdated libraries from abandoned amateur projects, especially if you're a newbie. It's a recipe for disaster and very few people will be able to help fix shit once it starts hitting the fan. Keep looking for better alternatives. Here's a starting point, and here's another one. The keyword you're looking for is "serialization".
thanks! I'll look into those, but I tried out Tserial and it seems to work! saving and loading levels works, but if it starts to crap out I'll try something else