Writing Conversations & Quests

From ALFA
Jump to: navigation, search

Conversations (aka dialogs) are a set of nodes (lines of text) arranged in a branching tree that consist of questions and responses that a player can select from. Each of the nodes in a conversation tree is subject to conditions evaluated by at least one or more scripts (Text Appears When) and can trigger scripted actions based on player selection (Actions Taken).

Quests

See also: Using Local Variables

The following quest types are supported by the ACR Quest System:

  • Exploration & Scouting quests
  • Errand quests (locate/retrieve/deliver an item)
  • Escort quests (for NPCs only)
  • Bounty quests (kill an NPC or creature)
  • Patrol/Reconnaissance quests (walk waypoints)

Configuration

The following configuration may be set on waypoints or triggers. For a waypoint to work, you must tag the waypoint as ACR_QUEST_WAYPOINT. In this case, you may also define...

  • ACR_QUEST_TRIG_SHAPE (integer) -- Variable corresponding to a line number in vfx_persistent.2da which determines the size/shape/facing/visual effects (if any) of the quest location once spawned.

The following settings can be used to configure quests. These parameters must be defined on triggers at specific locations, in particular to setup scouting, bounty, or patrol quests.

  • ACR_QST_NAME (string) -- Variable for defining the quest name (per the module journal).
  • ACR_QST_LOWER_STATE (integer) -- Variable for defining the activation state of a quest trigger. If this is 0 or undefined, a quest trigger can be activated repeatedly or in any sequence.
  • ACR_QST_REQUIRED_SKILL (integer) -- Variable for defining a skill that needs a skill check in order to activate this quest trigger.
  • ACR_QST_SKILL_DC (integer) -- Variable for the difficulty class of the skill check that needs to be passed in order to activate this quest trigger.
  • ACR_QST_UPPER_STATE (integer) -- Variable for defining the state at which a quest trigger will grant the associated quest XP reward. If this is 0 or undefined, the quest trigger will not grant any quest XP.
  • ACR_QST_SPAWN_CRESREF (string) -- Variable for defining the resref of the creature object to spawn (used OnTriggerEnter).
  • ACR_QST_SPAWN_IRESREF (string) -- Variable for defining the resref of the item object to spawn (used OnTriggerEnter).
  • ACR_QST_SPAWN_WAYPOINT (string) -- Variable for defining the tag of the waypoint (location) at which to spawn an item or creature.
  • ACR_QST_APPEAR_ANIMATION (integer) -- Variable (boolean) for defining whether a spawned object will fade in (1) or appear immediately (0).
  • ACR_QST_SPAWN_DELAY (float) -- Variable for defining a spawn time delay. This is used to introduce a delay between activating a quest trigger and spawning the desired object.
  • ACR_QST_MESSAGE (string) -- Variable for defining a message to send to the player when a quest trigger is activated.

All XP rewards are given upon completion of the quest, which occurs whenever the upper quest state threshold is reached. Quest XP is not given upon returning to the quest giver to avoid exploits by party members, but physical rewards, such as gold, need still be given by the quest givers.

Conversation Scripts

The following generic scripts are available for use in setting up the conditions for any of your conversation nodes:

  • acr_cs_abcheck -- This conversation script performs an ability check at a specific node. It consists of two arguments (parameters): nAbility and nDC. nAbility is an integer, which corresponds to the values defined in nwscript.nss for each ability score (Strength = 0, Dexterity = 1, Constitution = 2, Intelligence = 3, Wisdom = 4, Charisma = 5). nDC is an integer, which corresponds to the Difficulty Class of the ability check, and can range from very easy (0) to nearly impossible (40).
  • acr_cs_atcheck -- This conversation script performs an attribute check at a specific node. It consists of three arguments (parameters): nAbility, nValue, bBaseScore. nAbility is an integer, which corresponds to the values defined in nwscript.nss for each ability score (same as above). nValue is an integer, which corresponds to the attribute score against which the attribute check is made. bBaseScore is a boolean (0 or 1) that is used to restrict checks to the character's base attribute score (ie does not apply ability modifiers from items, spells, or anything else).
  • acr_cs_gpcheck -- This conversation script performs a currency check at a specific node. It consists of two arguments (parameters): nDenomination and nValue. nDenomination is an integer, which corresponds to the type of currency to evaluate based on its multiple (Copper = 1, Silver = 10, Gold = 100, Platinum = 1000). Presently, only gold is available as currency in-game. nValue is an integer, which corresponds to the amount of currency against which the check is made.
  • acr_cs_skcheck -- This conversation script performs a skill check at a specific node. It consists of two arguments (parameters): nSkill and nDC. nSkill is an integer, which corresponds to the values defined in nwscript.nss for each skill?. nDC is an integer, which corresponds to the Difficulty Class of the skill check, and can range from very easy (0) to nearly impossible (40).
  • acr_cs_svcheck -- This conversation script performs a saving throw at a specific node. It consists of two arguments (parameters): nSaveType and nDC. nSaveType is an integer, which corresponds to the values defined in nwscript.nss for each saving throw (Fortitude Save = 1, [[[Reflex]] Save = 2, Will Save = 3). nDC is an integer, which corresponds to the Difficulty Class of the ability check, and can range from very easy (0) to nearly impossible (40).
  • acr_cs_has_item -- This conversation script checks to see if a player possesses a specific item. It accepts two parameters: sTag and sQuest. sTag is a string, which corresponds to the tag of the item. sQuest is also a string, which corresponds to the name of the quest the item is for. sQuest can be null/empty for non-quest related items that you want to check a player's inventory for.

Additional scripts may be defined in the future, as needed. If you have any requests, please submit them to the Technical Team via the forums or PM, or if you are a capable scripter, feel free to submit your work to the Tech Team for inclusion in the ACR.

The following scripts can be used in quest conversations:

  • acr_quest_errand -- This script initiates an item delivery (errand) quest. This should be used in the Actions Taken branch of a conversation. It accepts two parameters: sQuest (PlotID of the quest defined in the journal) and sTemplate (blueprint of the item to deliver).
  • acr_quest_escort -- This script initiates an escort quest. This should be used in the Actions Taken branch of a conversation. It accepts two parameters: sQuest (PlotID of the quest defined in the journal) and an optional sEscortObjectTag (tag of the creature to escort, if other than the quest giver).
  • acr_quest_progress -- This script checks the quest's state for determining progress in conversations. This should be used in the Text Appears When branch of a conversation. It accepts two parameters: sQuest (PlotID of the quest defined in the journal) and nState (integer value of the desired quest state to check).
  • acr_quest_reward -- This script finalizes quests by awarding gold and removing quest items. This should be used in the Actions Taken branch of a conversation. It accepts two parameters: sQuest (PlotID of the quest defined in the journal) and nGold (GP to award to the player in conversation with the quest giver).
  • acr_quest_update -- This script handles quest state updates. This should be used in the Actions Taken branch of a conversation. It accepts five parameters: sQuest (PlotID of the quest defined in the journal), nState (integer value of the state to set the quest to), bAllPartyMembers (boolean used to determine if all party members are assigned the quest), bAllPlayers (boolean used to determine if all players logged in are assigned the quest), bAllowOverrideHigher (boolean used to permit decrements in quest state), and nXP (integer value for any XP to grant to the quest takers).