From d2e7e159ddfae0f0fbc98a1ac553a11ba121b2cb Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 16 Jun 2024 18:27:07 +0200 Subject: [PATCH] Attempt 'simple' follow mechanics (where you don't have to hide) --- QuestPathGenerator/QuestSourceGenerator.cs | 3 + .../4232_Children Are Our Future.json | 2 +- .../4361_A Labyrinthine Descent.json | 61 ++++++++++++++++++- .../B-Garlemald/4384_Tracks in the Snow.json | 2 +- .../MSQ/B-Garlemald/4387_A Way Forward.json | 43 ++++++++++++- .../B-Garlemald/4389_Personae non Gratae.json | 10 +++ .../MSQ/B-Garlemald/4397_Sea of Sorrow.json | 4 +- .../4405_Back to Old Tricks.json | 4 +- QuestPaths/quest-v1.json | 17 ++++++ Questionable.Model/V1/QuestStep.cs | 1 + Questionable/GameFunctions.cs | 4 +- 11 files changed, 138 insertions(+), 13 deletions(-) diff --git a/QuestPathGenerator/QuestSourceGenerator.cs b/QuestPathGenerator/QuestSourceGenerator.cs index 9a647cf44..aa68436b1 100644 --- a/QuestPathGenerator/QuestSourceGenerator.cs +++ b/QuestPathGenerator/QuestSourceGenerator.cs @@ -291,6 +291,9 @@ public class QuestSourceGenerator : ISourceGenerator Assignment(nameof(QuestStep.StopDistance), step.StopDistance, emptyStep.StopDistance) .AsSyntaxNodeOrToken(), + Assignment(nameof(QuestStep.NpcWaitDistance), step.NpcWaitDistance, + emptyStep.NpcWaitDistance) + .AsSyntaxNodeOrToken(), Assignment(nameof(QuestStep.TargetTerritoryId), step.TargetTerritoryId, emptyStep.TargetTerritoryId) .AsSyntaxNodeOrToken(), diff --git a/QuestPaths/Endwalker/AetherCurrents/Garlemald/4232_Children Are Our Future.json b/QuestPaths/Endwalker/AetherCurrents/Garlemald/4232_Children Are Our Future.json index 9e895ffcf..e87731786 100644 --- a/QuestPaths/Endwalker/AetherCurrents/Garlemald/4232_Children Are Our Future.json +++ b/QuestPaths/Endwalker/AetherCurrents/Garlemald/4232_Children Are Our Future.json @@ -43,7 +43,7 @@ "Z": -668.9708 }, "TerritoryId": 958, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Azure-haired Boy" }, { diff --git a/QuestPaths/Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4361_A Labyrinthine Descent.json b/QuestPaths/Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4361_A Labyrinthine Descent.json index fd83a9b70..f32f1c1a6 100644 --- a/QuestPaths/Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4361_A Labyrinthine Descent.json +++ b/QuestPaths/Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4361_A Labyrinthine Descent.json @@ -47,8 +47,65 @@ "Z": -27.054321 }, "TerritoryId": 962, - "InteractionType": "WaitForManualProgress", - "Comment": "Follow Alisaie" + "InteractionType": "Interact" + }, + { + "DataId": 1038753, + "Position": { + "X": -202.6663, + "Y": 13.470648, + "Z": -49.497906 + }, + "TerritoryId": 962, + "InteractionType": "WaitForNpcAtPosition", + "NpcWaitDistance": 1, + "Sprint": false + }, + { + "DataId": 1038753, + "Position": { + "X": -138.0897, + "Y": 21.879826, + "Z": -144.57791 + }, + "TerritoryId": 962, + "InteractionType": "WaitForNpcAtPosition", + "NpcWaitDistance": 1, + "Sprint": false + }, + { + "DataId": 1038753, + "Position": { + "X": -89.6808, + "Y": 24.953402, + "Z": -138.54071 + }, + "TerritoryId": 962, + "InteractionType": "WaitForNpcAtPosition", + "NpcWaitDistance": 1, + "Sprint": false + }, + { + "DataId": 1038753, + "Position": { + "X": -16.652283, + "Y": 41.37599, + "Z": -145.70506 + }, + "TerritoryId": 962, + "InteractionType": "WaitForNpcAtPosition", + "NpcWaitDistance": 1, + "Sprint": false + }, + { + "DataId": 1038753, + "Position": { + "X": -77.90129, + "Y": 41.37599, + "Z": -209.40958 + }, + "TerritoryId": 962, + "InteractionType": "Interact" } ] }, diff --git a/QuestPaths/Endwalker/MSQ/B-Garlemald/4384_Tracks in the Snow.json b/QuestPaths/Endwalker/MSQ/B-Garlemald/4384_Tracks in the Snow.json index da5e62cba..ce1c7980c 100644 --- a/QuestPaths/Endwalker/MSQ/B-Garlemald/4384_Tracks in the Snow.json +++ b/QuestPaths/Endwalker/MSQ/B-Garlemald/4384_Tracks in the Snow.json @@ -144,7 +144,7 @@ "Z": 390.46313 }, "TerritoryId": 958, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Girl in Green" } ] diff --git a/QuestPaths/Endwalker/MSQ/B-Garlemald/4387_A Way Forward.json b/QuestPaths/Endwalker/MSQ/B-Garlemald/4387_A Way Forward.json index 6e96c3c55..9d343a9dc 100644 --- a/QuestPaths/Endwalker/MSQ/B-Garlemald/4387_A Way Forward.json +++ b/QuestPaths/Endwalker/MSQ/B-Garlemald/4387_A Way Forward.json @@ -77,7 +77,7 @@ "Z": 365.7129 }, "TerritoryId": 958, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Alphinaud and Alisaie", "DialogueChoices": [ { @@ -92,6 +92,44 @@ { "Sequence": 5, "Steps": [ + { + "DataId": 1039882, + "Position": { + "X": -286.71664, + "Y": 5.6315875, + "Z": 264.1926 + }, + "TerritoryId": 958, + "InteractionType": "WaitForNpcAtPosition", + "NpcWaitDistance": 5, + "Mount": false, + "Sprint": false + }, + { + "DataId": 1039882, + "Position": { + "X": -126.2175, + "Y": 0.18809877, + "Z": 233.39058 + }, + "TerritoryId": 958, + "InteractionType": "WaitForNpcAtPosition", + "NpcWaitDistance": 5, + "Mount": false, + "Sprint": false + }, + { + "DataId": 1039882, + "Position": { + "X": 67.2465, + "Y": 0.33215836, + "Z": 149.8282 + }, + "TerritoryId": 958, + "InteractionType": "WalkTo", + "Mount": false, + "Sprint": false + }, { "DataId": 1039880, "Position": { @@ -101,8 +139,7 @@ }, "StopDistance": 1, "TerritoryId": 958, - "InteractionType": "Interact", - "Comment": "Follow Alphinaud and Alisaie" + "InteractionType": "Interact" } ] }, diff --git a/QuestPaths/Endwalker/MSQ/B-Garlemald/4389_Personae non Gratae.json b/QuestPaths/Endwalker/MSQ/B-Garlemald/4389_Personae non Gratae.json index fb628bc45..fd3cc73e2 100644 --- a/QuestPaths/Endwalker/MSQ/B-Garlemald/4389_Personae non Gratae.json +++ b/QuestPaths/Endwalker/MSQ/B-Garlemald/4389_Personae non Gratae.json @@ -204,6 +204,16 @@ "TerritoryId": 958, "InteractionType": "WalkTo" }, + { + "Position": { + "X": 549.7444, + "Y": -36.61608, + "Z": -225.64955 + }, + "TerritoryId": 958, + "InteractionType": "WalkTo", + "DisableNavmesh": true + }, { "DataId": 1039899, "Position": { diff --git a/QuestPaths/Endwalker/MSQ/B-Garlemald/4397_Sea of Sorrow.json b/QuestPaths/Endwalker/MSQ/B-Garlemald/4397_Sea of Sorrow.json index f6f1d860f..a5c0d5edc 100644 --- a/QuestPaths/Endwalker/MSQ/B-Garlemald/4397_Sea of Sorrow.json +++ b/QuestPaths/Endwalker/MSQ/B-Garlemald/4397_Sea of Sorrow.json @@ -89,7 +89,7 @@ "Z": 419.7605 }, "TerritoryId": 959, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Argos" }, { @@ -148,7 +148,7 @@ "Z": 523.5217 }, "TerritoryId": 959, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Argos" }, { diff --git a/QuestPaths/Endwalker/MSQ/C-MareLamentorum/4405_Back to Old Tricks.json b/QuestPaths/Endwalker/MSQ/C-MareLamentorum/4405_Back to Old Tricks.json index 419959b53..8bd5f0181 100644 --- a/QuestPaths/Endwalker/MSQ/C-MareLamentorum/4405_Back to Old Tricks.json +++ b/QuestPaths/Endwalker/MSQ/C-MareLamentorum/4405_Back to Old Tricks.json @@ -45,7 +45,7 @@ "Z": -269.24548 }, "TerritoryId": 959, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Urianger" } ] @@ -61,7 +61,7 @@ "Z": -269.24548 }, "TerritoryId": 959, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Instruction", "Comment": "Follow Urianger" } ] diff --git a/QuestPaths/quest-v1.json b/QuestPaths/quest-v1.json index ac01f7151..e019e2f75 100644 --- a/QuestPaths/quest-v1.json +++ b/QuestPaths/quest-v1.json @@ -810,6 +810,23 @@ "ContentFinderConditionId" ] } + }, + { + "if": { + "properties": { + "InteractionType": { + "const": "WaitForNpcAtPosition" + } + } + }, + "then": { + "properties": { + "NpcWaitDistance": { + "type": "number", + "exclusiveMinimum": 0 + } + } + } } ] } diff --git a/Questionable.Model/V1/QuestStep.cs b/Questionable.Model/V1/QuestStep.cs index 029060e79..d265df6da 100644 --- a/Questionable.Model/V1/QuestStep.cs +++ b/Questionable.Model/V1/QuestStep.cs @@ -17,6 +17,7 @@ public sealed class QuestStep public Vector3? Position { get; set; } public float? StopDistance { get; set; } + public float? NpcWaitDistance { get; set; } public ushort TerritoryId { get; set; } public ushort? TargetTerritoryId { get; set; } diff --git a/Questionable/GameFunctions.cs b/Questionable/GameFunctions.cs index 4c9238062..c31186976 100644 --- a/Questionable/GameFunctions.cs +++ b/Questionable/GameFunctions.cs @@ -468,10 +468,10 @@ internal sealed unsafe class GameFunctions ExecuteCommand($"{_emoteCommands[emote]} motion"); } - public bool IsObjectAtPosition(uint dataId, Vector3 position) + public bool IsObjectAtPosition(uint dataId, Vector3 position, float distance) { GameObject? gameObject = FindObjectByDataId(dataId); - return gameObject != null && (gameObject.Position - position).Length() < 0.05f; + return gameObject != null && (gameObject.Position - position).Length() < distance; } public bool HasStatusPreventingMount()