Jump to content

Recommended Posts

So I am trying to erase the save slot while it's being used, as if the player had died. And this works very well, too well in fact.

You see, when the code triggers (by the way, it puts me right back to the main menu), the save selection only shows four slots anymore! (as opposed to five, when one owns RoG)

What makes this even weirder is that it's not the first slot disappearing, it's the fifth that won't be displayed anymore.

The issue resolves itself after restarting the game.

Spoiler

wilson.profile:Save(function()
    --GLOBAL.SaveGameIndex:EraseCurrent(function() --does it too, but doesn't erase the entire slot
    GLOBAL.SaveGameIndex:DeleteSlot(GLOBAL.SaveGameIndex:GetCurrentSaveSlot(), function()
        GLOBAL.TheFrontEnd:Fade(false, 3, function() --screen goes black
            GLOBAL.StartNextInstance() --show main menu
        end)
    end)
end)

Does anybody know why this might happen? If I find out on my own, I'll make sure to post it here, but there's other things that require my attention for now.

The reason it is the fifth likely has to do with the menu constructor (which proceeds top-down) successfully catching a nil value when it encounters the deleted slot, and causing the other slots to not be displaced by it. I'll look into why this is happening, and get back to you.

 

EDIT: Not happening for me. Perhaps there is some unique data structure in your 'SaveGameIndex' that's causing it? That's happened to me before.

Edited by Arkathorn

This issue is solved now. It didn't actually decrease the count of save slots. I just didn't enable the DLC before reloading the main screen :p

Spoiler

inst.profile:Save(function()
    GLOBAL.EnableAllDLC()
    GLOBAL.SaveGameIndex:DeleteSlot(GLOBAL.SaveGameIndex:GetCurrentSaveSlot(), function()
        GLOBAL.TheFrontEnd:Fade(false, 3, function()
            GLOBAL.StartNextInstance()
        end)
    end)
end)

It works like a charm!

Edited by Mobbstar

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...