Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
void | RunExampleOne () |
string | GetTranslatableString (int index) |
int | GetTranslationID (int index) |
Gets the translation ID of a given text index. More... | |
void | UpdateTranslatableString (int index, string updatedText) |
int | GetNumTranslatables () |
Gets the maximum number of possible translatable texts. More... | |
bool | HasExistingTranslation (int index) |
Checks if a given text index has already been assigned a unique translation ID. More... | |
void | SetTranslationID (int index, int _lineID) |
Sets the translation ID of a given text index More... | |
string | GetOwner (int index) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More... | |
bool | OwnerIsPlayer (int index) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More... | |
AC_TextType | GetTranslationType (int index) |
Gets the translation type of a given text index. More... | |
bool | CanTranslate (int index) |
Checks if a given text index can and should be translated. More... | |
This script offers two examples on how ActionList can be generated through script. To use it, place the "Scripted Action List Example" component in your scene and assign the fields in the Inspector. Once in Play mode, each example can then be run by clicking the cog icon to the top-right of the Inspector and choosing either 'Run Example 1' or 'Run Example 2'.
Note: This script implements the ITranslatable interface but this is only necessary to allow the Player's speech to be included in the Speech Manager.
bool AC.ScriptedActionListExample.CanTranslate | ( | int | index | ) |
Checks if a given text index can and should be translated.
index | The index of the translatable text |
Implements AC.ITranslatable.
int AC.ScriptedActionListExample.GetNumTranslatables | ( | ) |
Gets the maximum number of possible translatable texts.
Implements AC.ITranslatable.
string AC.ScriptedActionListExample.GetOwner | ( | int | index | ) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.
index | The index of the translatable text |
Implements AC.ITranslatable.
string AC.ScriptedActionListExample.GetTranslatableString | ( | int | index | ) |
The following code is only necessary because the script implements ITranslatable. This is to demonstrate how the Player's speech line can be included in the Speech Manager for translation, audio etc. If a scripted ActionList does not require this, all of the below can be left out (provided that the implemenation is also removed in the class declaration)
Implements AC.ITranslatable.
int AC.ScriptedActionListExample.GetTranslationID | ( | int | index | ) |
Gets the translation ID of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
AC_TextType AC.ScriptedActionListExample.GetTranslationType | ( | int | index | ) |
Gets the translation type of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
bool AC.ScriptedActionListExample.HasExistingTranslation | ( | int | index | ) |
Checks if a given text index has already been assigned a unique translation ID.
index | The index of the translatable text |
Implements AC.ITranslatable.
bool AC.ScriptedActionListExample.OwnerIsPlayer | ( | int | index | ) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.
index | The index of the translatable text |
Implements AC.ITranslatable.
void AC.ScriptedActionListExample.RunExampleOne | ( | ) |
In this example, we create a linear sequence of Actions directly within the ActionList they are a part of. This sequence involves playing a simple Console message, moving the player, having him speak, and add an item to their inventory. The player's speech can also be included in the Speech Manager, but this is optional. See the ITranslatable implementation at the bottom of the script, as well as the Manual's "Custom translatables" chapter for more.
void AC.ScriptedActionListExample.SetTranslationID | ( | int | index, |
int | lineID | ||
) |
Sets the translation ID of a given text index
index | The index of the translatable text |
lineID | The new translation ID to assign the translatable text |
Implements AC.ITranslatable.