Adventure Creator  1.55b
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2016
Adventure Creator: Scripting guide

Welcome to Adventure Creator's scripting guide! You can use this guide to get detailed descriptions on all of ACs public functions and variables.

Adventure Creator's scripts are written in C#, and use the 'AC' namespace, so you'll need to add the following at the top of any script that accesses them:

using AC;

Accessing ACs scripts is very simple: each component on the GameEngine and PersistentEngine prefabs, as well as all Managers, can be accessed by referencing their associated static variable in the KickStarter class, e.g.:


Additionally, the Player and MainCamera can also be accessed in this way:


The KickStarter class also has functions that can be used to turn AC off or on completely:

AC.KickStarter.TurnOff ();
AC.KickStarter.TurnOn ();

The variable that determines AC's main state is the gameState, inside StateHandler. Reading this variable can determine if the game is currently in a cutscene or not.


If you want to place the game in a scripted cutscene, the StateHandler has functions for that, too:

AC.KickStarter.stateHandler.StartCutscene ();
AC.KickStarter.stateHandler.EndCutscene ();

The StateHandler is important because it updates all of AC's scene objects. It does this by taking a record of all the objects in the scene. Therefore, if you add or remove objects from a scene mid-game through script, you will need to update the StateHandler's internal list of objects to update. You can do this by calling:

AC.KickStarter.stateHandler.GatherObjects ();

All-scene based ActionLists, inculding Cutscenes and Triggers, derive from the ActionList class.

You can run ActionListAsset assets from the AdvGame class, which contains a number of helpful general functions.

Global and Local variables can be read and written to with static functions in the GlobalVariables and LocalVariables classes respectively:

AC.LocalVariables.SetStringValue (int _id, string _value);

More common functions and variables can be found under Section 12.7 of the AC Manual. Happy scripting!