Modding

From Pillars of Eternity Wiki
Jump to: navigation, search

Modding[edit | edit source]

Quests[edit | edit source]

Building own quests the easy way: Use the flowchart program form Obsidian, which is not public. The hard way: write your xml by hand.

The Structure of Quests is externalised as xml files. To build valid xml files use the 2 xsd files quest.xsd and conversation.xsd and an xsd validator like this one https://github.com/amouat/xsd-validator


Quests are 2 parted. The Conversation with the Questgiver or an attached Gameobject (Item, NPC, …) and the Quest. The Conversation is saved in .conversation files in […]/game/PillarsOfEternity_Data/data/conversations. To each Conversation is a Stringtable file needed, which contains the texts for the NPC and your reactions. These are saved in […]/game/PillarsOfEternity_Data/data/localised/[language]/text/conversations. These Files are combined by the filename and the <NodeID> tag. Every state of the conversation displays the corresponding text from the stringtable file.

The other part are the Questfile itself. They are saved in .quest files in […]/game/PillarsOfEternity_Data/data/quests. The Text for the questlog is also saved in a stringtable file in […]/game/PillarsOfEternity_Data/data/localised/[language]/text/quests. They are combined by the same filename and also the <NodeID> tag, but its more complex. The questlog distincts between:

Text for Node ID in .stringtable
Quest Title 0
Quest Description 10000
Objective Title NodeID from .quest file
Objective Description NodeID from .quest file + 10000
Addendum AddendumnID from node from .quest file + 20000
End State Text EndStateID + 30000

That's the core. Now some basic questions.

How does the game start a quest?[edit | edit source]

With the script function StartQuest(String) in the OnEnterScripts Tag of a TalkNode.

Example:

    <OnEnterScripts>
       <ScriptCall>
         
           <FullName>Void StartQuest(String)</FullName>
           <Parameters>
             <string>assets/data/quests/companions/companion_qst_durance.quest</string>
           </Parameters>
         
       </ScriptCall>
   </OnEnterScripts>


How to set the Questgiver?[edit | edit source]

Therefor you need the Name of the ingame NPC. Option a: Open game console and enter FindCharacter <name> Obtion b: Use IE Mod, open game console, open object browser with tt, navigate to top and find the name NPC_xxxxx

You need the name for this block in the conversation file. The Guid could be any valid Guid (0-9a-f, grouped 8-4-4-4-12) but it must be the same in all <SpeakerGuid> tags in the conversation file or PoE can not find the character which should say the Content of the Talknode.

 <CharacterMappings>
   <CharacterMapping>
     <Guid>27a22234-d1a7-4bfe-8a95-b773e529928e</Guid>
     <InstanceTag>NPC_Chapel_Priest</InstanceTag>
   </CharacterMapping>
 </CharacterMappings>

How to advance the Quest?[edit | edit source]

Call one of TriggerQuestAddendum, TriggerQuestEndState (to go to the next state), TriggerTalkEvent and maybe others. [Documentation needed]

Example:

     <OnExitScripts>
       <ScriptCall>
         
           <FullName>Void TriggerQuestAddendum(String, Int32)</FullName>
           <Parameters>
             <string>assets/data/quests/07_gilded_vale/07_qst_lords_of_a_barren_land.quest</string>
             <string>0</string>
           </Parameters>
         
       </ScriptCall>
     </OnExitScripts>

How to remember certain things?[edit | edit source]

Call SetGlobalValue(String, Int32) with parameter 'variable name' and 'value'.

    <OnExitScripts>
       <ScriptCall>
         
           <FullName>Void SetGlobalValue(String, Int32)</FullName>
           <Parameters>
             <string>n_Nedmar_State</string>
             <string>3</string>
           </Parameters>
         
       </ScriptCall>
    </OnExitScripts>

What can I do besides display text?[edit | edit source]

You can call all methods in the Scripts class, and check all states with all methods in the Conditionals class. [Documentation needed]

How to let a party member interact with the conversation?[edit | edit source]

With a CharacterMapping entry for the companion he could be referenced in a talk node as speaker. For the companion names and guid see the documentation in the conversation.xsd file.

TODO is it possible to use Hirelings as Speaker?