CG-Tespy / FungusSlotBasedSaveSystem_Unity

A replacement for the built-in Fungus Save System that is closer to the standard save systems you see in games.
MIT License
14 stars 3 forks source link

Issue while using the slot based system in a save and load menu layout. #6

Closed raymanaa closed 4 years ago

raymanaa commented 4 years ago

I want to have two menus on the same scene, one for the loading slots and one for saving slots.

I figured that this needs two save slot managers, one for the loading and the saving. But whenever I run the game, one of the slot managers gets automatically deleted.

I tried to have two SSBS, based on a recommendation in the forum, but that makes both the savemanager and the saveslotmanager get deleted. This happens right as I run the game.

Here's a link to my hierarchy https://www.imgur.com/Zvcu9kp and this one after I run the game https://www.imgur.com/wLOYE7M

I have a Save menu script on ‘Load’ game object and another one on ‘Save’ object. And the ‘SaveSlotManager’ has a save slot manager script that points to ‘Buttons’ game object, also, ‘LoadSlotManager’ has another save slot manager script that points to ‘LoadButtons’ game object.

CG-Tespy commented 4 years ago

Before I give you any concrete advice, can you show me a mockup of what you want your menus to look like? Based on those screenshots you sent, it doesn't really look like you're trying to have two separate menus.

On Sun, Aug 30, 2020 at 5:10 PM Raymanz notifications@github.com wrote:

I want to have two menus on the same scene, one for the loading slots and one for saving slots.

I figured that this needs two save slot managers, one for the loading and the saving. But whenever I run the game, one of the slot managers gets automatically deleted.

I tried to have two SSBS, based on a recommendation in the forum, but that makes both the savemanager and the saveslotmanager get deleted. This happens right as I run the game.

Here's a link to my hierarchy https://www.imgur.com/Zvcu9kp and this one after I run the game https://www.imgur.com/wLOYE7M

I have a Save menu script on ‘Load’ game object and another one on ‘Save’ object. And the ‘SaveSlotManager’ has a save slot manager script that points to ‘Buttons’ game object, also, ‘LoadSlotManager’ has another save slot manager script that points to ‘LoadButtons’ game object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CG-Tespy/Fungus-Slot-based-Save-System/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFLBGF7OKHJKFE3WQ5RZLRDSDK525ANCNFSM4QP2YF3A .

raymanaa commented 4 years ago

Here's what I mean by two menus, https://imgur.com/a/UO2od0I Changing from menu to menu happens by hiding one and showing another (using the alpha value). so, for example, the 'Save' button sets the 'Save' game object's alpha to 1 and all the other objects' alpha to 0.

CG-Tespy commented 4 years ago

Ah, I think I get it now. As the system is now, it only allows one set of save slots to exist at any one time. I'll look into this and see if I can think up a workaround

raymanaa commented 4 years ago

I would really appreciate that!

Ah, I think I get it now. As the system is now, it only allows one set of save slots to exist at any one time.

I noticed that because when I worked on the main menu (it has only a load menu) it works perfectly. But when working on this pause menu, I found myself stuck and here I am, scratching my head.

CG-Tespy commented 4 years ago

I've found a solution. Here are the steps.

  1. Make sure there's ever only one SaveManager and one SaveMenu component in your scene at any given time. 1a. Make it so only one of your menus has the SaveMenu component 1b. Make sure the SaveManager is not parented to any menu
  2. Replace the SaveSlotManager's script's contents with what you see here.
  3. Make sure each slot-having menu has its own SaveSlotManager component set up
  4. Replace the SaveMenu script's contents with what you see here.

It's a bit of a hacky solution, but I managed to make it work on my end. If any further issues arise, please let me know :)

raymanaa commented 4 years ago

Works like a charm! Thank you so so much mate !