Forum rules - please read before posting.

How do I get the slot number from a SaveList menu element click?

edited December 2015 in Technical Q&A
I am trying to extend our game's save menu to do some checks before saving the game. I am currently using the SaveList without fixed slot items, and have disabled the option "Save when click on?". I am trying to rely on the ActionList script to do some check such as:

1. Is this the autosave slot? -> Don't save and let the user know!
2. Am Overriding an existing game? -> Ask the user to confirm.
3. Am I saving a new game? -> Save and notify the user.

Any tips on how to get the slot number that was selected when clicked? I've looked in the list of options in the ActionList editor but had no luck. I am also open to creating a custom Action via scripting to get what I need, but I am still unsure on how to get the clicked slot #.

Thanks!

Version: AC 1.46

Comments

  • Ah figured out my own answer after looking at the SavesList source code for a couple of hours and getting an understanding of the parameters (I'm pretty new to AC).

    In case anyone is looking for this:
    1. Create a new ActionList asset
    2. In the Project panel select the ActionList asset
    3. In the Unity Inspector panel, check "Use parameters?"
    4. Add a new parameter of type Integer. You can call it "slot"
    5. In the SavesList, select "Save when click on?"
    6. Assign this ActionList to the SavesList "ActionList when click"
    7. There you will see a parameter dropdown. Select "(0) slot"
    8. Now you can access the slot to save from the ActionList editor.
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.