Forum rules - please read before posting.

New Scene Attributes feature / Saving custom labels

Unity: v5.5.0f3 Personal
OS: Windows 10
AC: 1.55c


Hello all you peoples!

First of all, this new "Scene Attributes" feature sounds interesting, but I'm wondering if I might be using it the wrong way. I'd like to be able to give an internal name to scenes in my game, to keep track of for use when I save the game.

I've set the Scene Attribute to a string "Scene Name"... and I was wondering if there's a way I can access this directly? Like a variable?  Or is creating a global variable to keep track of the scene, and just set that directly via OnStart/OnLoad?


And secondly... I'm using Unity UI's, and I'd like to customise my save files to include TWO different lines of text. A room name/scene name above the screenshot, and the date the save was made below the screenshot.

I am well aware of the "Custom Save Game Labels" tutorial, which is fine and dandy and I can monkey with it to get something working, but can I pull from the Scene Attributes or am I forced to use a global variable?

Also, the second text for the date...  Is that possible?

Thank you!

Comments

  • edited February 2017
    Scene attributes are intended for internal management / handling of scenes, not really for transferring between variables etc.  They are read using the Scene: Check attribute Action, and cannot be written to / changed in-game.  They could feasibly be used for another purpose (e.g. used as the basis for a save game label), but this handling would need to be done via a custom Action or other script.

    A scene attribute of ID = 2 can be gotten with the following code:

    AC.InvVar myAttribute = AC.KickStarter.sceneSettings.GetAttribute (2);

    And if this was a string, its value could be transferred to a Global String variable of ID = 4 with:

    string attributeValue = myAttribute.textVal;
    AC.GlobalVariables.SetStringValue (4, attributeValue);


    Once moved to a string variable, you can use it as the basis for a save game label.

    As for the second text for the date: AC only allows for one label to be associated with a save game label.  However, you may be able to separate a label into two by placing a separator in the text itself, e.g.:

    My scene name|February 1

    And then, via custom scripting, copy all text left of the "|" to the first UI label, and all text right of it to the second.
  • Gotcha!

    I figured as much for the labelling, but it's always nice to ask.


    And, good to know about the Scene Attributes! 

    Thank you so much for your input!
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.