Forum rules - please read before posting.

Global variables and Fungus

Fungus is a free visual novel editor for Unity.

Basiaclly, I need a way to have variables communicate between AC and Fungus. Is this easily done? Can someone talk me through the process? 

Thank you. 

Comments

  • You would have to write code that sets the value of a Fungus variable to that of an AC one (or vice-versa).  I don't know the syntax of Fungus' variables/functions, but presumably you do.

    AC's GlobalVariable's script contains static functions that can be used to read/write AC Global Variables, e.g:

    bool myBool = AC.GlobalVariables.GetBooleanValue (2);   // Where "2" is the ID number of the AC boolean
    AC.GlobalVariables.SetBooleanValue (2, true); // Where "2" is as above, and "true" is the new value to set it as

    More functions like this are in section 12.7 of the manual.

    If you placed such code within the Run() function of a custom Action, you could transfer values whenever you like, e.g. after a Variable: Set Action.  A tutorial on custom Actions can be read here.
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.