### Example: Create and Setup Vest Skeletal Mesh Component Source: https://docs.narrativetools.io/pro/inventory/items/equipment/character-appearance Example of creating and setting up the 'VestMesh' component in NarrativeCharacter.cpp. ```cpp VestMesh = CreateDefaultSubobject(TEXT("VestMesh")); VestMesh->SetupAttachment(GetMesh()); VestMesh->SetReceivesDecals(false); VestMesh->SetLeaderPoseComponent(GetMesh()); ``` -------------------------------- ### Example Dialogue with Variables Source: https://docs.narrativetools.io/tales/dialogue/dialogue-nodes/get-string-variables An example demonstrating how to use multiple string variables in a dialogue. ```text Hey there! My name is {name}. Can you find me 5 {item}? ``` -------------------------------- ### Example: Map Vest Slot to Skeletal Mesh Source: https://docs.narrativetools.io/pro/inventory/items/equipment/character-appearance Example of mapping the 'Vest' equipment slot to 'VestMesh' in the EquipmentMap. ```cpp EquipmentMap.Add(FNarrativeGameplayTags::Get().Equipment_Slot_Vest, VestMesh); ``` -------------------------------- ### Example Plugin Build Command for Linux Source: https://docs.narrativetools.io/plugin-upgrades A practical example of building the Narrative Tales plugin for Linux, including navigating to the build directory and specifying plugin, package, and target platform. ```bash ./RunUAT.sh -Plugin="home/NarrativeUser/Documents/Plugins/Narrative/Narrative.uplugin" -Package="home/NarrativeUser/Documents/Plugins/NewCompiledPlugin" -TargetPlatforms="Linux" ``` -------------------------------- ### Example: Define Custom Equipment Slot Tag Source: https://docs.narrativetools.io/pro/inventory/items/equipment/character-appearance Example of adding a 'Vest' equipment slot tag in NarrativeGameplayTags.h. ```cpp FGameplayTag Equipment_Slot_Vest; ``` -------------------------------- ### Start and End Interaction with Input Action Source: https://docs.narrativetools.io/interaction/installation/inputs This blueprint setup shows how to use an Enhanced Input Action to trigger the Begin Interact and End Interact functions of the Narrative Interaction component. Connect the 'Started' exec pin of the input action to 'Begin Interact' and the 'Completed' exec pin to 'End Interact'. ```blueprint INIT INTERACTIONS... Begin Object Class=/Script/BlueprintGraph.K2Node_VariableGet Name="K2Node_VariableGet_0" ExportPath="/Script/BlueprintGraph.K2Node_VariableGet'/Game/FirstPerson/Blueprints/BP_PlayerController.BP_PlayerController:EventGraph.K2Node_VariableGet_0'" VariableReference=(MemberName="NarrativeInteraction",bSelfContext=True) NodePosX=192 NodePosY=400 NodeGuid=00AFA878440F4437899FE5346DFD8078 CustomProperties Pin (PinId=A18FFAC304C9446982B0E4D6A4DBADC7,PinName="NarrativeInteraction",Direction="EGPD_Output",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/NarrativeInteraction.NarrativeInteractionComponent'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_CallFunction_1 50DB9734C4FE4D4DAFF1601E814AB2B2,K2Node_CallFunction_2 D04ED2B54EC14C8789185F3676E2BA2C,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=A61C81ABE8564E738835104D7D99E988,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/Engine.BlueprintGeneratedClass'/Game/FirstPerson/Blueprints/BP_PlayerController.BP_PlayerController_C'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) End Object Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_1" ExportPath="/Script/BlueprintGraph.K2Node_CallFunction'/Game/FirstPerson/Blueprints/BP_PlayerController.BP_PlayerController:EventGraph.K2Node_CallFunction_1'" FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/NarrativeInteraction.NarrativeInteractionComponent'",MemberName="BeginInteract") NodePosX=384 NodePosY=304 NodeGuid=7EAF4D5B21A84F579FDF91E54572A7A7 CustomProperties Pin (PinId=036662A5F89C447490CBC0DEAFEF8F58,PinName="execute",PinToolTip=" Exec",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_EnhancedInputAction_0 97512A6D0BAF4C90A352E46CF863BB78,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=15D6ABDEF84244D18D6C784E56ABB89E,PinName="then",PinToolTip=" Exec",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=50DB9734C4FE4D4DAFF1601E814AB2B2,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target Narrative Interaction Object",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/NarrativeInteraction.NarrativeInteractionComponent'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(A18FFAC304C9446982B0E4D6A4DBADC7,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) End Object Begin Object Class=/Script/BlueprintGraph.K2Node_EnhancedInputAction Name="K2Node_EnhancedInputAction_0" ExportPath="/Script/BlueprintGraph.K2Node_EnhancedInputAction'/Game/FirstPerson/Blueprints/BP_PlayerController.BP_PlayerController:EventGraph.K2Node_EnhancedInputAction_0'" ActionName="IA_Interact" NodePosX=192 NodePosY=304 NodeGuid=97512A6D0BAF4C90A352E46CF863BB78 CustomProperties Pin (PinId=97512A6D0BAF4C90A352E46CF863BB78,PinName="Started",PinToolTip="Started",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(036662A5F89C447490CBC0DEAFEF8F58,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=1234567890ABCDEF1234567890ABCDEF,PinName="Completed",PinToolTip="Completed",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_CallFunction_2 2468ACE013579BDF2468ACE013579BDF,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) End Object Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_2" ExportPath="/Script/BlueprintGraph.K2Node_CallFunction'/Game/FirstPerson/Blueprints/BP_PlayerController.BP_PlayerController:EventGraph.K2Node_CallFunction_2'" FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/NarrativeInteraction.NarrativeInteractionComponent'",MemberName="EndInteract") NodePosX=384 NodePosY=408 NodeGuid=2468ACE013579BDF2468ACE013579BDF CustomProperties Pin (PinId=2468ACE013579BDF2468ACE013579BDF,PinName="execute",PinToolTip=" Exec",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=3691248750FEDCBA3691248750FEDCBA,PinName="then",PinToolTip=" Exec",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=D04ED2B54EC14C8789185F3676E2BA2C,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target Narrative Interaction Object",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/NarrativeInteraction.NarrativeInteractionComponent'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(A18FFAC304C9446982B0E4D6A4DBADC7,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) End Object ``` -------------------------------- ### Example: Register Custom Equipment Slot Tag Source: https://docs.narrativetools.io/pro/inventory/items/equipment/character-appearance Example of registering the 'Vest' equipment slot tag in NarrativeGameplayTags.cpp. ```cpp AddTag(Equipment_Slot_Vest, "Narrative.Equipment.Slot.Mesh.Vest", "Tag for the Vest equipment slot"); ``` -------------------------------- ### Example Dialogue Nodes Source: https://docs.narrativetools.io/pro/dialogue An example of how dialogue nodes are structured when copied and pasted. ```plaintext Reubs: Hey! Welcome to Narrative Dan: Thanks! Player: Who is Dan? Reubs: Everyone knows Dan! You just need to decrypt it... ``` -------------------------------- ### Start Quest Blueprint Node Source: https://docs.narrativetools.io/pro/parties/dialogue-and-quests This configuration shows how to set up the 'BeginQuest' function node in Unreal Engine Blueprints to start a quest. It includes setting the target component, quest class, and optionally a starting quest state ID. ```blueprint Pin (PinId=618EC75D5FA447DBA43FC0A62CAABCB7,PinName="execute",PinToolTip=" Exec",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=BE75A9A11C0D43FDB40E6333A0125671,PinName="then",PinToolTip=" Exec",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=E00527755E9340BDABE72FE0474DDDCA,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target Narrative Component Object Reference",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.NarrativeComponent'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_VariableGet_0 9A1CF2AB01F54FAC8F1EFBA7F99D58FD,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=78F5AD9EDB7C4801A55146DE80BC528E,PinName="QuestClass",PinToolTip="Quest Class Quest Class Reference",PinType.PinCategory="class",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.Quest'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=True,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=332AD42F7F4D4FEDB1CCA3BEBC875531,PinName="StartFromID",PinToolTip="Start from ID Name If this is set to a valid ID in the quest, we'll skip to this quest state instead of playing the quest from the start",PinType.PinCategory="name",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="None",AutogeneratedDefaultValue="None",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=True,bOrphanedPin=False,) CustomProperties Pin (PinId=F1C0F5A00A6743A29A3217FF666FA0EE,PinName="ReturnValue",PinToolTip="Return Value Quest Object Reference The created UQuest " ``` -------------------------------- ### Handle Starting New Player Source: https://docs.narrativetools.io/tales/parties This Blueprint node is part of the game mode's event graph, specifically handling the logic when a new player starts. It calls the parent function to ensure base functionality is executed. ```Blueprint Begin Object Class=/Script/BlueprintGraph.K2Node_CallParentFunction Name="K2Node_CallParentFunction_1" ExportPath="/Script/BlueprintGraph.K2Node_CallParentFunction'/Game/ThirdPerson/Blueprints/BP_ThirdPersonGameMode.BP_ThirdPersonGameMode:EventGraph.K2Node_CallParentFunction_1'" FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/Engine.GameModeBase'",MemberName="HandleStartingNewPlayer") NodePosX=1408 NodePosY=256 NodeGuid=E51C2DE5EFE44BB5A6F937F7FAB185DD CustomProperties Pin (PinId=C6BB06310DF94CA389AE3520E764B40A,PinName="execute",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_CallFunction_2 1873E3715F8E43D4A361E04CB35029A0,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=C50A9372F3634FBF9EB078D53E43BBEE,PinName="then",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_DynamicCast_1 C3F47B494C6E44CEA1A3B588AAED3D37,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=F09E92B83EE542CFA8A7B6B9ED11E9EB,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Engine.GameModeBase'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=True,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) End Object ``` -------------------------------- ### Get Quest Start State Source: https://docs.narrativetools.io/tales/quests/functions Retrieves the initial state of a quest. This is useful for understanding the quest's beginning conditions. ```APIDOC ## Get Quest Start State ### Description Returns the starting state of the quest. ### Method Not specified (assumed to be a function call in an SDK or similar interface) ### Endpoint Not applicable (function call) ### Output #### Return Value - **Return Value** (UQuestState) - The quest’s start state ``` -------------------------------- ### Initialize Dialogue System Source: https://docs.narrativetools.io/tales/changelog/version-3.6.0 Initializes the dialogue system, setting up play parameters and handling potential issues with the start node. ```cpp //UE_LOG(LogNarrative, Warning, TEXT("UDialogue::Initialize could not find Start node with StartFromID: %s. Falling back to root node."), *StartFromID.ToString())); return false; //StartDialogue = RootDialogue; } //Initialize all the data required to begin the dialogue PlayParams = InPlayParams; ... ``` -------------------------------- ### On Added Source: https://docs.narrativetools.io/tales/quests/requirements/functions Called when a requirement is added to a quest. This function is used for initial setup, binding to quest events, starting timers, and initializing state. ```APIDOC ## On Added ### Description Called when this requirement is added to a quest. This event is triggered immediately after the requirement is attached, allowing you to bind to quest-related events, start timers or checks, and initialize state needed to evaluate the requirement. This is the primary setup point for custom quest requirements. ### Inputs #### Path Parameters - **Quest** (UQuest) - Required - The quest this requirement was added to ``` -------------------------------- ### Registering Editor Menus and Debugger Setup Source: https://docs.narrativetools.io/tales/changelog/version-3.7.0 This snippet shows the initialization of the QuestGraphEditor, including registering menus and setting up the debugger with the quest blueprint. ```cpp //BindCommands(); RegisterMenus(); ... // setup debugger Debugger->Setup(QuestBlueprint, SharedThis(this)); if (UToolMenu* EditorToolbar = UToolMenus::Get()->FindMenu("AssetEditor.Quest Editor.Toolbar.QuestEditor")) { // TODO: update this to use ui commands so that it isn't global just like the edit dialogue asset Debugger->RegisterDebuggerToolbar(EditorToolbar); // add dialogue asset button FToolMenuSection& Section = EditorToolbar->AddSection("EditDialogueAsset", FText::GetEmpty(), {"Debugging", EToolMenuInsertType::After}); Section.AddEntry(FToolMenuEntry::InitToolBarButton( FQuestEditorCommands::Get().OpenQuestDialogue, LOCTEXT("QuestGraphEditor_EditDialogue", "Edit Dialogue"), LOCTEXT("QuestGraphEditor_EditDialogue_ToolTip", "When A Dialogue Asset class is selected for this quest, this will switch to that dialogue."), FSlateIcon(FQuestEditorStyle::GetStyleSetName(), "QuestEditor.DialogueIcon")) ); } SetGraphEditable(FQuestDebugger::IsPIENotSimulating()); //Load all Quest Tasks into memory since we need them for editing quests FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked("AssetRegistry"); TArray AssetData; ... ``` -------------------------------- ### Start Quest Blueprint Node Source: https://docs.narrativetools.io/tales/parties/dialogue-and-quests This Blueprint node is used to initiate a quest. It requires a target Narrative Component, the Quest Class to start, and optionally a starting quest state ID. ```blueprint Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_1" ExportPath="/Script/BlueprintGraph.K2Node_CallFunction'/Game/BP_QuestStarter.BP_QuestStarter:EventGraph.K2Node_CallFunction_1'" FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/Narrative.NarrativeComponent'",MemberName="BeginQuest") NodePosX=288 NodePosY=304 AdvancedPinDisplay=Shown NodeGuid=4CA326A895EE405D939278E80D53DBD0 CustomProperties Pin ( PinId=618EC75D5FA447DBA43FC0A62CAABCB7, PinName="execute", PinToolTip=" Exec", PinType.PinCategory="exec", PinType.PinSubCategory="", PinType.PinSubCategoryObject=None, PinType.PinSubCategoryMemberReference=(), PinType.PinValueType=(), PinType.ContainerType=None, PinType.bIsReference=False, PinType.bIsConst=False, PinType.bIsWeakPointer=False, PinType.bIsUObjectWrapper=False, PinType.bSerializeAsSinglePrecisionFloat=False, PersistentGuid=00000000000000000000000000000000, bHidden=False, bNotConnectable=False, bDefaultValueIsReadOnly=False, bDefaultValueIsIgnored=False, bAdvancedView=False, bOrphanedPin=False, ) CustomProperties Pin ( PinId=BE75A9A11C0D43FDB40E6333A0125671, PinName="then", PinToolTip=" Exec", Direction="EGPD_Output", PinType.PinCategory="exec", PinType.PinSubCategory="", PinType.PinSubCategoryObject=None, PinType.PinSubCategoryMemberReference=(), PinType.PinValueType=(), PinType.ContainerType=None, PinType.bIsReference=False, PinType.bIsConst=False, PinType.bIsWeakPointer=False, PinType.bIsUObjectWrapper=False, PinType.bSerializeAsSinglePrecisionFloat=False, PersistentGuid=00000000000000000000000000000000, bHidden=False, bNotConnectable=False, bDefaultValueIsReadOnly=False, bDefaultValueIsIgnored=False, bAdvancedView=False, bOrphanedPin=False, ) CustomProperties Pin ( PinId=E00527755E9340BDABE72FE0474DDDCA, PinName="self", PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"), PinToolTip="Target Narrative Component Object Reference", PinType.PinCategory="object", PinType.PinSubCategory="", PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.NarrativeComponent'", PinType.PinSubCategoryMemberReference=(), PinType.PinValueType=(), PinType.ContainerType=None, PinType.bIsReference=False, PinType.bIsConst=False, PinType.bIsWeakPointer=False, PinType.bIsUObjectWrapper=False, PinType.bSerializeAsSinglePrecisionFloat=False, LinkedTo=(K2Node_VariableGet_0 9A1CF2AB01F54FAC8F1EFBA7F99D58FD,), PersistentGuid=00000000000000000000000000000000, bHidden=False, bNotConnectable=False, bDefaultValueIsReadOnly=False, bDefaultValueIsIgnored=False, bAdvancedView=False, bOrphanedPin=False, ) CustomProperties Pin ( PinId=78F5AD9EDB7C4801A55146DE80BC528E, PinName="QuestClass", PinToolTip="Quest Class Quest Class Reference", PinType.PinCategory="class", PinType.PinSubCategory="", PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.Quest'", PinType.PinSubCategoryMemberReference=(), PinType.PinValueType=(), PinType.ContainerType=None, PinType.bIsReference=False, PinType.bIsConst=False, PinType.bIsWeakPointer=False, PinType.bIsUObjectWrapper=True, PinType.bSerializeAsSinglePrecisionFloat=False, PersistentGuid=00000000000000000000000000000000, bHidden=False, bNotConnectable=False, bDefaultValueIsReadOnly=False, bDefaultValueIsIgnored=False, bAdvancedView=False, bOrphanedPin=False, ) CustomProperties Pin ( PinId=332AD42F7F4D4FEDB1CCA3BEBC875531, PinName="StartFromID", PinToolTip="Start from ID Name If this is set to a valid ID in the quest, we'll skip to this quest state instead of playing the quest from the start", PinType.PinCategory="name", PinType.PinSubCategory="", PinType.PinSubCategoryObject=None, PinType.PinSubCategoryMemberReference=(), PinType.PinValueType=(), PinType.ContainerType=None, PinType.bIsReference=False, PinType.bIsConst=False, PinType.bIsWeakPointer=False, PinType.bIsUObjectWrapper=False, PinType.bSerializeAsSinglePrecisionFloat=False, DefaultValue="None", AutogeneratedDefaultValue="None", PersistentGuid=00000000000000000000000000000000, bHidden=False, bNotConnectable=False, bDefaultValueIsReadOnly=False, bDefaultValueIsIgnored=False, bAdvancedView=True, bOrphanedPin=False, ) CustomProperties Pin ( PinId=F1C0F5A00A6743A29A3217FF666FA0EE, PinName="ReturnValue", PinToolTip="Return Value Quest Object Reference The created UQuest", PinType.PinCategory="object", PinType.PinSubCategory="", PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.Quest'", PinType.PinSubCategoryMemberReference=(), PinType.PinValueType=(), PinType.ContainerType=None, PinType.bIsReference=False, PinType.bIsConst=False, PinType.bIsWeakPointer=False, PinType.bIsUObjectWrapper=False, PinType.bSerializeAsSinglePrecisionFloat=False, PersistentGuid=00000000000000000000000000000000, bHidden=False, bNotConnectable=False, bDefaultValueIsReadOnly=False, bDefaultValueIsIgnored=False, bAdvancedView=False, bOrphanedPin=False, ) End Object ``` -------------------------------- ### Dialogue Initialization with Play Parameters Source: https://docs.narrativetools.io/tales/changelog/version-3.6.0 Initializes a dialogue, handling fallback to the root node if a specified start node is not found. Supports initialization with play parameters. ```cpp // Copyright Narrative Tools 2022. #include "Dialogue.h" #include "Net/UnrealNetwork.h" #include "UObject/ConstructorHelpers.h" #include "NarrativeDialogueSettings.h" #include "NarrativeDialogueSequence.h" #include "NarrativePartyComponent.h" #include "UObject/ConstructorHelpers.h" ... #include "NarrativeDialogueSettings.h" #include "Camera/CameraActor.h" #include "Camera/CameraShakeBase.h" #include "CineCameraActor.h" #include "CineCameraComponent.h" #include "NarrativeDefaultCinecam.h" #include "Sound/SoundBase.h" #include #include #include #include #include "NarrativeDialogueSequence.h" #include "NarrativePartyComponent.h" Priority = 0; PlayerAutoAdjustTransform = FTransform(FRotator(0.f, 180.f, 0.f), FVector(200.f, 0.f, 0.f)); ... bool UDialogue::Initialize(class UNarrativeComponent* InitializingComp, FName StartFromID) bool UDialogue::Initialize(class UNarrativeComponent* InitializingComp, const FDialoguePlayParams InPlayParams) { if (!HasAnyFlags(RF_ClassDefaultObject)) { ... UDialogueNode_NPC* StartDialogue = StartFromID.IsNone() ? RootDialogue : GetNPCReplyByID(StartFromID); if (!StartDialogue && !StartFromID.IsNone()) { UE_LOG(LogNarrative, Warning, TEXT("UDialogue::Initialize could not find Start node with StartFromID: %s. Falling back to root node."), *StartFromID.ToString()); StartDialogue = RootDialogue; UDialogueNode_NPC* StartDialogue = InPlayParams.StartFromID.IsNone() ? RootDialogue : GetNPCReplyByID(InPlayParams.StartFromID); if (!StartDialogue && !InPlayParams.StartFromID.IsNone()) { ``` -------------------------------- ### Get Faction Attitude By Faction Source: https://docs.narrativetools.io/pro/factions/functions Allows you to get the current relationship of two factions. ```APIDOC ## Get Faction Attitude By Faction ### Description Allows you to get the current relationship of two factions. ### Parameters #### Inputs - **Source Faction** (GameplayTag) - Required - The source faction gameplay tag. - **Target Faction** (GameplayTag) - Required - The target faction gameplay tag. ### Output #### Faction Attitude - **Faction Attitude** (ETeamAttitude) - The faction attitude enum. ``` -------------------------------- ### Make Dialogue Instance with Initialization Source: https://docs.narrativetools.io/tales/changelog/version-3.6.0 Creates and initializes a dialogue instance. Supports initialization with either a starting ID or play parameters. ```cpp class UDialogue* UNarrativeComponent::MakeDialogueInstance(TSubclassOf DialogueClass, FName StartFromID /*= NAME_None*/) class UDialogue* UNarrativeComponent::MakeDialogueInstance(TSubclassOf DialogueClass, const FDialoguePlayParams PlayParams) { if (IsValid(DialogueClass)) { ... if (NewDialogue->Initialize(this, StartFromID)) if (NewDialogue->Initialize(this, PlayParams)) { return NewDialogue; } ... ``` -------------------------------- ### Create Movies Folder Source: https://docs.narrativetools.io/pro/installation/movies Create a 'Movies' folder within your project's Content directory. The capitalization of 'Movies' is important. ```text Movies ``` -------------------------------- ### Get Factions Attitude By Faction (multiple) Source: https://docs.narrativetools.io/pro/factions/functions Allows you to get the current relationship of multiple factions at once. ```APIDOC ## Get Factions Attitude By Faction (multiple) ### Description Allows you to get the current relationship of multiple factions at once. ### Parameters #### Inputs - **Source Factions** (GameplayTagContainer) - Required - The source factions gameplay tags container. - **Target Factions** (GameplayTagContainer) - Required - The target factions gameplay tags container. ### Output #### Faction Attitude - **Faction Attitude** (ETeamAttitude) - The faction attitude enum. ``` -------------------------------- ### Example: Declare Vest Skeletal Mesh Component Source: https://docs.narrativetools.io/pro/inventory/items/equipment/character-appearance Example of declaring a USkeletalMeshComponent for the 'Vest' slot in NarrativeCharacter.h. ```cpp UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Narrative|Components|Body Meshes") TObjectPtr VestMesh; ``` -------------------------------- ### NarrativeDialogueSettings.h Includes Source: https://docs.narrativetools.io/tales/changelog/version-3.7.0 Includes necessary headers for the NarrativeDialogueSettings class, including UObject. ```cpp #pragma once ... #include "UObject/NoExportTypes.h" #include "NarrativeDialogueSettings.generated.h" /** ``` -------------------------------- ### Create Dialogue Command List Source: https://docs.narrativetools.io/tales/changelog/version-3.7.0 This snippet shows the initialization of editor events, specifically setting up the selection changed event for the graph editor. ```cpp CreateDialogueCommandList(); SGraphEditor::FGraphEditorEvents InEvents; InEvents.OnSelectionChanged = SGraphEditor::FOnSelectionChanged::CreateSP(this, &FDialogueGraphEditor::OnSelectedNodesChanged); ``` -------------------------------- ### Include DialogueSM Headers and Components Source: https://docs.narrativetools.io/tales/changelog/version-3.7.0 Includes necessary headers for DialogueSM, Dialogue, and various game framework components like animation, audio, and character classes. Also includes timer and gameplay utilities. ```cpp #include "DialogueSM.h" #include "Dialogue.h" ... #include "NarrativePartyComponent.h" #include "Animation/AnimInstance.h" #include "Components/AudioComponent.h" #include "Components/SkeletalMeshComponent.h" #include "GameFramework/Character.h" #include "TimerManager.h" #include "Kismet/GameplayStatics.h" #include "LevelSequencePlayer.h" #include "LevelSequenceActor.h" #include "Sound/SoundWave.h" ... ``` -------------------------------- ### Initialize Quest Asset Registry and Object Library Source: https://docs.narrativetools.io/tales/changelog/version-3.6.0 Initializes the Asset Registry module and creates an Object Library to load quest task blueprints from specified paths. ```cpp #include "QuestSM.h" #include "Quest.h" #include "QuestGraphEditor.h" #include #include "QuestEditorSettings.h" //Todo optimize by caching these FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked("AssetRegistry"); FCategorizedGraphActionListBuilder ActionMainCategory("Now the player needs to..."); //No need to cache this as once library loads the classes once they will be very quick to load next time auto ItemLibrary = UObjectLibrary::CreateLibrary(UNarrativeTask::StaticClass(), true, GIsEditor); TArray Paths; if (const UQuestEditorSettings* Settings = GetDefault()) { Paths = Settings->QuestTaskSearchPaths; } ItemLibrary->LoadBlueprintsFromPaths(Paths); TArray Subclasses; ItemLibrary->GetObjects(Subclasses); if (UQuestBlueprint* const QuestAsset = Cast(ContextMenuBuilder.CurrentGraph->GetOuter())) TArray Subclasses; GetDerivedClasses(UNarrativeTask::StaticClass(), Subclasses); FCategorizedGraphActionListBuilder Title("NEXT THE PLAYER HAS TO:"); ActionMainCategory.Append(Title); ``` -------------------------------- ### Build Plugin on Windows using RunUAT Source: https://docs.narrativetools.io/plugin-upgrades Use the RunUAT.bat script to build a plugin on Windows. Ensure the plugin and output paths are correctly specified, and set the target platform to Win64. ```bash ./RunUAT.bat BuildPlugin -Plugin="YourPluginLocation/YourPlugin.uplugin" -Package="YourOutputLocation" -TargetPlatforms="Win64" ``` -------------------------------- ### Create New Node GUID Source: https://docs.narrativetools.io/tales/changelog/version-3.7.0 Generates a new unique identifier for a node, ensuring it's distinct from any previously assigned GUID. ```cpp // Give new node a different Guid from the old one PasteNode->CreateNewGuid(); ``` -------------------------------- ### Begin Dialogue Source: https://docs.narrativetools.io/pro/parties/dialogue-and-quests Initiates a dialogue sequence. Connect this node to an execution flow and specify the target NarrativeComponent and the Dialogue class to start. ```UnrealScript CustomProperties Pin (PinId=F0E3B822AF1E4163A07D536A894BAFF6,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.NarrativeComponent'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_CallFunction_0 8CB251B0CCF84DEB9D6AB335C608BD09,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) End Object Begin Object Class=/Script/BlueprintGraph.K2Node_CallFunction Name="K2Node_CallFunction_2" ExportPath="/Script/BlueprintGraph.K2Node_CallFunction'/Game/BP_QuestStarter.BP_QuestStarter:EventGraph.K2Node_CallFunction_2'" FunctionReference=(MemberParent="/Script/CoreUObject.Class'/Script/Narrative.NarrativeComponent'",MemberName="BeginDialogue") NodePosX=288 NodePosY=304 AdvancedPinDisplay=Hidden NodeGuid=811A14A60D144CCCBC3E2D3258A16894 CustomProperties Pin (PinId=FA368A5AA88C4C70B61BE022D2E9237C,PinName="execute",PinToolTip=" Exec",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=5822045DD8334A1B8C99D267CDA3F02C,PinName="then",PinToolTip=" Exec",Direction="EGPD_Output",PinType.PinCategory="exec",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=0D460460D8A0427CBD21976C3F6DADD8,PinName="self",PinFriendlyName=NSLOCTEXT("K2Node", "Target", "Target"),PinToolTip="Target Narrative Component Object Reference",PinType.PinCategory="object",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.NarrativeComponent'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,LinkedTo=(K2Node_VariableGet_0 9A1CF2AB01F54FAC8F1EFBA7F99D58FD,),PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=19AD5286AE304F008E41A39BD3A9A1F9,PinName="Dialogue",PinToolTip="Dialogue Dialogue Class Reference The dialogue to begin",PinType.PinCategory="class",PinType.PinSubCategory="",PinType.PinSubCategoryObject="/Script/CoreUObject.Class'/Script/Narrative.Dialogue'",PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=True,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,) CustomProperties Pin (PinId=5BDDC4668D4F4093917E69B6579A8720,PinName="StartFromID",PinToolTip="Start from ID Name The ID of the node you want to jump to." ``` -------------------------------- ### Get Current Weight Source: https://docs.narrativetools.io/inventory/inventory-component/functions Calculates and returns the current total weight of all items in the inventory. Note: To get the item count, use `GetItems().Num()`. ```APIDOC ## Get Current Weight ### Description Get the current weight of the inventory. To get the amount of items in the inventory, just do GetItems().Num(). ### Method Not specified (assumed to be a function call within a game engine/scripting environment) ```