VoidExpanse/scope-topics: Difference between revisions

From AtomicTorchWiki
(Created page with "<noinclude> Category:VoidExpanse/api_scopes </noinclude> = Scope topics = Topics scope is used outside topics to control topics, quests and logs. '''Visibility:''' Globa...")
 
No edit summary
Line 124: Line 124:
<pre style="margin:0px;">topics.SetState("dlirry", "someTopic", 200);</pre> |
<pre style="margin:0px;">topics.SetState("dlirry", "someTopic", 200);</pre> |
Sets state of specified topic.
Sets state of specified topic.
}}
{{Scripting_api|RefreshTopics|
void
void|
void|
<pre style="margin:0px;">topics.RefreshTopics();</pre> |
Refreshes the list of topics during a conversation with NPC. Usually you only need to call it if you changed the name of a topic as the list is updated automatically if any topic is added or removed.
}}
}}

Revision as of 09:11, 10 October 2014


Scope topics

Topics scope is used outside topics to control topics, quests and logs.

Visibility: Global.

List of functions

AddTopicToPlayer
Arguments Returns Example
  • string: player_name
  • string: topic_id

void

topics.AddTopicToPlayer("dlirry","SomeTopic");
Description

Adds new topic to player.


PlayerHasTopic
Arguments Returns Example
  • string: player_name
  • string: topic_id

bool: whether player has topic or not

var res = topics.PlayerHasTopic("dlirry","SomeTopic");
Description


PlayerHasQuest
Arguments Returns Example
  • string: player_name
  • string: quest_id

bool: whether player has quest or not

var res = topics.PlayerHasQuest("dlirry", "SomeTopic");
Description


GetState
Arguments Returns Example
  • string: player_name
  • string: topic_id

int: state of topic

var state = topics.GetState("dlirry", "SomeTopic");
Description


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

void

topics.QuestAddLog("dlirry", "SomeQuest", "e001", "Some log added for some quest.");
topics.QuestAddLog("dlirry", "SomeQuest", "e001", "Some log added for some %something% quest.",
{something: "awesome"});
Description

Adds log entry to quest, which will be shown in quest journal.


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

void

topics.QuestAddMark("dlirry", "SomeQuest", 15);
Description

Adds quest mark to galaxy map.


QuestClearLog
Arguments Returns Example
  • string: player_name
  • string: quest_id

void

topics.QuestClearLog("dlirry", "SomeQuest");
Description

Clears all log of specified quest.


QuestSetState
Arguments Returns Example
  • string: player_name
  • string: quest_id
  • int: state - 0 - active, 1- finished, 2 - failed

void

topics.QuestSetState("dlirry", "SomeQuest", 1);
Description

Sets quest state. State affects on in which tab quest will be shown in journal.


QuestRemove
Arguments Returns Example
  • string: player_name
  • string: quest_id

void

topics.QuestRemove("dlirry", "SomeQuest");
Description

Removes completely quest from specified player.


QuestRemoveMarkers
Arguments Returns Example
  • string: player_name
  • string: quest_id

void

topics.QuestRemoveMarkers("dlirry", "SomeQuest");
Description

Removes all markers from specified quest.


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

void

topics.QuestStart("dlirry", "SomeQuest", "Rats in the cellar");
Description

Starts a quest.


RemoveTopic
Arguments Returns Example
  • string: player_name
  • string: topic_id

void

topics.RemoveTopic("dlirry", "someTopic");
Description

Removes a topic from player.


SetState
Arguments Returns Example
  • string: player_name
  • string: topic_id
  • int: state

void

topics.SetState("dlirry", "someTopic", 200);
Description

Sets state of specified topic.


RefreshTopics
Arguments Returns Example

void void

void

topics.RefreshTopics();
Description

Refreshes the list of topics during a conversation with NPC. Usually you only need to call it if you changed the name of a topic as the list is updated automatically if any topic is added or removed.