Modding:Conversations: Difference between revisions

2,561 bytes added ,  01:18, 1 June 2019
methods for ConversationNode added
(piling in the documentation - hit another share point)
(methods for ConversationNode added)
Line 55: Line 55:
| colspan="1" class="confluenceTd"|The node ID used in other "GotoID" properties, etc.  Can contain multiple "Start" nodes, one of which will be selected given the other boolean filter parameters.
| colspan="1" class="confluenceTd"|The node ID used in other "GotoID" properties, etc.  Can contain multiple "Start" nodes, one of which will be selected given the other boolean filter parameters.
|- role="row"
|- role="row"
| colspan="1" class="confluenceTd"|Filter
| colspan="1" class="confluenceTd"|TradeNote
| colspan="1" class="confluenceTd"|string / deprecated
| colspan="1" class="confluenceTd"|boolean
| colspan="1" class="confluenceTd"|A potentailly unused property, it seems to have no code paths calling it
| colspan="1" class="confluenceTd"|<code>TradeNote="show"</code> in XML will set this to true, it tells the conversation engine to display the [Press T or Tab to trade] after the conversation text.
|- role="row"
| colspan="1" class="confluenceTd"|GiveOneItem
| 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"|TakeItem
| 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"
|- role="row"
| colspan="1" class="confluenceTd"|ClearOwner
| colspan="1" class="confluenceTd"|bCloseable
| colspan="1" class="confluenceTd"|string / deprecated
| colspan="1" class="confluenceTd"|boolean
| colspan="1" class="confluenceTd"|A seemingly unused string (on node), no code paths in base CoQ reference it
| colspan="1" class="confluenceTd"|Defaults to true, but <code>Closable="false"</code> in XML will set this to false, telling the conversation to not allow "escape" to get out of it.
|- role="header"
|- role="header"
! colspan="3" class="confluenceTd"|Visit node triggers
! colspan="3" class="confluenceTd"|Visit node triggers
Line 132: Line 124:
| colspan="1" class="confluenceTd"|A string Observation ID the player must have to get this start node.
| colspan="1" class="confluenceTd"|A string Observation ID the player must have to get this start node.
<code>Qud.API.JournalAPI.HasObservation(IfHaveObservation)</code>
<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"|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="row"
| colspan="1" class="confluenceTd"|Choices
| colspan="1" class="confluenceTd"|List<ConversationChoice> (C# only)
| colspan="1" class="confluenceTd"|The `<choice>` nodes below this node from the XML.
|- 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"|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"|Visit(GameObject speaker, GameObject player)
| colspan="1" class="confluenceTd"|virtual void
| colspan="1" class="confluenceTd"|Tells the node that it was visited, is used to handle GiveItem and CompleteQuestStep and tracking "Visited" status.
|- role="header"
! colspan="3" class="confluenceTd"|Unused/Unimplemented properties
|- role="row"
| colspan="1" class="confluenceTd"|Filter
| colspan="1" class="confluenceTd"|string / deprecated
| colspan="1" class="confluenceTd"|A potentailly unused property, it seems to have no code paths calling it
|- role="row"
| colspan="1" class="confluenceTd"|GiveOneItem
| 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"|StartQuest
| 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"|RevealMapNoteId
| 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"|TakeItem
| 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"|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


|}
|}
            if (IfHaveState == null || XRL.Core.XRLCore.Core.Game.HasGameState(IfHaveState))
            if (IfNotHaveState == null || !XRL.Core.XRLCore.Core.Game.HasGameState(IfNotHaveState))
            if (ConversationChoice.TestHaveItemWithID(IfHaveItemWithID))
            NewConversationNode.SpecialRequirement = Reader.GetAttribute("SpecialRequirement");
            NewConversationNode.IfHaveItemWithID = Reader.GetAttribute("IfHaveItemWithID");
            NewConversationNode.IfHaveState = Reader.GetAttribute("IfHaveState");
            NewConversationNode.IfNotHaveState = Reader.GetAttribute("IfNotHaveState");
            NewConversationNode.StartQuest = Reader.GetAttribute("StartQuest");
            NewConversationNode.RevealMapNoteId = Reader.GetAttribute("RevealMapNoteId");
            NewConversationNode.TradeNote = (Reader.GetAttribute("TradeNote") == "show");
            string sClosable = Reader.GetAttribute("Closable");
            if (sClosable != null && sClosable == "false") NewConversationNode.bCloseable = false;