Forum rules - please read before posting.

Mini game outside Adventure Creator

Hi, I was looking some guide to my problem.
I have done a mini-game using unity and c# outside adventure creator. But I need some variables to check if you win or not. 
For example: end the minigame win=true and in adventure creator that reflex the same variable.
Another thing the minigame is in another scene so the idea is the same you enter the minigame change scene without ac, and then came back to the scene with ac with the results. 

Comments

  • AC variables can be manipulated through script - see the front page of the scripting guide.

    After AC switches to a non-AC scene with the Scene: Switch Action, the PersistentEngine will still be present in the scene hierarchy but will sleep until you re-enter an AC scene (i.e. one with a GameEngine in it).  During this time, however, you can still manipulate AC Global Variables through script.
  • Great, another thing, I have some text on this script and the UI this can manipulate with ac for the translation? 
  • If you store the text contents as a Global String variable, it can be translated.
  • Hi Chris i want to get the value of a global variable and i do this:

    using UnityEngine;
    using AC;

    public class PokerStartManager : MonoBehaviour
    {
        
        public string ref;


        void Start ()
        {
            ref=GlobalVariables.GetStringValue(33, true, 0));
            
        }

    }

    I have the global string with an initial value called "as" but nothing happens with my variable ref, is still empty.
    Any solution?
  • Which versions of AC / Unity, and is there a PersistentEngine object in your scene's Hierarchy?  Any Warning messages in the Console?

    As it's not clear if AC has yet initialised (since you're running this in Start), try renaming "Start" to "Update" to see if it's eventually reading it.
  • AC 1.62.0 Unity 2017.3.1f1
    I have an empty object with the script. Nothing in the console. I try with Debug.Log(GlobalVariables.GetStringValue(33, true, 0)); in the update and again an empty string.  
  • edited April 2018
    Is there a Persistent Engine prefab in the Hierarchy, and is this scene loaded from an AC one via the Scene: Switch Action?
  • Thats was the problem. when a use Scene:Switch action work great!
    Thanks 
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.