Back to the Korax Forum Archives


Forum

SE Quest system

Tue, 22 Dec 2009 22:26:26

Crimson Wizard

I implemented reading quests from QUESTINFO file and some functions to read/modify quest values in map script and conversation script; unfortunately I have no time to properly test this right now, so I just hope it works as expected <!-- s:P --><img src="{SMILIES_PATH}/orc4.gif" alt=":P" title="Razz" /><!-- s:P --> QUESTINFO can be placed in any package, data.pk3 is better, perhaps. Syntax:
quest InternalName Id
{

  title QuestTitle

  texts
  {
     any number of text lines, each is a description for corresponding quest stage
  }

  vars
  {
    any number of quest-specific variables, syntax:
    name numeric_id integer/boolean initial_value
  }

  state initial_state (0 - hidden/nonactive, 1 - active, 2 - complete, 3 - failed)
  position initial_position (like stage)

}
Data can go in any order (i.e. state and position before texts and vars); vars are optional. New map specials to work with quests: 164:SetQuestVar(3), // quest id, var id, value 165:SetQuest(3), // quest id, quest state (active/completed/failed/hide), quest position New conversation commands to work with quests: World.SetQuest(quest script name, quest id, new state, new position(optional) ) World.GetQuestState(quest script name, quest id) World.GetQuestPosition(quest script name, quest id) In these above if script name is used, id should be -1, if id is used, script name should be "". Last 2 ones can be used in epxressions (conditions). This should be sufficient for upcoming release, in the future I'll enhance this.
Tue, 22 Dec 2009 22:43:42

Firebrand

Looks good I'll try to implement something ASAP.

Back to the Korax Forum Archives