Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Community] [NavMesh Pathfinding] Fix the animator behavior direction count property default value #1053

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 8 additions & 105 deletions extensions/community/NavMeshPathfinding.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "NavMeshPathfinding",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Maps and Navigation/Maps and Navigation_map_find_search.svg",
"shortDescription": "Pathfinding allows to compute an efficient path for objects, avoiding obstacles on the way.",
"version": "0.2.1",
"version": "0.2.2",
"description": [
"In comparison to the built-in pathfinding behavior, this one aims to:",
"- better respect obstacle shapes",
Expand Down Expand Up @@ -6862,103 +6862,6 @@
"name": "NavMeshPathfindingAnimator",
"objectType": "Sprite",
"eventsFunctions": [
{
"fullName": "",
"functionType": "Action",
"name": "onCreated",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NavMeshPathfinding::NavMeshPathfindingAnimator::PropertyDirectionCount"
},
"parameters": [
"Object",
"Behavior",
"=",
"0"
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "TopDownMovementBehavior::DiagonalsAllowed"
},
"parameters": [
"Object",
"NavMeshPathfinding"
]
}
],
"actions": [
{
"type": {
"value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetPropertyDirectionCount"
},
"parameters": [
"Object",
"Behavior",
"=",
"8"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "TopDownMovementBehavior::DiagonalsAllowed"
},
"parameters": [
"Object",
"NavMeshPathfinding"
]
}
],
"actions": [
{
"type": {
"value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetPropertyDirectionCount"
},
"parameters": [
"Object",
"Behavior",
"=",
"4"
]
}
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "Sprite",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator",
"type": "behavior"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
Expand Down Expand Up @@ -7124,7 +7027,7 @@
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.Behavior::DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), Object.Behavior::PropertyAnimationDirection()))",
"abs(Object.Behavior::DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), AnimationDirection))",
">",
"0.5 + 0.03125"
]
Expand Down Expand Up @@ -7472,7 +7375,7 @@
"value": "SetReturnNumber"
},
"parameters": [
"(Object.NavMeshPathfinding::MovementAngle() + Object.Behavior::PropertyAngleOffset()) * Object.Behavior::PropertyDirectionCount() / 360"
"(Object.NavMeshPathfinding::MovementAngle() + AngleOffset) * DirectionCount / 360"
]
}
]
Expand Down Expand Up @@ -7514,7 +7417,7 @@
"value": "SetReturnNumber"
},
"parameters": [
"mod(mod(GetArgumentAsNumber(\"Direction\") - GetArgumentAsNumber(\"OtherDirection\"), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount() / 2, Object.Behavior::PropertyDirectionCount()) - Object.Behavior::PropertyDirectionCount() / 2"
"mod(mod(Direction - OtherDirection, DirectionCount) + DirectionCount / 2, DirectionCount) - DirectionCount / 2"
]
}
]
Expand Down Expand Up @@ -7581,7 +7484,7 @@
"Object",
"Behavior",
"=",
"mod(mod(round(GetArgumentAsNumber(\"Value\")), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount(), Object.Behavior::PropertyDirectionCount())"
"mod(mod(round(Value), DirectionCount) + DirectionCount, DirectionCount)"
]
},
{
Expand All @@ -7601,7 +7504,7 @@
},
"parameters": [
"Object",
"Object. Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())"
"Object.Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())"
]
},
{
Expand Down Expand Up @@ -7673,11 +7576,11 @@
"name": "AnimationName"
},
{
"value": "0",
"value": "8",
"type": "Number",
"unit": "Dimensionless",
"label": "Number of directions",
"description": "Leave to 0 to automatically use 8 when diagonals are allowed and 4 otherwise.",
"description": "",
"group": "Direction",
"extraInformation": [],
"hidden": false,
Expand Down
12 changes: 6 additions & 6 deletions extensions/community/TopDownMovementAnimator.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "TopDownMovementAnimator",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Arrows/a6026156355ae5f03613b03971e4ddb50d0c95b8901e7a21edc57f33f0032e42_Arrows_thin_arrows_all_directions_cross.svg",
"shortDescription": "Change the animation according to the movement direction.",
"version": "0.1.1",
"version": "0.1.2",
"description": "Change the animation according to the movement direction.",
"origin": {
"identifier": "TopDownMovementAnimator",
Expand Down Expand Up @@ -291,7 +291,7 @@
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.Behavior::DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), Object.Behavior::PropertyAnimationDirection()))",
"abs(Object.Behavior::DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), AnimationDirection))",
">",
"0.5 + 0.03125"
]
Expand Down Expand Up @@ -639,7 +639,7 @@
"value": "SetReturnNumber"
},
"parameters": [
"(Object.TopDownMovement::Angle() + Object.Behavior::PropertyAngleOffset()) * Object.Behavior::PropertyDirectionCount() / 360"
"(Object.TopDownMovement::Angle() + AngleOffset) * DirectionCount / 360"
]
}
]
Expand Down Expand Up @@ -681,7 +681,7 @@
"value": "SetReturnNumber"
},
"parameters": [
"mod(mod(GetArgumentAsNumber(\"Direction\") - GetArgumentAsNumber(\"OtherDirection\"), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount() / 2, Object.Behavior::PropertyDirectionCount()) - Object.Behavior::PropertyDirectionCount() / 2"
"mod(mod(Direction - OtherDirection, DirectionCount) + DirectionCount / 2, DirectionCount) - DirectionCount / 2"
]
}
]
Expand Down Expand Up @@ -748,7 +748,7 @@
"Object",
"Behavior",
"=",
"mod(mod(round(GetArgumentAsNumber(\"Value\")), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount(), Object.Behavior::PropertyDirectionCount())"
"mod(mod(round(Value), DirectionCount) + DirectionCount, DirectionCount)"
]
},
{
Expand All @@ -768,7 +768,7 @@
},
"parameters": [
"Object",
"Object. Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())"
"Object.Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())"
]
},
{
Expand Down