### Show GUI Start for MenuElement Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Handles the initial setup for displaying the GUI of a MenuElement. Often involves preparing UI elements for interaction. ```csharp void **ShowGUIStart** (Menu menu, System.Action< ActionListAsset > showALAEditor) { // Implementation details for ShowGUIStart } ``` -------------------------------- ### bool | SmartFieldStart Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_select Starts a smart field. ```APIDOC ## bool | SmartFieldStart ### Description Starts a smart field. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters - **label** (string) - Required - The label. - **filteredParameters** (ActionParameter[]) - Required - The filtered parameters. - **_parameterID** (ref int) - Required - The parameter ID (passed by reference). - **parameterLabel** (string) - Required - The parameter label. ### Request Example N/A ### Response N/A #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Initialize ActionList - C# Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_cutscene Initializes the ActionList, performing any necessary setup before execution. This is a standard method called when an action list is about to start or be managed. ```csharp void Initialise () ``` -------------------------------- ### Start Component Initialization Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_remember_timeline-members The initial entry point for the AC.ConstantID component when the scene starts. This protected virtual method allows for setup operations that need to occur before other scripts might interact with this component. ```csharp protected virtual void Start() { // Initial setup logic } ``` -------------------------------- ### static bool | SmartFieldStart Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_interaction_check Starts a smart field. ```APIDOC ## static bool | SmartFieldStart ### Description Starts a smart field. ### Method N/A ### Endpoint static bool | SmartFieldStart (string label, ActionParameter[] filteredParameters, ref int _parameterID, string parameterLabel) ### Parameters #### Path Parameters - **label** (string) - Required - The label. - **filteredParameters** (ActionParameter[]) - Required - The filtered parameters. - **_parameterID** (ref int) - Required - The parameter ID. - **parameterLabel** (string) - Required - The parameter label. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Character Initialization and Setup Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_anim_engine___sprites_unity_complex-members Functions for declaring characters and setting up their animation components. ```APIDOC ## Character Initialization and Setup ### Description Functions related to initializing and setting up character components and their animators. ### Functions - **Declare(AC.Char _character)**: Declares a character within the animation system. - **SetDirection(Animator animator)**: Protected method to set the direction for a given animator. ### Requirements - **RequiresRememberAnimator(ActionCharAnim action)**: Checks if the animator needs to be remembered for character actions. - **RequiresRememberAnimator(ActionAnim action)**: Checks if the animator needs to be remembered for general actions. ``` -------------------------------- ### Initialization and Setup Methods Source: https://adventurecreator.org/scripting-guide/functions_i Methods used for initializing various systems and components within Adventure Creator. ```APIDOC ## Initialization and Setup Methods ### Description This section lists methods responsible for initializing and setting up different systems and components. ### Methods - **Init()** (AC.BulkCreateVarsWindow, AC.ExportWizardWindow, AC.ImportWizardWindow, AC.InvItemExportWizardWindow, AC.InvItemImportWizardWindow, AC.PhonemesWindow, AC.SceneAttributesWindow, AC.ScriptSheetWindow, AC.SpeechTagsWindow, AC.VarExportWizardWindow): General initialization method for various windows and tools. - **Initalise()** (AC.Menu): Initializes a menu. - **Initialise()** (AC.ActionList, AC.MenuButton, AC.MenuElement, AC.MenuJournal, AC.SubScene): Initializes action lists, menu elements, journals, and sub-scenes. - **InitialiseCursorLock()** (AC.PlayerInput): Initializes cursor locking for player input. - **InitialiseObjects()** (AC.SceneManager): Initializes all objects in the scene. - **InitialiseGVar()** (AC.GVar): Initializes a GVar. - **InitialiseInventory()** (AC.InvBin): Initializes the inventory bin. - **InvBin()** (AC.InvBin): Constructor for InvBin. - **InvCollection()** (AC.Container, AC.InvCollection): Constructor for InvCollection. ``` -------------------------------- ### Start() Method Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_moveable___drag Initializes the moveable object, potentially reimplemented from a base class. ```APIDOC ## Start() ### Description Initializes the moveable object. Reimplemented from AC.DragBase. ### Method `override void` ### Endpoint `AC.Moveable_Drag.Start` ### Parameters None ``` -------------------------------- ### Start Function in AC._Camera Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_game_camera_array The virtual Start function, inherited from AC._Camera, is a standard Unity message called before the first frame update. It's used for setup that depends on other objects being initialized. ```csharp virtual void Start () ``` -------------------------------- ### PlayerStart Class Documentation Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_player_start Documentation for the AC.PlayerStart class, outlining its public member functions and attributes for managing player start points. ```APIDOC ## AC.PlayerStart ### Description Defines a possible starting position for the Player when the scene loads, based on what the previous scene was. If no appropriate PlayerStart is found, then the defaultPlayerStart defined in SceneSettings will be used instead. ### Public Member Functions #### DrawGizmos() - **Description**: Reimplemented from AC.Marker. Draws Gizmos in the scene view. - **Signature**: `override void DrawGizmos()` #### PlacePlayerAt() - **Description**: Places the Player at the GameObject's position, and activates the assigned `cameraOnStart`. - **Signature**: `void PlacePlayerAt()` #### SetCameraOnStart() - **Description**: Makes the assigned `cameraOnStart` the active _Camera. - **Signature**: `void SetCameraOnStart()` #### MatchesPreviousScene() - **Description**: Checks if this PlayerStart matches the previous scene based on player ID. - **Signature**: `virtual bool MatchesPreviousScene(int _playerID, bool canAcceptEmpty = false)` ### Public Attributes - **chooseSceneBy** (ChooseSceneBy) - Optional - Defaults to `ChooseSceneBy.Number`. If `autoActivateFromPrevious` is True, this determines how the previous scene is identified (by Number or Name). - **previousScene** (int) - Stores the ID of the previous scene. - **previousSceneName** (string) - Stores the name of the previous scene. - **fadeInOnStart** (bool) - If True, the MainCamera will fade in when the Player starts the scene from this point. - **fadeSpeed** (float) - Optional - Defaults to `0.5f`. The speed of the fade, if `fadeInOnStart` is True. - **cameraOnStart** (_Camera) - The _Camera that should be made active when the Player starts the scene from this point. - **playerIDs** (List) - A list of player IDs that this PlayerStart is valid for. - **limitByPlayer** (bool) - Whether to limit activation by player. - **limitByActive** (PlayerStartActiveOption) - Optional - Defaults to `PlayerStartActiveOption.NoLimit`. Whether to limit activation by active / inactive Players. ### Protected Attributes - **playerOb** (GameObject) - The GameObject representing the player. ### Inherited Members from AC.Marker #### Protected Member Functions - **Awake** () - **OnDrawGizmos** () - **OnDrawGizmosSelected** () #### Properties - **Position** (Vector3) - Gets or sets the position of the Marker. - **ForwardAngle** (float) - Gets the forward angle of the Marker. - **ForwardDirection** (Vector3) - Gets the forward direction of the Marker. - **Rotation** (Quaternion) - Gets the rotation of the Marker. - **Transform** (Transform) - Gets the Transform component of the Marker. ``` -------------------------------- ### Handle Component Initialization with Start Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_remember_transform A protected virtual member function called when the script instance is being loaded. This is a standard Unity message. ```csharp virtual void AC.ConstantID.Start() { // Implementation for Start } ``` -------------------------------- ### Get Drag Start Position Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_interaction Retrieves the starting position of a drag operation for the element. This returns a Vector2. ```csharp Vector2 | GetDragStart () | Gets the drag offset. ``` -------------------------------- ### Call_OnOccupyPlayerStart() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_event_manager Triggers the OnOccupyPlayerStart event when a player occupies a player start point. ```APIDOC ## Call_OnOccupyPlayerStart() ### Description Triggers the OnOccupyPlayerStart event when a player occupies a player start point. ### Method N/A (This appears to be a function call within the script) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "_player_": "Player", "_playerStart_": "PlayerStart" } ``` ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Initialization and Lifecycle Functions in AC.ConstantID Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_remember_game_camera2_d_drag-members This snippet includes protected virtual functions like OnEnable, OnDisable, Start, and OnInitialiseScene from AC.ConstantID. These are standard Unity MonoBehaviour methods used for managing the component's lifecycle and initial setup. ```C# protected void OnEnable() { // Implementation for enabling the component } protected void OnDisable() { // Implementation for disabling the component } protected virtual void OnInitialiseScene() { // Implementation for initial scene setup } protected virtual void Start() { // Implementation for component start } ``` -------------------------------- ### Show GUI Start Menu Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_saves_list Initiates the GUI start process for a menu, often used in conjunction with an ActionListAsset editor for showing custom editors. ```csharp void ShowGUIStart (Menu menu, System.Action showALAEditor) ``` -------------------------------- ### ShowGUI Methods Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_prefab-members Methods for displaying the GUI for action inventory prefabs and actions. ```APIDOC ## ShowGUI Methods ### Description Virtual methods responsible for displaying the graphical user interface for action inventory prefabs and general actions. ### Method ``` ShowGUI(List parameters) AC::Action.ShowGUI() ``` ### Endpoint ``` AC.ActionInventoryPrefab, AC.Action ``` ### Parameters #### Path Parameters None ``` -------------------------------- ### GetDragStart Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_profiles_list Gets the starting position of a drag operation. ```APIDOC ## GET /websites/adventurecreator_scripting-guide/MenuProfilesList/GetDragStart ### Description Retrieves the initial position from where a drag operation started. ### Method GET ### Endpoint /websites/adventurecreator_scripting-guide/MenuProfilesList/GetDragStart ### Parameters None ### Request Example ```json { "example": "GET /websites/adventurecreator_scripting-guide/MenuProfilesList/GetDragStart" } ``` ### Response #### Success Response (200) - **dragStartPosition** (Vector2) - The starting position of the drag. #### Response Example ```json { "example": { "dragStartPosition": { "x": 150, "y": 250 } } } ``` ``` -------------------------------- ### Create New Start Action Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_char_follow-members Creates a new 'start follow' action for a character. ```APIDOC ## CreateNew_Start ### Description Creates and configures a new action that makes an NPC start following a character, with options for distance, update frequency, and idle behavior. ### Method N/A (This appears to be a static factory method for creating actions, not a direct endpoint). ### Endpoint N/A ### Parameters * **npcToMove** (NPC) - The NPC that will start following. * **characterToFollow** (AC.Char) - The character the NPC will follow. * **minimumDistance** (float) - The minimum distance to maintain from the followed character. * **maximumDistance** (float) - The maximum distance to maintain from the followed character. * **updateFrequency** (float) - How often the follow logic updates (defaults to 2f). * **randomisePosition** (bool) - Whether to randomise the position within the follow distance (defaults to false). * **faceCharacterWhenIdle** (bool) - Whether the NPC should face the followed character when idle (defaults to false). ``` -------------------------------- ### Speech Constructor and Initialization Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_speech Demonstrates the different ways to construct a Speech object, including the default constructor with detailed parameters and a simplified constructor for script-sheet exports. It also covers initializing speech with speaker, message, line ID, and animation preferences. ```csharp /// /// The default Constructor. /// public Speech(AC.Char _speaker, string _message, int lineID, bool _isBackground, bool _noAnimation, bool _preventSkipping = false, AudioClip audioOverride = null, TextAsset lipsyncOverride = null) /// /// A special-case Constructor purely used to display text without tags when exporting script-sheets. /// public Speech(string _message) public Speech(AC.Char _speaker, string _message) ``` -------------------------------- ### Get MenuElement Size Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the overall size of the MenuElement. Returns a Vector2 representing width and height. ```csharp Vector2 GetSize () { // Implementation details for GetSize } ``` -------------------------------- ### ShowGUI() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_check_multiple_template Shows the Action's GUI. ```APIDOC ## ShowGUI() ### Description Shows the Action's GUI. ### Method POST (conceptual, as this is a member function that modifies state) ### Endpoint N/A (Member function of ActionCheckMultipleTemplate) ### Parameters None ### Request Example None ### Response #### Success Response (void) - No specific return value, indicates success. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### static int | ChoosePlayerGUI Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_interaction_check Displays player GUI. ```APIDOC ## static int | ChoosePlayerGUI ### Description Displays player GUI. ### Method N/A ### Endpoint static int | ChoosePlayerGUI (int _playerID, bool includeActiveOption=false, string label="Player:") ### Parameters #### Path Parameters - **_playerID** (int) - Required - The player ID. - **includeActiveOption** (bool) - Optional - If include active option. - **label** (string) - Optional - The label. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get MenuElement RectTransform Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the boundary of the MenuElement or a specific slot within it. This is used for positioning and layout calculations. ```csharp override RectTransform GetRectTransform (int _slot) { // Implementation details for getting RectTransform } ``` -------------------------------- ### Action Methods - Initialization and Utility Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_select-members Covers methods for initializing actions, managing lists, and utility functions like creating new actions or converting variables. ```APIDOC ## Initialization and Utility Methods ### Description Methods for creating new actions, clearing data, and converting variables. ### Methods - **AssignValues**(List< ActionParameter > parameters) - **ClearIDs**() - **ConvertGlobalVariableToLocal**(int oldGlobalID, int newLocalID, bool isCorrectScene) - **ConvertLocalVariableToGlobal**(int oldLocalID, int newGlobalID) - **CreateNew**(string className) - **CreateNew < T >**() - **CreateNew_DeselectActive**() - **CreateNew_Select**(int itemID, bool addIfNotCarrying=false, SelectItemMode selectItemMode=SelectItemMode.Use) ``` -------------------------------- ### Initialize UI for Parameter Input - SmartFieldStart Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_save_handle-members Initializes the starting point for a smart field, used for inputting parameters. It takes a label, an array of filtered parameters, and a reference to the parameter ID. This is crucial for dynamically generating UI elements based on action parameters. ```csharp AC.Action.SmartFieldStart(string label, ActionParameter[] filteredParameters, ref int _parameterID, string parameterLabel) ``` -------------------------------- ### ActionMenuItem[] | GetMenuItems Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_select Gets the menu items. ```APIDOC ## ActionMenuItem[] | GetMenuItems ### Description Gets the menu items. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Run Scripted Action List Example - C# Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_scripted_action_list_example This C# script demonstrates how to generate ActionLists through scripting in Adventure Creator. It includes methods to manage translatable text, such as checking if text can be translated, getting the number of translatable texts, and retrieving translation IDs. It implements the ITranslatable interface, primarily for integrating with the Speech Manager. ```csharp using UnityEngine; using AC; public class ScriptedActionListExample : MonoBehaviour { // Example method to run the first ActionList example public void RunExampleOne() { // Implementation details for running Example One } // Method to get translatable string by index public string GetTranslatableString(int index) { // Implementation details for getting translatable string return ""; } // Method to get the translation ID of a given text index public int GetTranslationID(int index) { // Implementation details for getting translation ID return 0; } // Method to update translatable string public void UpdateTranslatableString(int index, string updatedText) { // Implementation details for updating translatable string } // Method to get the maximum number of possible translatable texts public int GetNumTranslatables() { // Implementation details for getting the number of translatables return 0; } // Method to check if a given text index has an existing translation public bool HasExistingTranslation(int index) { // Implementation details for checking existing translation return false; } // Method to set the translation ID of a given text index public void SetTranslationID(int index, int _lineID) { // Implementation details for setting translation ID } // Method to get the owner of the translatable text public string GetOwner(int index) { // Implementation details for getting owner return ""; } // Method to check if the owner of the translatable text is the Player public bool OwnerIsPlayer(int index) { // Implementation details for checking if owner is player return false; } // Method to get the translation type of a given text index public AC_TextType GetTranslationType(int index) { // Implementation details for getting translation type return AC_TextType.Speech; } // Method to check if a given text index can and should be translated public bool CanTranslate(int index) { // Implementation details for checking if text can be translated return false; } } ``` -------------------------------- ### Get Next Output Index - C# Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_camera_split-members Gets the index for the next output in an AC.Action. This is a virtual method defined in AC.Action. ```csharp GetNextOutputIndex()| AC.Action| virtual ``` -------------------------------- ### ShowGUI() Method Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_inventory_box Displays the GUI for the inventory box, potentially with an option to show the ActionList Asset editor. ```APIDOC ## ShowGUI() Method ### Description Displays the GUI for the inventory box. ### Method `override void AC.MenuInventoryBox.ShowGUI(Menu _menu_, System.Action _showALAEditor_) ` ### Parameters * **_menu_** (Menu) - The menu context for the GUI display. * **_showALAEditor_** (System.Action) - An action to perform if the ActionList Asset editor should be shown. ### Remarks This method is a virtual override and is reimplemented from AC.MenuElement. ``` -------------------------------- ### EventSpeechStart Class Documentation Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_event_speech_start-members Documentation for the EventSpeechStart class, which handles the start of speech events in Adventure Creator. ```APIDOC ## EventSpeechStart Class ### Description This class is responsible for initiating speech events within Adventure Creator, managing parameters related to speakers and how speech starts. ### Methods #### Constructor - **EventSpeechStart**(int _id, string _label, ActionListAsset _actionListAsset, int[] _parameterIDs, SpeakerType _speakerType, StartStop _startStop) - Initializes a new instance of the `EventSpeechStart` class with specified parameters. - **EventSpeechStart**() - Initializes a new, empty instance of the `EventSpeechStart` class. #### Public Methods - **AssignVariant**(int variantIndex) - Assigns a variant to the event. - **GetParameterReferences**() - Retrieves references to the event's parameters. - **Register**() - Registers the event. - **Unregister**() - Unregisters the event. #### Protected Methods - **ConditionHelp**() - Provides help text for conditions related to this event. - **HasConditions**(bool isAssetFile) - Checks if the event has associated conditions. - **ShowConditionGUI**(bool isAssetFile) - Displays the GUI for managing conditions. ### Properties #### Public Properties - **EditorNames** - Returns the editor names for the event. - **SpeakerType** - Gets the speaker type for the speech event. - **StartStop** - Gets the start/stop behavior for the speech event. #### Protected Properties - **EventName** - Returns the name of the event. ### Inheritance This class inherits from `AC.EventBase`. ### Related Enums - **SpeakerType**: Defines the types of speakers. - **StartStop**: Defines how the speech event starts and stops. ``` -------------------------------- ### Get MenuElement Label Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the display text of the MenuElement or a slot within it for a given language. Used for displaying text to the user. ```csharp virtual string GetLabel (int slot, int languageNumber) { // Implementation details for GetLabel } ``` -------------------------------- ### GET /api/variables/references Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_manage_profiles Gets the number of references an Action makes to a variable using the GetNumVariableReferences() method. This is useful for understanding variable dependencies. ```APIDOC ## GET /api/variables/references ### Description Gets the number of references the Action makes to a variable. ### Method GET ### Endpoint /api/variables/references ### Parameters #### Query Parameters - **location** (VariableLocation) - Required - The variable's location (Global, Local) - **varID** (int) - Required - The variable's ID number - **parameters** (List) - Required - The List of ActionParameters associated with the ActionList that contains the Action - **variables** (Variables) - Optional - The Variables component, if location = VariableLocation.Component - **variablesConstantID** (int) - Optional - The ID number for the Variables component if it is a constant ### Response #### Success Response (200) - **referenceCount** (int) - The number of references the Action makes to the variable #### Response Example ```json { "referenceCount": 5 } ``` ``` -------------------------------- ### Show Menus Enabled on Start (C#) Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_player_menus Enables all menus that are configured to be visible at the start of the game. This ensures the initial UI state is correctly presented to the player. ```csharp void AC.PlayerMenus.ShowEnabledOnStartMenus(); ``` -------------------------------- ### ShowTextureGUI() Method Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_inventory_box Displays the texture-based GUI for the inventory box. ```APIDOC ## ShowTextureGUI() Method ### Description Displays the texture-based GUI for the inventory box. ### Method `protected virtual void AC.MenuInventoryBox.ShowTextureGUI(string _apiPrefix_) ` ### Parameters * **_apiPrefix_** (string) - A prefix for API calls related to this display. ### Remarks This method is a protected virtual override and is reimplemented from AC.MenuElement. ``` -------------------------------- ### AC.Action.Title - Get Action Title Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action Retrieves the title of an Action. This is a virtual string property that can be accessed to get the display name of any action. ```APIDOC ## GET AC.Action.Title ### Description Retrieves the title of an Action. This is a virtual string property that can be accessed to get the display name of any action. ### Method GET ### Endpoint `/websites/adventurecreator_scripting-guide/AC.Action.Title` ### Parameters (No parameters for this property) ### Request Example (Not applicable for a property getter) ### Response #### Success Response (200) - **title** (string) - The title of the Action. #### Response Example ```json { "title": "My Action Title" } ``` ``` -------------------------------- ### Get MenuElement Slot Centres Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the element's slot centres as an array of Vector2s. This is used for keyboard navigation within menus. ```csharp Vector2[] GetSlotCentres (AC.Menu _menu) { // Implementation details for GetSlotCentres } ``` -------------------------------- ### SmartFieldStart Method Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_char_hold Initiates the handling of a smart field within the Action editor. This method prepares the UI for parameter selection. ```csharp static bool SmartFieldStart (string label, ActionParameter[] filteredParameters, ref int _parameterID, string parameterLabel) // Replaces a Collider based on an ActionParameter or ConstantID instance, if appropriate. ``` -------------------------------- ### SelectedObjective Property Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_runtime_objectives Gets or sets the instance of the currently-selected Objective. ```APIDOC ## GET/PUT /websites/adventurecreator_scripting-guide/RuntimeObjectives/SelectedObjective ### Description Gets or sets the instance of the currently-selected Objective. ### Method GET, PUT ### Endpoint /websites/adventurecreator_scripting-guide/RuntimeObjectives/SelectedObjective ### Parameters #### GET Request Body (not applicable) #### PUT Request Body - **objectiveInstance** (ObjectiveInstance) - Required - The ObjectiveInstance to set as selected ### Request Example (GET) ```json { "request": "GET /websites/adventurecreator_scripting-guide/RuntimeObjectives/SelectedObjective" } ``` ### Request Example (PUT) ```json { "objectiveInstance": { ... } } ``` ### Response #### Success Response (200) - **objectiveInstance** (ObjectiveInstance) - The currently-selected ObjectiveInstance (for GET) - **message** (string) - Confirmation message (for PUT) #### Response Example (GET) ```json { "objectiveInstance": { ... } } ``` #### Response Example (PUT) ```json { "message": "Selected objective updated." } ``` ``` -------------------------------- ### PlayerStartDataEditor - Init Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_player_start_data_editor Initializes the PlayerStartDataEditor for a specific player index. ```APIDOC ## void Init (int _playerIndex) ### Description Initializes the PlayerStartDataEditor for a specific player index. ### Method void ### Parameters #### Path Parameters - **_playerIndex** (int) - Required - The index of the player to initialize. ### Response #### Success Response (200) - **void** - This function does not return a value. ``` -------------------------------- ### Call_OnStartScene() Event Source: https://adventurecreator.org/scripting-guide/functions_c Handles actions when a scene is started. Allows for custom behavior when a scene loads. ```APIDOC ## Call_OnStartScene() ### Description This event is called when a scene is started. It allows for custom actions when a scene begins. It is part of the AC.EventManager system. ### Method N/A - This is an event call. ### Endpoint AC.EventManager ### Parameters N/A ### Request Example N/A - Event calls don't have request bodies. ### Response N/A - Event calls don't have direct responses. ``` -------------------------------- ### GetReferencedActionListAssets Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_timer_set Gets the referenced ActionList assets. ```APIDOC ## virtual List< ActionListAsset > GetReferencedActionListAssets () ### Description Gets the referenced ActionList assets. ### Method List< ActionListAsset > ``` -------------------------------- ### RunFromIndex() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_list Runs the Actions of an ActionList starting from a specified index. ```APIDOC ## POST /api/actionlists/runfromindex ### Description Runs the Actions from a set point. ### Method POST ### Endpoint `/api/actionlists/runfromindex` ### Parameters #### Request Body - **_index** (int) - Required - The index number of actions to start from. ### Request Example ```json { "_index": 5 } ``` ### Response #### Success Response (200) - **None** (void) - This method does not return any value. #### Response Example (No response body for void methods) ``` -------------------------------- ### Player Start and Scene Initialization Functions Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_scene_settings Functions related to initializing the player's starting position and handling scene loading events. Includes assigning the player start based on scene conditions and loading cutscenes or action lists. ```csharp void OnInitGameEngine () void OnStart () void AssignPlayerStart () void OnLoad () void PlayDefaultSound (AudioClip audioClip, bool doLoop, bool avoidRestarting=false) PlayerStart GetPlayerStart (int playerID, bool canAcceptEmpty=false) ``` -------------------------------- ### Action: ShowGUI (Overload) Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_track_region-members Displays the GUI for the action. ```APIDOC ## ShowGUI (Action Overload) ### Description Displays the graphical user interface for this action. This is a virtual method. ### Method ShowGUI ### Parameters None ### Request Example ```json {} ``` ``` -------------------------------- ### Get Dialogue Option Counts and IDs Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_conversation Functions to retrieve the number of enabled dialogue options, get an array of all option IDs, and get the total count of enabled options. Useful for iterating or summarizing available choices. ```csharp int GetNumEnabledOptions () int[] GetIDArray () int GetCount () ``` -------------------------------- ### ActionTrackSet.ShowGUI() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_track_set Shows the Action's GUI when its parent ActionList / ActionListAsset uses parameters. ```APIDOC ## POST /websites/adventurecreator_scripting-guide/ActionTrackSet/ShowGUI ### Description Shows the Action's GUI when its parent ActionList / ActionListAsset uses parameters. ### Method POST ### Endpoint /websites/adventurecreator_scripting-guide/ActionTrackSet/ShowGUI ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **parameters** (List) - Required - A List of parameters available in the parent ActionList / ActionListAsset. ### Request Example ```json { "parameters": [ { "name": "Param1", "type": "Integer", "value": 10 } ] } ``` ### Response #### Success Response (200) This endpoint does not return a response body upon success. #### Response Example ```json {} ``` ``` -------------------------------- ### Get MenuElement Slot Rect Relative Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the boundary of a slot within the MenuElement, as a proportion of the screen size. Useful for responsive UI design. ```csharp Rect GetSlotRectRelative (int _slot) { // Implementation details for GetSlotRectRelative } ``` -------------------------------- ### Menu and Creation Methods Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_platform_check Methods for retrieving menu items and creating new Action instances. ```APIDOC ## virtual ActionMenuItem[] GetMenuItems ### Description Retrieves the menu items for an action. ### Method virtual ActionMenuItem[] ### Endpoint N/A (Method signature) ### Parameters None ### Response - Type: ActionMenuItem[] ## static ActionPlatformCheck CreateNew ### Description Creates a new instance of the 'Engine: Check platform' Action. ### Method static ActionPlatformCheck ### Endpoint N/A (Method signature) ### Parameters - **platformToCheck** (PlatformType) - The platform type to check. ### Response - Type: ActionPlatformCheck ## static T CreateNew ### Description Creates a new generic Action instance. ### Method static T ### Endpoint N/A (Method signature) ### Parameters None ### Response - Type: T ## static Action CreateNew ### Description Creates a new Action instance by its class name. ### Method static Action ### Endpoint N/A (Method signature) ### Parameters - **className** (string) - The name of the Action class to create. ### Response - Type: Action ``` -------------------------------- ### Get MenuElement Size From Corner Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the Vector2 from the top-left corner of the parent Menu to the bottom-right corner of the element. Useful for UI layout calculations. ```csharp Vector2 GetSizeFromCorner () { // Implementation details for GetSizeFromCorner } ``` -------------------------------- ### ChoosePlayerGUI Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_check-members Displays a player selection GUI. ```APIDOC ## STATIC ChoosePlayerGUI ### Description Displays a player selection GUI. ### Method static ### Endpoint ChoosePlayerGUI(int _playerID, bool includeActiveOption=false, string label="Player:") ### Parameters #### Path Parameters - **_playerID** (int) - Required - The player ID. - **includeActiveOption** (bool) - Optional - Whether to include the active option. Default is false. - **label** (string) - Optional - The label for the GUI element. Default is "Player:". ### Request Example ```json { "_playerID": 1, "includeActiveOption": true, "label": "Select Player:" } ``` ### Response #### Success Response (200) - **Success** (string) - Operation success. #### Response Example ```json { "Success": "Player GUI displayed." } ``` ``` -------------------------------- ### ShowInteractions Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_runtime_inventory Sets up all interaction menus based on a specific inventory item instance. ```APIDOC ## POST /api/runtimeinventory/showinteractions ### Description Sets up all "Interaction" menus according to a specific inventory item. ### Method POST ### Endpoint /api/runtimeinventory/showinteractions ### Parameters #### Request Body - **invInstance** (InvInstance) - Required - The relevant inventory item instance. ``` -------------------------------- ### Get GameObject to Select for MenuElement Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_timer Gets the linked Unity UI GameObject associated with this MenuElement. This is used for selection logic, especially with UI navigation. ```csharp virtual GameObject GetObjectToSelect (int slotIndex=0) { // Implementation details for GetObjectToSelect } ``` -------------------------------- ### ActionParameter[] | GetFilteredParameters Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_select Gets filtered parameters based on expected types. ```APIDOC ## ActionParameter[] | GetFilteredParameters ### Description Gets filtered parameters based on expected types. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters - **_parameters** (List< ActionParameter >) - Required - The list of parameters. - **_expectedTypes** (ParameterType[]) - Required - The expected parameter types. ### Request Example N/A ### Response N/A #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### GUI Parameter Selection Methods Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_char_portrait-members Methods for displaying GUI elements to select parameters and players. ```APIDOC ## ChooseParameterGUI (ParameterType) ### Description Displays a GUI to choose a parameter of a specific type. ### Method Static ### Endpoint AC.Action ### Parameters #### Path Parameters - **label** (string) - The label for the GUI element. - **_parameters** (List) - The list of available parameters. - **_parameterID** (int) - The ID of the parameter to select. - **_expectedType** (ParameterType) - The expected type of the parameter. - **excludeParameterID** (int) - Optional. An ID of a parameter to exclude. - **tooltip** (string) - Optional. Tooltip text for the GUI element. - **alwaysShow** (bool) - Optional. Whether to always show the GUI element. ### Request Example ```json { "label": "Select Parameter", "_parameters": [], "_parameterID": 0, "_expectedType": "Variable", "excludeParameterID": -1, "tooltip": "", "alwaysShow": false } ``` ### Response #### Success Response (200) No specific response details provided. #### Response Example ```json { "message": "Parameter selection GUI displayed." } ``` ## ChooseParameterGUI (ParameterType[]) ### Description Displays a GUI to choose a parameter that matches any of the expected types. ### Method Static ### Endpoint AC.Action ### Parameters #### Path Parameters - **label** (string) - The label for the GUI element. - **_parameters** (List) - The list of available parameters. - **_parameterID** (int) - The ID of the parameter to select. - **_expectedTypes** (ParameterType[]) - An array of expected parameter types. - **excludeParameterID** (int) - Optional. An ID of a parameter to exclude. - **tooltip** (string) - Optional. Tooltip text for the GUI element. - **alwaysShow** (bool) - Optional. Whether to always show the GUI element. ### Request Example ```json { "label": "Select Parameter", "_parameters": [], "_parameterID": 0, "_expectedTypes": ["Variable", "InventoryItem"], "excludeParameterID": -1, "tooltip": "", "alwaysShow": false } ``` ### Response #### Success Response (200) No specific response details provided. #### Response Example ```json { "message": "Parameter selection GUI displayed." } ``` ## ChooseParameterGUI (Simplified) ### Description Displays a simplified GUI to choose a parameter. ### Method Static ### Endpoint AC.Action ### Parameters #### Path Parameters - **_parameters** (List) - The list of available parameters. - **_parameterID** (int) - The ID of the parameter to select. ### Request Example ```json { "_parameters": [], "_parameterID": 0 } ``` ### Response #### Success Response (200) No specific response details provided. #### Response Example ```json { "message": "Simplified parameter selection GUI displayed." } ``` ## ChoosePlayerGUI ### Description Displays a GUI to choose a player. ### Method Static ### Endpoint AC.Action ### Parameters #### Path Parameters - **_playerID** (int) - The ID of the player to select. - **includeActiveOption** (bool) - Optional. Whether to include an option for the active player. - **label** (string) - Optional. The label for the GUI element. ### Request Example ```json { "_playerID": 0, "includeActiveOption": false, "label": "Player:" } ``` ### Response #### Success Response (200) No specific response details provided. #### Response Example ```json { "message": "Player selection GUI displayed." } ``` ``` -------------------------------- ### ActionParameter[] | GetFilteredParameters Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_inventory_select Gets filtered parameters based on expected type. ```APIDOC ## ActionParameter[] | GetFilteredParameters ### Description Gets filtered parameters based on expected type. ### Method N/A ### Endpoint N/A ### Parameters #### Path Parameters - **_parameters** (List< ActionParameter >) - Required - The list of parameters. - **_expectedType** (ParameterType) - Required - The expected parameter type. ### Request Example N/A ### Response N/A #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Start Single Axis QTE - C# Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_player_q_t_e Starts a QTE that requires a single input axis to be pressed. Parameters include the input axis name, duration, threshold for success, and optional animator and failure conditions. ```csharp void AC.PlayerQTE.StartSingleAxisQTE(string inputName, float duration, float axisThreshold, Animator animator = null, bool wrongKeyFails = false) { // Implementation details for starting a single axis QTE } ``` -------------------------------- ### ActionList: Interact() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_list Starts the execution of the ActionList's actions from the beginning. ```APIDOC ## ◆ Interact() ### Description Runs the Actions normally, from the beginning. Reimplemented in AC.AC_Trigger. ### Method POST ### Endpoint `AC.ActionList.Interact()` ### Response #### Success Response (200) - No response body. ``` -------------------------------- ### ShowGUI() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_comment Shows the Action's GUI. This is a virtual method. ```APIDOC ## POST /websites/adventurecreator_scripting-guide/ActionComment/ShowGUI ### Description Shows the Action's GUI. ### Method POST ### Endpoint /websites/adventurecreator_scripting-guide/ActionComment/ShowGUI ### Parameters This endpoint does not accept any parameters. ### Request Example ```json {} ``` ### Response #### Success Response (200) This endpoint does not return any data upon success. #### Response Example ```json {} ``` ``` -------------------------------- ### static ActionParameter[] | GetFilteredParameters Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_interaction_check Gets filtered parameters. ```APIDOC ## static ActionParameter[] | GetFilteredParameters ### Description Gets filtered parameters. ### Method N/A ### Endpoint static ActionParameter[] | GetFilteredParameters (List< ActionParameter > _parameters, ParameterType[] _expectedTypes) ### Parameters #### Path Parameters - **_parameters** (List< ActionParameter >) - Required - The parameters. - **_expectedTypes** (ParameterType[]) - Required - The expected types. ### Request Example N/A ### Response N/A ``` -------------------------------- ### ActionSoundShot.ShowGUI Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_sound_shot Shows the Action's GUI when its parent ActionList or ActionListAsset uses parameters, facilitating parameter configuration. ```APIDOC ## POST /ActionSoundShot/ShowGUI ### Description Shows the Action's GUI when its parent ActionList / ActionListAsset uses parameters. ### Method POST ### Endpoint /ActionSoundShot/ShowGUI ### Parameters #### Request Body - **parameters** (List) - Required - A List of parameters available in the parent ActionList / ActionListAsset. ### Request Example ```json { "actionId": "some-action-id", "parameters": [ { "name": "Sound Volume", "value": 0.8 } ] } ``` ### Response #### Success Response (200) - **Success** (bool) - Indicates if the GUI was shown successfully. #### Response Example ```json { "Success": true } ``` ``` -------------------------------- ### static ActionParameter[] | GetFilteredParameters Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_interaction_check Gets filtered parameters. ```APIDOC ## static ActionParameter[] | GetFilteredParameters ### Description Gets filtered parameters. ### Method N/A ### Endpoint static ActionParameter[] | GetFilteredParameters (List< ActionParameter > _parameters, ParameterType _expectedType) ### Parameters #### Path Parameters - **_parameters** (List< ActionParameter >) - Required - The parameters. - **_expectedType** (ParameterType) - Required - The expected type. ### Request Example N/A ### Response N/A ``` -------------------------------- ### GUI Helper Methods Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_action_end_game-members Methods for creating user interface elements to select parameters and players. ```APIDOC ## GUI Helper Methods ### Description Static methods that provide GUI elements for selecting action parameters and player references within the Adventure Creator editor. ### Method Static (Called directly) ### Endpoint N/A (These are method calls within the scripting environment) ### Parameters - **label** (string) - The label for the GUI element. - **_parameters** (List) - The list of available action parameters. - **_parameterID** (int) - The ID of the current parameter. - **_expectedType** (ParameterType) / **_expectedTypes** (ParameterType[]) - The expected type(s) of the parameter. - **excludeParameterID** (int) - An optional parameter ID to exclude. - **tooltip** (string) - Tooltip text for the GUI element. - **alwaysShow** (bool) - Whether to always show the parameter. - **_playerID** (int) - The ID of the player. - **includeActiveOption** (bool) - Whether to include an option for the active player. ### Request Example ```json { "method": "ChooseParameterGUI", "parameters": [ ... ], "_parameterID": 0, "_expectedType": "ParameterType.Custom" } ``` ### Response #### Success Response (200) N/A (These methods modify GUI elements, not return data) #### Response Example N/A ``` -------------------------------- ### Initialise() Source: https://adventurecreator.org/scripting-guide/class_a_c_1_1_menu_element Performs initialization that can only be done once the element has been instantiated at runtime. ```APIDOC ## POST /websites/adventurecreator_scripting-guide/MenuElement/Initialise ### Description Performs any initialisation that can only be done once the element has been instantiated at runtime. ### Method POST ### Endpoint /websites/adventurecreator_scripting-guide/MenuElement/Initialise ### Parameters #### Query Parameters None #### Request Body - **menu** (AC.Menu) - Required - The Menu that the element is a part of. ### Request Example ```json { "menu": {"menu_data": "..."} } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the action was successful. #### Response Example ```json { "status": "success" } ``` ```