Forum rules - please read before posting.

new game menu

Ok i want to make a new game menu, when you click the button show 3 Profiles.

Profile 1
Profile 2
Profile 3

When you click in any of then you can put your name. Then you can start using that profile for autosave.

The problem is i mess with a lot of things. I just make 3 new profile options that when you click on the options you create different profiles. But when you restart the menu doesn't show the profile name, only the create button profile.
Sorry if i confuse with this. But the main idea is make a simple 3 profile options so you can start a new game o continue the last saved game of each profile. But first create it.
thanks again

«1

Comments

  • The process of naming profiles is similar to that of naming save game files, see this tutorial.

    AC comes with a default Profiles Menu, but you need to link to it manually e.g. via another Menu Button in order to view it.  I would recommend getting to grips with it, and learning how profiles can be created and managed before attempting to rename them.
  • Well Chris i saw the tutorial, and made some stuff working. But i have some problems, i made global variables for the profiles. But i cant check individual profile, like if profile 1 etc etc. Another thing how can i get access to delete autosave of one particular profile?
    Thanks again i[m really lost in some parts more because i change everything to make an auto-save system.
    Here is the exact idea of what i want to make with the new game
    is a youtube video of Bertram Fiddle adventure game first seconds
     https://www.youtube.com/watch?v=S2LVbA3hioY

  • I shall see about adding a new Action, or extending the Save: Check Action, to allow for the checking of profiles.

    In order to delete the autosave of an arbitrary profile, you would have to use some custom coding to first switch to that profile, delete the save, and then switch back.  This is all in the scripting guide:

    int profileIDToAffect = 2;
    int originalProfileID = AC.Options.GetActiveProfileID ();  // Get the current profile ID
    AC.Options.SwitchProfile (profileIDToAffect);  // Switch to the intended profile
    AC.KickStarter.saveSystem.DeleteSave (0, 0, true); // Delete the autosave
    AC.Options.SwitchProfile (originalProfileID); // Switch back to the old profile

    If you only allow for 3 save slots, though - you could consider just using one profile and having the three slots as save slots.
  • Maybe 3 save slots is the solution.
    I make an action list with a save option- overwrite existing game with slot index from variable name Slot(integer)
    And have this problem:
    Cannot save at this time - either blocking ActionLists, a Converation is active, or saving has been manually locked.
  • edited February 2017
    So, do any of the conditions mentioned in the warning apply?  Check that there are no other ActionLists running than the one that is running the Action - you can do this by checking List active ActionLists in Game window? at the bottom of the Settings Manager.

    v1.56 will include the ability to check if a given profile exists.
  • Sorry to reopen this post. But I couldn't make this.
    I have just made 3 buttons UI Menu to create each button with creat profile with custom label Slot1, Slot2, Slot3.
    To save game I have an action that checks if the profile Name exists with SlotX, save new game with custom label SlotX.
    Then to load you have the slots to load.

    Well, that's not working :(  I don´t know why I'm so blocked with this stuff for a long time. 
  • edited July 2018
    "Not working" in what way?  This is a complex topic, and there's many ways it could not work.  You'll need to be much clearer in terms of what's going on, and what it is exactly you're doing (screenshots of basically everything, please), so that I can understand the problem properly.

    I also don't understand your need to check the current profile.  Each profile's saves are separate from one another, and you previously said you just wanted autosaves.  Writing to the AutoSave with the Save: Save or load Action will only affect the currently-selected profile.

    I think you're going to have to explain again what it is exactly you want to have happen - again, any screenshots you can provide to help understanding will help me to help you.
  • Well better start from zero. My initial idea was to make 3 different profiles each one with autosave.
    This is my Main Menu. First, you can go to the new game option.
    https://drive.google.com/open?id=1JpbW6TRIxfJUNnn1smA02fQppO5F7D-j

    The New Game option have this stuff
    https://drive.google.com/open?id=1EeKPnI7R5YjJq0eRPebobJ_Ui4Tf86BQ

    Each button has an action list. Example for the Slot1 (or profile 1)
    https://drive.google.com/open?id=1wlYewM7xYFXPuggGzEKFWvz8K5bFr9t1

    The menu that opens is something like if you start a new game you will lose your last game etc. And start the new game from the begging. 

    In the game, I use the autosave options.

    For the load menu
    https://drive.google.com/open?id=1k8fe4pWcrE_OMm2npn9TWoG9W86rdz18

    https://drive.google.com/open?id=12JAMhvKipNHHvGf8pkBXV_U5k-1Zpywh

    My idea is to show only the slot profile with autosave file. The load the autosave for this profile.

    Well, maybe that helps to get the idea. 
  • Right, and at which point along all that do things stop working, and in what way?

    If your "Load" menu is displaying a SavesList menu element, bear in mind that a SavesList element can only show saves for the active profile - meaning you'll only ever be able to show one save at a time (since each profile only has one save, the autosave).

    If the idea is to have the "Load" menu instead switch profile and load the autosave, replace it with a ProfilesList element and have it run the Save: Save or load Action after selecting, to load the autosave.
  • The problem is to select the correct profile. Ex I have leveled slot1, slot2, slot3. 
    At the load screen, i want to select it. But i don´t have any option to select slotx, I have to switch the active profile and only had set slot index or set profile id. How can i know the id of slotx? Not only to load i want to select and delete if i need it.

    Sorry if i not clear, i was trying all the day and i block as hell :) 
  • Clicking the ProfilesList element will select it by default - you don't need to use the Save: Manage profiles Action to do so.  This'll be the case if Switch profile when click? is checked in the ProfilesList's properties.

    However, if you want more control, you can uncheck that and assign a ActionList when click asset instead.  In that ActionList, define a new Integer parameter, and you'll then be able to assign it beneath the ActionList field in the Menu's properties.

    As that field will then show, that parameter will then be set as the "clicked slot index" when the ActionList is run.  You can then use that parameter in the Save: Manage profiles Action, overriding the Slot index to switch to value, provided that you also enter the name of the Menu/ProfilesList beneath.
  • Well, I found a way to works! I have another question. I want to make another label with a global variable that shows in the slot at the time of saving that record the place of the save game. I made a script that takes the id profile and then set a global variable to the place where I am. And in the load menu a label with the global variable. But I have problems when starting the game all the variables set to empty and then start another profile reset all the variables again. 
    I try using scriptableobject to define external variables and store it but doesn't work.

    Any idea not so complex? 
  • If you're using your own ScriptableObject to store variables, you'll need to also handle the saving/loading yourself - it's not going to work automatically.  Instead of relying on a ScriptableObject, I'd recommend reading/writing to the PlayerPrefs if you're going your own script.

    I'll need you to back up again and explain what it is you want exactly - again, a mock-up screenshot will help a lot here.  If you're trying to re-name the Profile, you can do that when the AutoSave is created by renaming it afterwards.
  • If you want to restore an Options-linked Variable without switching profile, you can do that through script:

  • I don´t know how to implement it on my game this script.
    I had attached with this:
    https://pastebin.com/7VnzB4wx in the main menu to attached to an empty game object. But nothing happens, when I quit my game and back doesn´t work. Only in editor work. 
  • Your script doesn't call the method I wrote for you - LoadProfileVariable - anywhere.

    It's not going to run by itself - you need to run it when you want it to, and use the string it returns appropriately.  Have you even tested it to see if it works as you intend?

    void Start ()
    {
      int profileID = 0;
      int varID = 2;
      string value = LoadProfileVariable (profileID, varID);
      Debug.Log ("Value is: " + value);
    }
  • Yes, i have tested and nothing happens and use your example too.

    Value is: 
    UnityEngine.Debug:Log(Object)
    Slots:Start() (at Assets/Slots.cs:20)

    Then i use this and the default string value of that variables is -EMPTY-
    and the results was:


    UnityEngine.Debug:Log(Object)
    Slots:Start() (at Assets/Slots.cs:26)

    https://pastebin.com/fteugqGe


  • Works for me, so long as the variables you reference are linked to Options Data.

    Are Global Variables 82, 83 and 84 linked?  And the IDs of the Profiles 0, 1 and 2?
  • I'm trying to achieve a similar thing, but the only problem with what I'm doing is that an issue arises when you try to use Steam Auto-Cloud. I need only two specific variables from the options data to be saved in the same location as the global variables, but none of the other options-linked variables should be saved there.

    I tried just switching to different profiles to set each profile button individually, but for some reason, all the buttons end up showing the information from the originally active profile, instead of the right information for each profile.

    Is there any way to accomplish either of these and still have it work with Steam Auto-Cloud?

  • By the way, when I mentioned an issue with Steam Auto-cloud, I meant that if you link the variables to the Options data and use the Profile Name when listing the profiles, neither of that data is saved in the folder where the Global variables are saved. So when you use Steam Auto-cloud, it doesn't sync that data, and it causes the game to break when you install the game on a new computer with pre-existing profile data and saves.

    I could move the options data to the same folder where the Global variables are saved, and thus cause the options data to be synced too, but that would mean that all off the options will be saved, not just the ones you need for the profile. And that would cause issues for if there are player preferences that need to be different between devices, like for performance reasons and such.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.