saveindex.lua
411412413414415416417
end
self:Save(nil)
end
cb()
end
411412413414415416417418419
end
self:Save(nil)
end
if cb then
cb()
end
end
579580581582583584585586587588589590591592593
end
--call after you have worldgen data to initialize a new survival save slot
function SaveIndex:StartSurvivalMode(saveslot, character, customoptions, onsavedcb)
self.current_slot = saveslot
-- local data = self:GetModeData(saveslot, "survival")
self.data.slots[self.current_slot].character = character
self.data.slots[self.current_slot].current_mode = "survival"
self.data.slots[self.current_slot].save_id = self:GenerateSaveID(self.current_slot)
self.data.slots[self.current_slot].modes =
{
survival = {
--file = self:GetSaveGameName("survival", self.current_slot),
581582583584585586587588589590591592593594595596597598599600601602603604
end
function SaveIndex:GetOrCreateSlot(saveslot)
if self.data.slots[saveslot] == nil then
self.data.slots[saveslot] = {}
end
return self.data.slots[saveslot]
end
--call after you have worldgen data to initialize a new survival save slot
function SaveIndex:StartSurvivalMode(saveslot, character, customoptions, onsavedcb)
self.current_slot = saveslot
-- local data = self:GetModeData(saveslot, "survival")
local slot = self:GetOrCreateSlot(saveslot)
slot.character = character
slot.current_mode = "survival"
slot.save_id = self:GenerateSaveID(self.current_slot)
slot.modes =
{
survival = {
--file = self:GetSaveGameName("survival", self.current_slot),