Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.Objective Class Reference
Inheritance diagram for AC.Objective:
AC.ITranslatable

Public Member Functions

 Objective (int[] idArray)
void RebuildProperties ()
InvVar GetProperty (int ID)
 Gets a property of the Document.
InvVar GetProperty (string propertyName)
 Gets a property of the Document.
ObjectiveState GetState (int stateID)
 Gets a state with a particular ID number.
string GetTitle (int languageNumber=0)
 Gets the objective's title text in a given language.
string GetDescription (int languageNumber=0)
 Gets the objective's description text in a given language.
override string ToString ()
void ShowGUI (string apiPrefix, System.Action< ActionListAsset > showALAEditor)
int StateSelectorList (int selectedID, string label="State:")
string[] GenerateEditorStateLabels ()
string GetTranslatableString (int index)
 Gets the text to be translated, given its index.
int GetTranslationID (int index)
 Gets the translation ID of a given text index.
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index.
void UpdateTranslatableString (int index, string updatedText)
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts.
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID.
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index.
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.
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.
bool CanTranslate (int index)
 Checks if a given text index can and should be translated.

Public Attributes

int ID
int titleLineID = -1
string description
int descriptionLineID = -1
bool perPlayer = false
Texture2D texture
List< ObjectiveStatestates
bool lockStateWhenComplete = true
bool lockStateWhenFail = true
int binID = 0
List< InvVarvars = new List<InvVar>()

Protected Member Functions

int[] GetStateIDArray ()
void SideStateMenu ()
void StateCallback (object obj)
void MoveStateToTop (int a1)
void MoveStateToBottom (int a1)
void SwapStates (int a1, int a2)

Protected Attributes

string title
int sideState
int selectedState
Vector2 scrollPos
bool showStateGUI = true
bool showPropertiesGUI = true

Properties

string Title [get, set]
int NumStates [get]

Detailed Description

Stores data for an Objective, which can be viewed/read in a Menu

Member Function Documentation

◆ CanTranslate()

bool AC.Objective.CanTranslate ( int index)

Checks if a given text index can and should be translated.

Parameters
indexThe index of the translatable text
Returns
True if the text can and should be translated

Implements AC.ITranslatable.

◆ GetDescription()

string AC.Objective.GetDescription ( int languageNumber = 0)

Gets the objective's description text in a given language.

Parameters
languageNumberThe language index, where 0 = the game's default language
Returns
The description text

◆ GetNumTranslatables()

int AC.Objective.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOwner()

string AC.Objective.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.

Parameters
indexThe index of the translatable text
Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetProperty() [1/2]

InvVar AC.Objective.GetProperty ( int ID)

Gets a property of the Document.

Parameters
IDThe ID number of the property to get
Returns
The property of the Document

◆ GetProperty() [2/2]

InvVar AC.Objective.GetProperty ( string propertyName)

Gets a property of the Document.

Parameters
propertyNameThe name of the property to get
Returns
The property of the Document

◆ GetState()

ObjectiveState AC.Objective.GetState ( int stateID)

Gets a state with a particular ID number.

The ID number of the state to get

Returns
The Objective state

◆ GetTitle()

string AC.Objective.GetTitle ( int languageNumber = 0)

Gets the objective's title text in a given language.

Parameters
languageNumberThe language index, where 0 = the game's default language
Returns
The title text

◆ GetTranslatableString()

string AC.Objective.GetTranslatableString ( int index)

Gets the text to be translated, given its index.

Parameters
indexThe index of the translatable text
Returns
The text to be translated

Implements AC.ITranslatable.

◆ GetTranslationID()

int AC.Objective.GetTranslationID ( int index)

Gets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation ID of the text

Implements AC.ITranslatable.

◆ GetTranslationType()

AC_TextType AC.Objective.GetTranslationType ( int index)

Gets the translation type of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation type of a given text index.

Implements AC.ITranslatable.

◆ HasExistingTranslation()

bool AC.Objective.HasExistingTranslation ( int index)

Checks if a given text index has already been assigned a unique translation ID.

Parameters
indexThe index of the translatable text
Returns
True if the text has been assigned a unique translation ID

Implements AC.ITranslatable.

◆ OwnerIsPlayer()

bool AC.Objective.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.

Parameters
indexThe index of the translatable text
Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ SetTranslationID()

void AC.Objective.SetTranslationID ( int index,
int lineID )

Sets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
lineIDThe new translation ID to assign the translatable text

Implements AC.ITranslatable.

◆ UpdateTranslatableString()

void AC.Objective.UpdateTranslatableString ( int index,
string updatedText )

Implements AC.ITranslatable.

Member Data Documentation

◆ binID

int AC.Objective.binID = 0

The Objective's Category ID

◆ description

string AC.Objective.description

An overall description for the objective

◆ descriptionLineID

int AC.Objective.descriptionLineID = -1

The translation ID for the description text, generated by the Speech Manager

◆ ID

int AC.Objective.ID

A unique identifier

◆ lockStateWhenComplete

bool AC.Objective.lockStateWhenComplete = true

If True, the state cannot be changed once it is considered complete

◆ lockStateWhenFail

bool AC.Objective.lockStateWhenFail = true

If True, the state cannot be changed once it is considered failed

◆ perPlayer

bool AC.Objective.perPlayer = false

If True, and player switching is enabled, then this Objective's state will be limited to the current Player

◆ states

List<ObjectiveState> AC.Objective.states

A list of all possible states the Objective can be

◆ texture

Texture2D AC.Objective.texture

An associated texture

◆ titleLineID

int AC.Objective.titleLineID = -1

The translation ID for the title text, generated by the Speech Manager

◆ vars

List<InvVar> AC.Objective.vars = new List<InvVar>()

The Objective's properties

Property Documentation

◆ NumStates

int AC.Objective.NumStates
get

How many states the objective can take

◆ Title

string AC.Objective.Title
getset

The objective's title