VoidExpanse/scope-topic

From AtomicTorchWiki


Scope topic

Topic scope is used only inside topic scripts. Controls dialogs and quests.

Visibility: In topics only.

List of functions

AddChoice
Arguments Returns Example
  • int: choice_id
  • string: choice_localisation_id
  • string: choice_text
  • (optional) object: parameters

void

topic.AddChoice(1, "c001", "I'd like to pass this one, please.");
topic.AddChoice(1, "c001", "I'd like to pass this %one%, please.", {one: "hamburger"});
Description

Adds a choice to dialog.


AddPhrase
Arguments Returns Example
  • string: phrase_localisation_id
  • string: phrase_text
  • object: arguments

void

topic.AddPhrase("p001", "Hello, i'm npc!");
topic.AddPhrase("p001", "Hello, i'm %npc_name%!",
		{npc_name: "Scott"});
Description

Adds an npc phrase to dialog.


AddTopic
Arguments Returns Example
  • string: topic_id

void

topic.AddTopic("topic_id_01");
Description

Adds specified topic to player's available topics.


RefreshTopics
Arguments Returns Example

void

void

topic.RefreshTopics();
Description

List of topics on client is loaded once per conversation. If new topic was added, or the old one removed, this list will be reloaded. But what if state of topic was changed, and current npc shouldn't have it now, but there's such topic in player's list because it was already loaded? RefreshTopics reloads current list of topics, testing all of them with CheckRequiments and actualize topic list. Can come in handly when single topic manages dialogs with multiple characters in sequence.


HasTopic
Arguments Returns Example
  • string: topic_id

bool: returns whether player already has this topic or not

var bHasTopic = topic.HasTopic("topic_id_01");
Description


HasQuest
Arguments Returns Example
  • string: quest_id

bool: returns whether player already has this quest or not

var bHasQuest = topic.HasQuest("quest_id_01");
Description


Bind
Arguments Returns Example
  • string: trigger_name
  • string: function_name
  • object: parametes

void

topic.Bind("someTrigger", "OnSomeTrigger", { npc_id: "errors" });
Description

Binds function to a trigger.


DialogueBreak
Arguments Returns Example

void

void

topic.DialogueBreak();
Description

Immediately breaks current dialogue.


GetCurrentNpcId
Arguments Returns Example

void

string: current npc id (name)

var npc_id = topic.GetCurrentNpcId();
Description


GetCurrentNpcShipId
Arguments Returns Example

void

int: current npc's ship id

var npc_ship_id = topic.GetCurrentNpcShipId();
Description


GetCurrentShipId
Arguments Returns Example

void

int: current player ship's ID

var player_ship_id = topic.GetCurrentShipId();
Description

Has a global alias - PLAYER_SHIP. It's better to use alias - faster.


GetInput
Arguments Returns Example

void

int: player's choice id

var input = topic.GetInput();
Description


GetState
Arguments Returns Example

void

int: topic state

var state = topic.GetState();
Description

Returns current topic state - integer value. Usually state means current progress in questline, but it can be used any way possible.


InputExists
Arguments Returns Example

void

bool: returns whether player choose something or not

var bInputExists = topic.InputExists();
Description


QuestAddLog
Arguments Returns Example
  • string: quest_id
  • string: entry_id
  • string: quest_text
  • (optional) object: args

void

topic.QuestAddLog("some_quest", "e001", "I just got this quest into quest log.");
topic.QuestAddLog("some_quest", "e001", "I just got this %whaat% into quest log.",
	{whaat: "hamburger"});
Description


QuestAddMark
Arguments Returns Example
  • string: quest_id
  • int: system_id

void

topic.QuestAddMark("some_quest", 1);
Description

Adds questmark, that'll be visible on a galaxy map.


QuestClearLog
Arguments Returns Example
  • string: quest_id

void

topic.QuestClearLog("some_quest");
Description

Clears log of specified quest.


QuestSetState
Arguments Returns Example
  • string: quest_id
  • int: state

void

topic.QuestSetState("some_quest", QuestStatus.Finished);
Description

Sets state of quest. State can be QuestStatus.Active (0), QuestStatus.Finished (1), QuestStatus.Failed (2). All this constants are defined in any topic. You can use either them, or just numbers - 0,1,2. Status affects in which tab quest displays.


QuestRemove
Arguments Returns Example
  • string: quest_id

void

topic.QuestRemove("some_quest");
Description

Removes quest completely - after that it won't appear in any tab.


QuestRemoveMarkers
Arguments Returns Example
  • string: quest_id

void

topic.QuestRemoveMarkers("some_quest");
Description

Removes all markers of quest.


QuestRemoveLocalMarkers
Arguments Returns Example
  • string: quest_id

void

topic.QuestRemoveLocalMarkers("some_quest");
Description

Removes all local markers of a quest (object, coordinate). All Galaxy markers persist.


QuestStart
Arguments Returns Example
  • string: quest_id
  • string: quest_title

void

topic.QuestStart("some_quest", "Rats in the cellar");
Description

Stars quest. After that it will appear in journal, and log messages and markers can be added to it.


RemoveTopic
Arguments Returns Example
  • string: topic_id

void

topic.RemoveTopic("topic_id");
Description

Removes topic completely.


SetState
Arguments Returns Example
  • int: state_value

void

topic.SetState(200);
Description

Changes state of current topic.


Unbind
Arguments Returns Example
  • string: trigger_name
  • string: function_name

void

topic.Unbind("someTrigger", "OnSomeTrigger");
Description

Unbinds function from a trigger.