Attempt 'simple' follow mechanics (where you don't have to hide)

This commit is contained in:
Liza 2024-06-16 18:27:07 +02:00
parent b87f54c8e8
commit d2e7e159dd
Signed by: liza
GPG Key ID: 7199F8D727D55F67
11 changed files with 138 additions and 13 deletions

View File

@ -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(),

View File

@ -43,7 +43,7 @@
"Z": -668.9708
},
"TerritoryId": 958,
"InteractionType": "WaitForManualProgress",
"InteractionType": "Instruction",
"Comment": "Follow Azure-haired Boy"
},
{

View File

@ -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"
}
]
},

View File

@ -144,7 +144,7 @@
"Z": 390.46313
},
"TerritoryId": 958,
"InteractionType": "WaitForManualProgress",
"InteractionType": "Instruction",
"Comment": "Follow Girl in Green"
}
]

View File

@ -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"
}
]
},

View File

@ -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": {

View File

@ -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"
},
{

View File

@ -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"
}
]

View File

@ -810,6 +810,23 @@
"ContentFinderConditionId"
]
}
},
{
"if": {
"properties": {
"InteractionType": {
"const": "WaitForNpcAtPosition"
}
}
},
"then": {
"properties": {
"NpcWaitDistance": {
"type": "number",
"exclusiveMinimum": 0
}
}
}
}
]
}

View File

@ -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; }

View File

@ -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()