Restarting the engine

The problem I have this time around is unloading buttons. I have a very basic Save/Load system that stores game variables and inventory states in a text file. For the most part it works as needed, but I’m having a problem with unloading buttons and replacing them.

I have a journal that has buttons as entries and when you click they open some pages. When you save your game, exit the game, then restart and reload your last save everything works fine, but if you load without restarting the game it is not possible to replace old entries. Old buttons simply refuse to go away. Fading them out or disabling them doesn’t work too. Actually I simply can’t disable any buttons without disabling their overlays, but that’s another problem.

So I was thinking if it was possible to unload a button, or simply restart the engine internally which takes it to the initial state without exiting the game. Any suggestions or workarounds?

No, I’m afraid not at this time. Restarting the engine is something that I was planning to do when dealing with the save/load mechanism. It’s pretty cool that you’ve managed to work out something of your own!

It shouldn’t be that difficult to do a rudimentary restart system, though, so I’ll try to have a look into it. That said, I can’t promise celerity as we have some terribly busy weeks in advance :frowning:

Thanks for the clarification Agustin. I need to find a workaround for that.

Btw, is it me or enabling/disabling buttons and images independent of their overlay is not possible? button:disable() never seems to work.

It should work in theory but it may be broken. Try doing button:toggle(), but I’m afraid that it wasn’t correctly implemented. That said, this one should be easy to fix, so I can look into it :slight_smile:

Yes, toggle() definitely works! Thanks.

Also I want to say improved error messages in 0.6.7 help a lot. I just recently started using it and it helped me find errors a lot quicker :nod:

YES! Finally a workaround that, well, works :smiley:

Keep us posted!