Modding:Conversations: Difference between revisions

12,301 bytes added ,  03:42, 1 June 2019
add unormals table for ConversationChoice thanks!
No edit summary
(add unormals table for ConversationChoice thanks!)
Line 1: Line 1:
[[Category:Modding]]
[[Category:Modding]]
<h1>THIS DOCUMENTATION IS COMPLETELY IN PROGRESS AND GNARF IS COPY/PASTING OVER IT CONSTANTLY - PLEASE REFRAIN FROM WIKI EDITS UNTIL THIS NOTICE IS REMOVED THANKS!</h1>


Conversations are loaded as templates from <code>Conversations.xml</code> - The base conversations can not be extended or modified through the XML, however there are events that will allow dynamically editing conversations as they happen.
Conversations are loaded as templates from <code>Conversations.xml</code> - The base conversations can not be extended or modified through the XML, however there are events that will allow dynamically editing conversations as they happen.
Line 129: Line 127:
Conversation's have children <code>&lt;node></code> nodes:
Conversation's have children <code>&lt;node></code> nodes:


=== Nodes: &lt;node> - Deserialized: XRL.World.ConversationNode ===
=== XRL.World.ConversationNode - XML Node: &lt;node> ===
{| class="wrapped wikitable tablesorter tablesorter-default stickyTableHeaders" role="grid" resolved="" style="padding: 0px;"
{| class="wrapped wikitable tablesorter tablesorter-default stickyTableHeaders" role="grid" resolved="" style="padding: 0px;"
|-
|-
Line 282: Line 280:
|}
|}


=== XRL.World.ConversationChoice - XML Node: &lt;choice> ===
{| class="wrapped wikitable tablesorter tablesorter-default stickyTableHeaders" role="grid" resolved="" style="padding: 0px;"
|-
! colspan="1" class="confluenceTd"|property
! colspan="1" class="confluenceTd"|details
! colspan="1" class="confluenceTd"|Description
|- role="row"
| colspan="1" class="confluenceTd"|Ordinal
| colspan="1" class="confluenceTd"|int
| colspan="1" class="confluenceTd"|Determines the choice sort order.
|- role="row"
| colspan="1" class="confluenceTd"|Text
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|The line of text rendered for the choice in the UI.
|- role="row"
| colspan="1" class="confluenceTd"|GotoID
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|The conversation node that will be navigated to if this choice is selected. (Reserved: "End" "EndFight")
|- role="row"
| colspan="1" class="confluenceTd"|ParentNode
| colspan="1" class="confluenceTd"|ConversationNode
| colspan="1" class="confluenceTd"|The parent conversation node.
|- role="header"
! colspan="3" class="confluenceTd"|Consts
|- role="row"
| colspan="1" class="confluenceTd"|WATER_RITUAL_ORDINAL
| colspan="1" class="confluenceTd"|980
| colspan="1" class="confluenceTd"|Ordinal for water ritual nodes
|- role="row"
| colspan="1" class="confluenceTd"|TRADE_ORDINAL
| colspan="1" class="confluenceTd"|990
| colspan="1" class="confluenceTd"|Ordinal for trade nodes
|- role="row"
| colspan="1" class="confluenceTd"|END_SORT_ORDINAL
| colspan="1" class="confluenceTd"|999999
| colspan="1" class="confluenceTd"|Ordinal for end nodes
|- role="header"
! colspan="3" class="confluenceTd"|Visit node triggers
|- role="row"
| colspan="1" class="confluenceTd"|Achievement
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|If this choice is selected an achievement with this ID will be awarded.
|- role="row"
| colspan="1" class="confluenceTd"|StartQuest
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|Contains a Quest ID. This quest will start when the node is selected.
|- role="row"
| colspan="1" class="confluenceTd"|RevealMapNoteID
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|Contains a Map Note ID. This map note will be revealed when the node is selected.
|- role="row"
| colspan="1" class="confluenceTd"|CompleteQuestStep
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A comma separated list of <code>QuestID~StepID</code> that will Complete the given quest step when the node is entered (awarding XP, etc)
|- role="row"
| colspan="1" class="confluenceTd"|Execute
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A reference to a static function, in the format <code>MyNamespace.MyClass:MyStaticFunction</code> which will be called when this node is selected.
|- role="row"
| colspan="1" class="confluenceTd"|CallScript
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A reference to a static function, in the format <code>MyNamespace.MyClass.MyStaticFunction</code> which will be called when this node is selected.
|- role="row"
| colspan="1" class="confluenceTd"|IdGift
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|Creates, identifies and gives to the player an object with the specified blueprint.
|- role="row"
| colspan="1" class="confluenceTd"|GiveItem
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A comma separated list of <code>BlueprintID</code> that will give items to the player whenever this node is entered.
|- role="row"
| colspan="1" class="confluenceTd"|GiveOneItem
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A comma separated list of <code>BlueprintID</code>. The player will be given the option to choose one of these items.
|- role="row"
| colspan="1" class="confluenceTd"|TakeItem
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A comma separated list of <code>BlueprintID</code> which can optionall include <code>[destroy],...</code> and/or <code>[byid],...</code>. Will take all instances of an item blueprint (or items with the specified id if <code>[byid]</code> is included.) from the player. Items will be taken into the speakers inventory or destroyed if the <code>[destroy]</code> spec is included.
|- role="row"
| colspan="1" class="confluenceTd"|onAction
| colspan="1" class="confluenceTd"|Func<bool> (delegate)
| colspan="1" class="confluenceTd"|Called when a choice is selected, if false is returned the GotoID won't be followed and the current node will be re-rendered.
|- role="header"
! colspan="3" class="confluenceTd"|Filter / Test properties for Start nodes
|- role="row"
| colspan="1" class="confluenceTd"|IfWearingBlueprint
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A single <code>BlueprintID</code> that the player must have equipped to see this start node.
<code>XRLCore.Core.Game.Player.Body.HasObjectEquipped(IfWearingBlueprint)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfHasBlueprint
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A single <code>BlueprintID</code> that the player must in their Inventory to see this start node.
<code>XRL.Core.XRLCore.Core.Game.Player.Body.GetPart<Parts.Inventory>().FireEvent(Event.New("HasBlueprint", "Blueprint", IfHasBlueprint))</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfHaveQuest
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Quest ID the player must have to get this start node.
<code>XRL.Core.XRLCore.Core.Game.HasQuest(IfHaveQuest)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfNotHaveQuest
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Quest ID the player must *NOT* have to get this start node.
<code>!XRL.Core.XRLCore.Core.Game.HasQuest(IfNotHaveQuest)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfFinishedQuest
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Quest ID the player must have completed get this start node.
<code>XRL.Core.XRLCore.Core.Game.FinishedQuest(IfFinishedQuest)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfNotFinishedQuest
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Quest ID the player must *NOT* have completed get this start node.
<code>!XRL.Core.XRLCore.Core.Game.FinishedQuest(IfNotFinishedQuest)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfFinishedQuestStep
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Quest Step ID the player must have completed get this start node.
<code>XRL.Core.XRLCore.Core.Game.FinishedQuestStep(IfFinishedQuestStep)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfNotFinishedQuestStep
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Quest Step ID the player must *NOT* have completed get this start node.
<code>!XRL.Core.XRLCore.Core.Game.FinishedQuestStep(IfNotFinishedQuestStep)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfHaveObservation
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string Observation ID the player must have to get this start node.
<code>Qud.API.JournalAPI.HasObservation(IfHaveObservation)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfHaveState
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string state flag the game must have to get this start node.
<code>XRL.Core.XRLCore.Core.Game.HasGameState(IfHaveState)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfNotHaveState
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|A string state flag the game must *NOT* have to get this start node.
<code>!XRL.Core.XRLCore.Core.Game.HasGameState(IfNotHaveState)</code>
|- role="row"
| colspan="1" class="confluenceTd"|IfHaveItemWithID
| colspan="1" class="confluenceTd"|string (C# ONLY)
| colspan="1" class="confluenceTd"|A specific item ID that must be in the players inventory.  This is a C# only property because Obejct ID doesn't exist until the object is created from the blueprint, making this option only useful on dynamic conversation nodes.
|- role="row"
| colspan="1" class="confluenceTd"|IfDelegate
| colspan="1" class="confluenceTd"|Func<bool>
| colspan="1" class="confluenceTd"|An arbitrary If delegate.
|- role="row"
| colspan="1" class="confluenceTd"|SpecialRequirement
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|Other special requirements.
* <code>LovedByConsortium</code> : <code>XRLCore.Core.Game.PlayerReputation.get("Consortium") < World.Reputation.lovedRep</code>
* <code>IsMapNoteRevealed:MapNoteID</code> : <code>Qud.API.JournalAPI.IsMapOrVillageNoteRevealed( SpecialRequirement.Split(':')[1] )</code>
* <code>!IsMapNoteRevealed:MapNoteID</code> : NOT of the above
|- role="header"
! colspan="3" class="confluenceTd"|C# Methods
|- role="row"
| colspan="1" class="confluenceTd"|Copy(ConversationNode source)
| colspan="1" class="confluenceTd"|void
| colspan="1" class="confluenceTd"|Copies all the properties and makes a copy of each Choice in the Choices list
|- role="row"
| colspan="1" class="confluenceTd"|TestSpecialRequirement()
| colspan="1" class="confluenceTd"|virtual bool
| colspan="1" class="confluenceTd"|Tests the SpecialRequirement member and returns true or false.
|- role="row"
| colspan="1" class="confluenceTd"|TestHaveItemWithID()
| colspan="1" class="confluenceTd"|virtual bool
| colspan="1" class="confluenceTd"|Tests the IfHaveItemWithID member and returns true or false.
|- role="row"
| colspan="1" class="confluenceTd"|Test()
| colspan="1" class="confluenceTd"|virtual bool
| colspan="1" class="confluenceTd"|Tests the various If* and other requirements properties to see if the node should be chosen for a start node.
|- role="row"
| colspan="1" class="confluenceTd"|Goto(GameObject speaker, bool peekOnly=false)
| colspan="1" class="confluenceTd"|virtual ConversationNode
| colspan="1" class="confluenceTd"|Called on the conversation node when the choice is rendered or selected to gather information about the node that will be navigated to. Returns the node that will be navigated to.  peekOnly is set to true when rendering choices, and to false when actually navigating.
|- role="row"
| colspan="1" class="confluenceTd"|GetDisplayText()
| colspan="1" class="confluenceTd"|virtual string
| colspan="1" class="confluenceTd"|Called when the conversation node is rendered, returns the final line of text that will be displayed.
|- role="row"
| colspan="1" class="confluenceTd"|CheckSpecialRequirements(GameObject Speaker, GameObject Player)
| colspan="1" class="confluenceTd"|virtual bool
| colspan="1" class="confluenceTd"|Called when the node is visited. Perfoms a variety of hard-coded interactions.
|- role="row"
| colspan="1" class="confluenceTd"|Visit(GameObject Speaker, GameObject Player)
| colspan="1" class="confluenceTd"|virtual bool
| colspan="1" class="confluenceTd"|Called when the node is visited. If false is returned, the GotoID will not be respected and the currently selected choice will re-render.
|- role="header"
! colspan="3" class="confluenceTd"|Unused/Unimplemented properties
|- role="row"
| colspan="1" class="confluenceTd"|ID
| colspan="1" class="confluenceTd"|string
| colspan="1" class="confluenceTd"|Currently unused, but can be referenced.
|- role="row"
| colspan="1" class="confluenceTd"|Filter
| colspan="1" class="confluenceTd"|string / deprecated
| colspan="1" class="confluenceTd"|Should not be used. Does nothing!
|- role="row"
| colspan="1" class="confluenceTd"|ClearOwner
| colspan="1" class="confluenceTd"|string / deprecated
| colspan="1" class="confluenceTd"|A seemingly unused string (on node), no code paths in base CoQ reference it
|- role="row"
| colspan="1" class="confluenceTd"|TakeBlueprint
| colspan="1" class="confluenceTd"|string / deprecated
| colspan="1" class="confluenceTd"|A seemingly unused string (on node), no code paths in base CoQ reference it
|- role="row"
| colspan="1" class="confluenceTd"|GetScriptClassName
| colspan="1" class="confluenceTd"|method
| colspan="1" class="confluenceTd"|Returns a unique script ID. Unused.
|}