diff --git a/examples/isometric-game/isometric-game.json b/examples/isometric-game/isometric-game.json index 70d3d1168..e466cc43a 100644 --- a/examples/isometric-game/isometric-game.json +++ b/examples/isometric-game/isometric-game.json @@ -8267,6 +8267,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "NavMeshPathfindingAnimator", + "type": "NavMeshPathfinding::NavMeshPathfindingAnimator", + "NavMeshPathfinding": "NavMeshPathfindingBehavior", + "IsScalingAnimation": true, + "AnimationName": "Walk", + "DirectionCount": 8, + "AngleOffset": 0, + "AnimationDirection": 0 + }, { "name": "NavMeshPathfindingBehavior", "type": "NavMeshPathfinding::NavMeshPathfindingBehavior", @@ -8354,6 +8364,16 @@ "rotateObject": false, "ignoreDefaultControls": false }, + { + "name": "TopDownMovementAnimator", + "type": "TopDownMovementAnimator::TopDownMovementAnimator", + "TopDownMovement": "TopDownMovement", + "IsScalingAnimation": true, + "AnimationName": "Walk", + "DirectionCount": 8, + "AngleOffset": 45, + "AnimationDirection": 0 + }, { "name": "YSort", "type": "YSort::YSort" @@ -8361,7 +8381,7 @@ ], "animations": [ { - "name": "idle", + "name": "Idle", "useMultipleDirections": false, "directions": [ { @@ -11193,7 +11213,7 @@ ] }, { - "name": "Right", + "name": "Walk0", "useMultipleDirections": false, "directions": [ { @@ -12239,7 +12259,7 @@ ] }, { - "name": "Right_Down", + "name": "Walk1", "useMultipleDirections": false, "directions": [ { @@ -13285,7 +13305,7 @@ ] }, { - "name": "Down", + "name": "Walk2", "useMultipleDirections": false, "directions": [ { @@ -14331,7 +14351,7 @@ ] }, { - "name": "Left_Down", + "name": "Walk3", "useMultipleDirections": false, "directions": [ { @@ -15377,7 +15397,7 @@ ] }, { - "name": "Left", + "name": "Walk4", "useMultipleDirections": false, "directions": [ { @@ -16423,7 +16443,7 @@ ] }, { - "name": "Left_Up", + "name": "Walk5", "useMultipleDirections": false, "directions": [ { @@ -17469,7 +17489,7 @@ ] }, { - "name": "Up", + "name": "Walk6", "useMultipleDirections": false, "directions": [ { @@ -18515,7 +18535,7 @@ ] }, { - "name": "Right_Up", + "name": "Walk7", "useMultipleDirections": false, "directions": [ { @@ -27777,6 +27797,8 @@ "Mindy", "NavMeshPathfindingBehavior", "TopDownMovement", + "TopDownMovementAnimator", + "NavMeshPathfindingAnimator", "" ] } @@ -28107,6 +28129,12 @@ } ], "behaviorsSharedData": [ + { + "name": "NavMeshPathfindingAnimator", + "type": "NavMeshPathfinding::NavMeshPathfindingAnimator", + "NewAnimationDirection": 0, + "AnimationFrame": 0 + }, { "name": "NavMeshPathfindingBehavior", "type": "NavMeshPathfinding::NavMeshPathfindingBehavior" @@ -28139,6 +28167,12 @@ "name": "TopDownMovement", "type": "TopDownMovementBehavior::TopDownMovementBehavior" }, + { + "name": "TopDownMovementAnimator", + "type": "TopDownMovementAnimator::TopDownMovementAnimator", + "NewAnimationDirection": 0, + "AnimationFrame": 0 + }, { "name": "YSort", "type": "YSort::YSort" @@ -28150,664 +28184,556 @@ "eventsFunctionsExtensions": [ { "author": "", - "category": "", + "category": "Movement", "extensionNamespace": "", - "fullName": "CharacterMovement", + "fullName": "Top-down movement animator", "helpPath": "", - "iconUrl": "", - "name": "CharacterMovement", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "Originally automatically extracted from events of the project", - "tags": [], - "authorIds": [], + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNNiwyMS4xYy0wLjMsMC0wLjUtMC4xLTAuNy0wLjNsLTQtNC4xYy0wLjQtMC40LTAuNC0xLDAtMS40bDQtNC4xYzAuNC0wLjQsMS0wLjQsMS40LDBzMC40LDEsMCwxLjRMMy40LDE2bDMuMywzLjMNCgkJYzAuNCwwLjQsMC40LDEsMCwxLjRDNi42LDIxLDYuMywyMS4xLDYsMjEuMXoiLz4NCjwvZz4NCjxnPg0KCTxwYXRoIGQ9Ik0yNiwyMS4xYy0wLjMsMC0wLjUtMC4xLTAuNy0wLjNjLTAuNC0wLjQtMC40LTEsMC0xLjRsMy4zLTMuM2wtMy4zLTMuM2MtMC40LTAuNC0wLjQtMSwwLTEuNHMxLTAuNCwxLjQsMGw0LjEsNC4xDQoJCWMwLjIsMC4yLDAuMywwLjQsMC4zLDAuN3MtMC4xLDAuNS0wLjMsMC43bC00LjEsNC4xQzI2LjYsMjEsMjYuMywyMS4xLDI2LDIxLjF6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMTYsMzEuMUwxNiwzMS4xYy0wLjMsMC0wLjUtMC4xLTAuNy0wLjNsLTQtNC4xYy0wLjQtMC40LTAuNC0xLDAtMS40czEtMC40LDEuNCwwbDMuMywzLjNsMy4zLTMuM2MwLjQtMC40LDEtMC40LDEuNCwwDQoJCXMwLjQsMSwwLDEuNGwtNC4xLDQuMUMxNi42LDMwLjksMTYuMywzMS4xLDE2LDMxLjF6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMjAuMSw3Yy0wLjMsMC0wLjUtMC4xLTAuNy0wLjNMMTYsMy40bC0zLjMsMy4zYy0wLjQsMC40LTEsMC40LTEuNCwwcy0wLjQtMSwwLTEuNGw0LTQuMWMwLjQtMC40LDEtMC40LDEuNCwwbDQuMSw0LjENCgkJYzAuNCwwLjQsMC40LDEsMCwxLjRDMjAuNiw2LjksMjAuNCw3LDIwLjEsN3oiLz4NCjwvZz4NCjxnPg0KCTxwYXRoIGQ9Ik0xNiwzMGMtMC42LDAtMS0wLjQtMS0xVjNjMC0wLjYsMC40LTEsMS0xczEsMC40LDEsMXYyNkMxNywyOS42LDE2LjYsMzAsMTYsMzB6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMjksMTdIMmMtMC42LDAtMS0wLjQtMS0xczAuNC0xLDEtMWgyN2MwLjYsMCwxLDAuNCwxLDFTMjkuNiwxNywyOSwxN3oiLz4NCjwvZz4NCjwvc3ZnPg0K", + "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.0", + "description": "Change the animation according to the movement direction.", + "tags": [ + "animation", + "direction" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], "dependencies": [], - "eventsFunctions": [ + "eventsFunctions": [], + "eventsBasedBehaviors": [ { - "description": "Choose the animation according to the object movement.", - "fullName": "Choose animation according to movement", - "functionType": "Action", - "name": "ChooseAnimationDirection", - "sentence": "Choose the animation of _PARAM1_ according to the movement", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "When moving, set the animation according to the direction of the movement (we can automatically compute it. For example, if the angle is 180 degrees (i.e: left), the direction will be 1 + 180/45 = 5). This allow us to make only one action, rather than adding conditions for every direction.\nThis supposes that animation #0 is the Idle animation, and the others animation are in the right order (animation #1 is the right, and then ordered in a clock wise manner).", - "comment2": "" - }, + "description": "Change the animation according to the movement direction.", + "fullName": "Top-down movement animator", + "name": "TopDownMovementAnimator", + "objectType": "Sprite", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ { - "type": { - "value": "TopDownMovementBehavior::IsMoving" - }, - "parameters": [ - "Mindy", - "TopDownMovement" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementAnimator::TopDownMovementAnimator::PropertyDirectionCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetPropertyDirectionCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "8" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetPropertyDirectionCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "4" + ] + } + ] + } ] } ], - "actions": [ - { - "type": { - "value": "ChangeAnimation" - }, - "parameters": [ - "Mindy", - "=", - "1 + mod(round((Mindy.TopDownMovement::Angle())/45+1), 8)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "parameters": [ { - "type": { - "value": "BehaviorActivated" - }, - "parameters": [ - "Mindy", - "NavMeshPathfindingBehavior" - ] + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" }, { - "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::IsMoving" - }, - "parameters": [ - "Mindy", - "NavMeshPathfindingBehavior" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" } ], - "actions": [ - { - "type": { - "value": "ChangeAnimation" - }, - "parameters": [ - "Mindy", - "=", - "1 + mod(round((Mindy.NavMeshPathfindingBehavior::MovementAngle())/45), 8)" - ] - } - ] + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "fullName": "", + "functionType": "Action", + "name": "onActivate", + "sentence": "", + "events": [ { - "type": { - "inverted": true, - "value": "CharacterMovement::IsMoving" - }, - "parameters": [ - "Mindy", - "Mindy", - "NavMeshPathfindingBehavior", - "TopDownMovement", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::Direction()", + "" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "ChangeAnimation" - }, - "parameters": [ - "Mindy", - "=", - "0" - ] + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Mindy", - "supplementaryInformation": "Sprite", - "type": "objectList" - }, - { - "description": "Pathinding", - "name": "NavMeshPathfindingBehavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", - "type": "behavior" + ], + "objectGroups": [] }, { - "description": "Top-down movement", - "name": "TopDownMovement", - "supplementaryInformation": "TopDownMovementBehavior::TopDownMovementBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is moving.", - "fullName": "Is moving", - "functionType": "Condition", - "name": "IsMoving", - "sentence": "_PARAM1_ is moving", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "TopDownMovementBehavior::IsMoving" + "value": "TopDownMovementBehavior::Speed" }, "parameters": [ - "Mindy", - "TopDownMovement" + "Object", + "TopDownMovement", + "=", + "0" ] - }, + } + ], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::And" + "value": "PauseAnimation" }, - "parameters": [], - "subInstructions": [ + "parameters": [ + "Object" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::Speed" + }, + "parameters": [ + "Object", + "TopDownMovement", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayAnimation" + }, + "parameters": [ + "Object" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "BehaviorActivated" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::PropertyIsScalingAnimation" }, "parameters": [ - "Mindy", - "NavMeshPathfindingBehavior" + "Object", + "Behavior" ] - }, + } + ], + "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::IsMoving" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale" }, "parameters": [ - "Mindy", - "NavMeshPathfindingBehavior", + "Object", + "Behavior", "" ] } ] } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetSharedPropertyNewAnimationDirection" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Direction()" + ] + } ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Mindy", - "supplementaryInformation": "Sprite", - "type": "objectList" - }, - { - "description": "Pathinding", - "name": "NavMeshPathfindingBehavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", - "type": "behavior" - }, - { - "description": "Top-down movement", - "name": "TopDownMovement", - "supplementaryInformation": "TopDownMovementBehavior::TopDownMovementBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Camera", - "extensionNamespace": "", - "fullName": "Copy camera settings", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWxheWVycy10cmlwbGUtb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxNi41NEwxOS4zNyAxMC44TDIxIDEyLjA3TDEyIDE5LjA3TDMgMTIuMDdMNC42MiAxMC44MUwxMiAxNi41NE0xMiAxNEwzIDdMMTIgMEwyMSA3TDEyIDE0TTEyIDIuNTNMNi4yNiA3TDEyIDExLjQ3TDE3Ljc0IDdMMTIgMi41M00xMiAyMS40N0wxOS4zNyAxNS43M0wyMSAxN0wxMiAyNEwzIDE3TDQuNjIgMTUuNzRMMTIgMjEuNDciIC8+PC9zdmc+", - "name": "CopyCameraSettings", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/layers-triple-outline.svg", - "shortDescription": "Copy the camera settings of a layer and apply them to another layer.", - "version": "1.0.0", - "description": [ - "Useful when multiple layers need to use the same camera values.", - "", - "How to use:", - "- Run the \"Copy camera settings\" action after all other camera actions have been performed", - "", - "Tips:", - "- Do not use on layers that implement a parallax effect" - ], - "origin": { - "identifier": "CopyCameraSettings", - "name": "gdevelop-extension-store" - }, - "tags": [ - "camera", - "clone", - "zoom", - "position", - "layer", - "angle", - "copy" - ], - "authorIds": [ - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "eventsFunctions": [ - { - "description": "Copy camera settings of a layer and apply them to another layer.", - "fullName": "Copy camera settings", - "functionType": "Action", - "name": "CopyCameraSettings", - "sentence": "Copy camera settings of _PARAM1_ layer and apply them to _PARAM3_ layer (X position: _PARAM5_, Y position: _PARAM6_, Zoom: _PARAM7_, Angle: _PARAM8_)", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "GetArgumentAsBoolean" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "\"CloneX\"" + "comment": "Use a small margin is used to avoid to flicker between 2 directions.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Object.Behavior:: DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), Object.Behavior::PropertyAnimationDirection()))", + ">", + "0.5 + 0.03125" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::SharedPropertyNewAnimationDirection()", + "" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetCameraX" - }, - "parameters": [ - "", - "=", - "CameraX(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "description": "the animation name of the object.", + "fullName": "Animation name", + "functionType": "ExpressionAndCondition", + "name": "AnimationName", + "sentence": "the animation name", + "events": [ { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneY\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.Behavior::PropertyAnimationName()" + ] + } ] } ], - "actions": [ + "expressionType": { + "type": "string" + }, + "parameters": [ { - "type": { - "value": "SetCameraY" - }, - "parameters": [ - "", - "=", - "CameraY(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneZoom\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneAngle\"" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" } ], - "actions": [ - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "=", - "CameraAngle(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Source layer", - "name": "SourceLayer", - "type": "layer" - }, - { - "description": "Source camera", - "name": "SourceCamera", - "type": "expression" - }, - { - "description": "Destination layer", - "name": "DestinationLayer", - "type": "layer" - }, - { - "description": "Destination camera", - "name": "DestinationCamera", - "type": "expression" - }, - { - "defaultValue": "yes", - "description": "Clone X position", - "name": "CloneX", - "optional": true, - "type": "yesorno" - }, - { - "defaultValue": "yes", - "description": "Clone Y position", - "name": "CloneY", - "optional": true, - "type": "yesorno" - }, - { - "defaultValue": "yes", - "description": "Clone zoom", - "name": "CloneZoom", - "optional": true, - "type": "yesorno" + "objectGroups": [] }, - { - "defaultValue": "yes", - "description": "Clone angle", - "name": "CloneAngle", - "optional": true, - "type": "yesorno" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Camera", - "extensionNamespace": "", - "fullName": "Smooth Camera", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjQsMTNoLTZjLTEuMSwwLTItMC45LTItMlY1YzAtMS4xLDAuOS0yLDItMmg2YzEuMSwwLDIsMC45LDIsMnY2QzI2LDEyLjEsMjUuMSwxMywyNCwxM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNiw4djEwYzAsMS4xLTAuOSwyLTIsMkg4Yy0xLjEsMC0yLTAuOS0yLTJWOGMwLTEuMSwwLjktMiwyLTJoOCIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjEiIGN5PSI4IiByPSIyIi8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxMSIgY3k9IjE2IiByPSIxIi8+DQo8cmVjdCB4PSI5IiB5PSI5IiBjbGFzcz0ic3QwIiB3aWR0aD0iNCIgaGVpZ2h0PSIzIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIyMSwyOSAyMSwyOSAxMSwyOSAxMSwyOSAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjE4LDIwIDE4LDI5IDE0LDI5IDE0LDIwICIvPg0KPHJlY3QgeD0iNyIgeT0iMyIgY2xhc3M9InN0MCIgd2lkdGg9IjQiIGhlaWdodD0iMyIvPg0KPC9zdmc+DQo=", - "name": "SmoothCamera", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", - "shortDescription": "Smoothly scroll to follow an object.", - "version": "0.2.2", - "description": [ - "The camera follows an object according to:", - "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", - "- a maximum speed to do linear following ([open the project online](https://editor.gdevelop.io/?project=example://platformer-with-tilemap)) or slow down the camera when teleporting the object", - "- a follow-free zone to avoid scrolling on small movements", - "- an offset to see further in one direction", - "- an extra delay and catch-up speed to give an impression of speed (useful for dash)", - "- position forecasting and delay to simulate a cameraman response time", - "", - "A platformer dedicated behavior allows to switch of settings when the character is in air or on the floor. This can be used to stabilize the camera when jumping." - ], - "origin": { - "identifier": "SmoothCamera", - "name": "gdevelop-extension-store" - }, - "tags": [ - "camera", - "scrolling", - "follow", - "smooth" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "Smoothly scroll to follow an object.", - "fullName": "Smooth Camera", - "name": "SmoothCamera", - "objectType": "", - "eventsFunctions": [ { "fullName": "", - "functionType": "Action", - "name": "onCreated", + "functionType": "ActionWithOperator", + "getterName": "AnimationName", + "name": "SetAnimationName", "sentence": "", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Update private properties through setters to check their values and initialize state.", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyLeftwardSpeed()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetRightwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyRightwardSpeed()", - "log(1 - )" - ] - }, + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::PropertyAnimationName" }, "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeed()", - "log(1 - )" + "!=", + "GetArgumentAsString(\"Value\")" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetPropertyAnimationName" }, "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeed()", - "log(1 - )" + "=", + "GetArgumentAsString(\"Value\")" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeedMax" + "value": "SetAnimationName" }, "parameters": [ "Object", - "Behavior", - "Object.Behavior::PropertyLeftwardSpeedMax()", - "log(1 - )" + "Object. Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the animation is scaled according to speed.", + "fullName": "Scale animation according to speed", + "functionType": "Condition", + "name": "IsScalingAnimation", + "sentence": "_PARAM0_ animation is scaled according to speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetRightwardSpeedMax" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::PropertyIsScalingAnimation" }, "parameters": [ "Object", - "Behavior", - "Object.Behavior::PropertyRightwardSpeedMax()", - "log(1 - )" + "Behavior" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyUpwardSpeedMax()", - "log(1 - )" + "True" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change whether the animation is scaled according to speed or not.", + "fullName": "Scale animation according to speed", + "functionType": "Action", + "name": "SetIsScalingAnimation", + "sentence": "Scale the animation of _PARAM0_ according to speed: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + "inverted": true, + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyDownwardSpeedMax()", - "log(1 - )" + "\"Value\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaLeft" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetPropertyIsScalingAnimation" }, "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaLeft()", - "log(1 - )" + "no" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaRight" + "value": "ChangeAnimationSpeedScale" }, "parameters": [ "Object", - "Behavior", - "Object.Behavior::PropertyFollowFreeAreaRight()", - "log(1 - )" + "=", + "1" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyFollowFreeAreaTop()", - "log(1 - )" + "\"Value\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetPropertyIsScalingAnimation" }, "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaBottom()", - "log(1 - )" + "yes" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale" }, "parameters": [ "Object", "Behavior", - "=", - "Object.Behavior::PropertyCameraDelay()" + "" ] } ] @@ -28817,135 +28743,167 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "IsScalingAnimation", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] }, { - "fullName": "", + "description": "Change the animation speed scale according to the object speed.", + "fullName": "Animation speed scale", "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", + "name": "SetAnimationSpeedScale", + "private": true, + "sentence": "Change the animation speed scale according to _PARAM0_ speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::PropertyIsCalledManually" + "value": "ChangeAnimationSpeedScale" }, "parameters": [ "Object", - "Behavior" + "=", + "Object.TopDownMovement::Speed() / Object.TopDownMovement::MaxSpeed()" ] } - ], + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the object movement direction.", + "fullName": "Direction", + "functionType": "Expression", + "name": "Direction", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "" + "(Object.TopDownMovement::Angle() + Object.Behavior::PropertyAngleOffset()) * Object.Behavior::PropertyDirectionCount() / 360" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", - "fullName": "Move the camera closer", - "functionType": "Action", - "name": "MoveCameraCloser", - "sentence": "Move the camera closer to _PARAM0_", + "description": "Return the difference between 2 directions.", + "fullName": "Direction dirrerence", + "functionType": "Expression", + "name": "DirectionDifference", + "private": true, + "sentence": "", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice.", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIsCalledManually" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "" + "mod(mod(GetArgumentAsNumber(\"Direction\") - GetArgumentAsNumber(\"OtherDirection\"), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount() / 2, Object.Behavior::PropertyDirectionCount()) - Object.Behavior::PropertyDirectionCount() / 2" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "type": "expression" + }, + { + "description": "Other direction", + "name": "OtherDirection", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Move the camera closer to the object.", - "fullName": "Do move the camera closer", + "description": "Change the animation direction of the object.", + "fullName": "Animation direction", "functionType": "Action", - "name": "DoMoveCameraCloser", + "name": "SetAnimationDirection", "private": true, - "sentence": "Do move the camera closer _PARAM0_", + "sentence": "Change the animation direction of _PARAM0_ to _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -28957,7 +28915,7 @@ "textG": 0, "textR": 0 }, - "comment": "Delaying and forecasting can be used at the same time.\nForecasting only use the positions that are older than the one used for delaying.\nThe behavior uses a position history that is split in 2 arrays:\n- one for delaying the position (from TimeFromStart to TimeFromStart - CamearDelay)\n- one for forecasting the position (from TimeFromStart - CamearDelay to TimeFromStart - CamearDelay - ForecastHistoryDuration", + "comment": "Change the animation but keep the current frame number.", "comment2": "" }, { @@ -28966,106 +28924,1150 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::UpdateDelayedPosition" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetPropertyAnimationDirection" }, "parameters": [ "Object", "Behavior", - "" + "=", + "mod(mod(round(GetArgumentAsNumber(\"Value\")), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount(), Object.Behavior::PropertyDirectionCount())" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::UpdateForecastedPosition" + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetSharedPropertyAnimationFrame" }, "parameters": [ "Object", "Behavior", - "" + "=", + "Object.Sprite()" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * speed\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * speed\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * speed^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln(speed))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough.", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowOnX" + "value": "SetAnimationName" }, "parameters": [ "Object", - "Behavior" + "Object. Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())" ] - } - ], - "actions": [ + }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyOldX" + "value": "ChangeSprite" }, "parameters": [ "Object", - "Behavior", "=", - "CameraX(Object.Layer(), 0)" + "Object.Behavior::SharedPropertyAnimationFrame()" ] } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CameraX" - }, - "parameters": [ - "", - ">", - "Object.Behavior::FreeAreaRight()", - "Object.Layer()", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraX" - }, - "parameters": [ - "", - "=", - "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * Object.Behavior::PropertyLogLeftwardSpeed())", - "Object.Layer()", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CameraX" - }, - "parameters": [ - "", + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "hidden": false, + "name": "TopDownMovement" + }, + { + "value": "true", + "type": "Boolean", + "label": "Scale animation according to speed", + "description": "", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "IsScalingAnimation" + }, + { + "value": "Walk", + "type": "String", + "label": "Animation name", + "description": "Animations must be called \"Walk0\", \"Walk1\"... for left, down...", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "AnimationName" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Number of directions", + "description": "Leave to 0 to automatically use 8 when diagonals are allowed and 4 otherwise.", + "group": "Direction", + "extraInformation": [], + "hidden": false, + "name": "DirectionCount" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Angle offset", + "description": "Setted to 90°, \"Walk0\" becomes the animation for down.", + "group": "Direction", + "extraInformation": [], + "hidden": false, + "name": "AngleOffset" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "AnimationDirection" + } + ], + "sharedPropertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "NewAnimationDirection" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "AnimationFrame" + } + ] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "CharacterMovement", + "helpPath": "", + "iconUrl": "", + "name": "CharacterMovement", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "Originally automatically extracted from events of the project", + "tags": [], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Choose the animation according to the object movement.", + "fullName": "Choose animation according to movement", + "functionType": "Action", + "name": "ChooseAnimationDirection", + "sentence": "Choose the animation of _PARAM1_ according to the movement", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::IsMoving" + }, + "parameters": [ + "Mindy", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mindy", + "TopDownAnimator", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::IsMoving" + }, + "parameters": [ + "Mindy", + "TopDownMovement" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mindy", + "TopDownAnimator", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "BehaviorActivated" + }, + "parameters": [ + "Mindy", + "NavMeshPathfindingBehavior" + ] + }, + { + "type": { + "inverted": true, + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::IsMoving" + }, + "parameters": [ + "Mindy", + "NavMeshPathfindingBehavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mindy", + "PathfindingAnimator", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Mindy", + "NavMeshPathfindingBehavior" + ] + }, + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::IsMoving" + }, + "parameters": [ + "Mindy", + "NavMeshPathfindingBehavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mindy", + "PathfindingAnimator", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "CharacterMovement::IsMoving" + }, + "parameters": [ + "Mindy", + "Mindy", + "NavMeshPathfindingBehavior", + "TopDownMovement", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAnimationName" + }, + "parameters": [ + "Mindy", + "\"Idle\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Mindy", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Pathinding", + "name": "NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + }, + { + "description": "Top-down movement", + "name": "TopDownMovement", + "supplementaryInformation": "TopDownMovementBehavior::TopDownMovementBehavior", + "type": "behavior" + }, + { + "description": "Top-down movement animator", + "name": "TopDownAnimator", + "supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator", + "type": "behavior" + }, + { + "description": "Navigation mesh pathfinding animator", + "name": "PathfindingAnimator", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is moving.", + "fullName": "Is moving", + "functionType": "Condition", + "name": "IsMoving", + "sentence": "_PARAM1_ is moving", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "TopDownMovementBehavior::IsMoving" + }, + "parameters": [ + "Mindy", + "TopDownMovement" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Mindy", + "NavMeshPathfindingBehavior" + ] + }, + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::IsMoving" + }, + "parameters": [ + "Mindy", + "NavMeshPathfindingBehavior", + "" + ] + } + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Mindy", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Pathinding", + "name": "NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + }, + { + "description": "Top-down movement", + "name": "TopDownMovement", + "supplementaryInformation": "TopDownMovementBehavior::TopDownMovementBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Copy camera settings", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWxheWVycy10cmlwbGUtb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxNi41NEwxOS4zNyAxMC44TDIxIDEyLjA3TDEyIDE5LjA3TDMgMTIuMDdMNC42MiAxMC44MUwxMiAxNi41NE0xMiAxNEwzIDdMMTIgMEwyMSA3TDEyIDE0TTEyIDIuNTNMNi4yNiA3TDEyIDExLjQ3TDE3Ljc0IDdMMTIgMi41M00xMiAyMS40N0wxOS4zNyAxNS43M0wyMSAxN0wxMiAyNEwzIDE3TDQuNjIgMTUuNzRMMTIgMjEuNDciIC8+PC9zdmc+", + "name": "CopyCameraSettings", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/layers-triple-outline.svg", + "shortDescription": "Copy the camera settings of a layer and apply them to another layer.", + "version": "1.0.0", + "description": [ + "Useful when multiple layers need to use the same camera values.", + "", + "How to use:", + "- Run the \"Copy camera settings\" action after all other camera actions have been performed", + "", + "Tips:", + "- Do not use on layers that implement a parallax effect" + ], + "origin": { + "identifier": "CopyCameraSettings", + "name": "gdevelop-extension-store" + }, + "tags": [ + "camera", + "clone", + "zoom", + "position", + "layer", + "angle", + "copy" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Copy camera settings of a layer and apply them to another layer.", + "fullName": "Copy camera settings", + "functionType": "Action", + "name": "CopyCameraSettings", + "sentence": "Copy camera settings of _PARAM1_ layer and apply them to _PARAM3_ layer (X position: _PARAM5_, Y position: _PARAM6_, Zoom: _PARAM7_, Angle: _PARAM8_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "CameraX(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", + "GetArgumentAsString(\"DestinationLayer\")", + "GetArgumentAsNumber(\"DestinationCamera\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "CameraY(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", + "GetArgumentAsString(\"DestinationLayer\")", + "GetArgumentAsNumber(\"DestinationCamera\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneZoom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", + "GetArgumentAsString(\"DestinationLayer\")", + "GetArgumentAsNumber(\"DestinationCamera\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneAngle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "CameraAngle(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", + "GetArgumentAsString(\"DestinationLayer\")", + "GetArgumentAsNumber(\"DestinationCamera\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Source layer", + "name": "SourceLayer", + "type": "layer" + }, + { + "description": "Source camera", + "name": "SourceCamera", + "type": "expression" + }, + { + "description": "Destination layer", + "name": "DestinationLayer", + "type": "layer" + }, + { + "description": "Destination camera", + "name": "DestinationCamera", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Clone X position", + "name": "CloneX", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Clone Y position", + "name": "CloneY", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Clone zoom", + "name": "CloneZoom", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Clone angle", + "name": "CloneAngle", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Smooth Camera", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjQsMTNoLTZjLTEuMSwwLTItMC45LTItMlY1YzAtMS4xLDAuOS0yLDItMmg2YzEuMSwwLDIsMC45LDIsMnY2QzI2LDEyLjEsMjUuMSwxMywyNCwxM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNiw4djEwYzAsMS4xLTAuOSwyLTIsMkg4Yy0xLjEsMC0yLTAuOS0yLTJWOGMwLTEuMSwwLjktMiwyLTJoOCIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjEiIGN5PSI4IiByPSIyIi8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxMSIgY3k9IjE2IiByPSIxIi8+DQo8cmVjdCB4PSI5IiB5PSI5IiBjbGFzcz0ic3QwIiB3aWR0aD0iNCIgaGVpZ2h0PSIzIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIyMSwyOSAyMSwyOSAxMSwyOSAxMSwyOSAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjE4LDIwIDE4LDI5IDE0LDI5IDE0LDIwICIvPg0KPHJlY3QgeD0iNyIgeT0iMyIgY2xhc3M9InN0MCIgd2lkdGg9IjQiIGhlaWdodD0iMyIvPg0KPC9zdmc+DQo=", + "name": "SmoothCamera", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", + "shortDescription": "Smoothly scroll to follow an object.", + "version": "0.2.2", + "description": [ + "The camera follows an object according to:", + "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", + "- a maximum speed to do linear following ([open the project online](https://editor.gdevelop.io/?project=example://platformer-with-tilemap)) or slow down the camera when teleporting the object", + "- a follow-free zone to avoid scrolling on small movements", + "- an offset to see further in one direction", + "- an extra delay and catch-up speed to give an impression of speed (useful for dash)", + "- position forecasting and delay to simulate a cameraman response time", + "", + "A platformer dedicated behavior allows to switch of settings when the character is in air or on the floor. This can be used to stabilize the camera when jumping." + ], + "origin": { + "identifier": "SmoothCamera", + "name": "gdevelop-extension-store" + }, + "tags": [ + "camera", + "scrolling", + "follow", + "smooth" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Smoothly scroll to follow an object.", + "fullName": "Smooth Camera", + "name": "SmoothCamera", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update private properties through setters to check their values and initialize state.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyLeftwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetRightwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyRightwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyUpwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyDownwardSpeed()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyLeftwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetRightwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyRightwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyUpwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyDownwardSpeedMax()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaLeft" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaLeft()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaRight" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaRight()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaTop()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Behavior::PropertyFollowFreeAreaBottom()", + "log(1 - )" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyCameraDelay()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::PropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", + "fullName": "Move the camera closer", + "functionType": "Action", + "name": "MoveCameraCloser", + "sentence": "Move the camera closer to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object.", + "fullName": "Do move the camera closer", + "functionType": "Action", + "name": "DoMoveCameraCloser", + "private": true, + "sentence": "Do move the camera closer _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Delaying and forecasting can be used at the same time.\nForecasting only use the positions that are older than the one used for delaying.\nThe behavior uses a position history that is split in 2 arrays:\n- one for delaying the position (from TimeFromStart to TimeFromStart - CamearDelay)\n- one for forecasting the position (from TimeFromStart - CamearDelay to TimeFromStart - CamearDelay - ForecastHistoryDuration", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::UpdateDelayedPosition" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::UpdateForecastedPosition" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * speed\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * speed\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * speed^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln(speed))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyOldX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraX(Object.Layer(), 0)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + ">", + "Object.Behavior::FreeAreaRight()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * Object.Behavior::PropertyLogLeftwardSpeed())", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", "<", "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", "Object.Layer()", @@ -33821,16 +34823,26 @@ "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.1.0", + "version": "0.2.0", "description": [ "In comparison to the built-in pathfinding behavior, this one aims to:", "- better respect obstacle shapes", - "- find pathes faster if obstacles don't move", - "" + "- find paths faster if obstacles don't move", + "", + "The isometric example shows how to use this extension to move a character to a destination ([open the project online](https://editor.gdevelop.io/?project=example://isometric-game))." ], + "origin": { + "identifier": "NavMeshPathfinding", + "name": "gdevelop-extension-store" + }, "tags": [ "navmesh", - "pathfinding" + "pathfinding", + "obstacle", + "solid", + "path", + "detour", + "recast" ], "authorIds": [ "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" @@ -38288,69 +39300,571 @@ "useStrict": true, "eventsSheetExpanded": true } - ] - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Move objects to a target in straight lines while avoiding all objects that are flagged as obstacles.", - "fullName": "Navigation mesh pathfinding (experimental)", - "name": "NavMeshPathfindingBehavior", - "objectType": "", - "eventsFunctions": [ + ] + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Move objects to a target in straight lines while avoiding all objects that are flagged as obstacles.", + "fullName": "Navigation mesh pathfinding (experimental)", + "name": "NavMeshPathfindingBehavior", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Initiate and attach properties as objects variables", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::DefineJavaScript" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "behavior.__NavMeshPathfinding = behavior.__NavMeshPathfinding || {};\r", + "behavior.__NavMeshPathfinding.pathfinding = new gdjs.__NavMeshPathfinding.NavMeshPathfindingBehavior(behavior);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__NavMeshPathfinding.pathfinding.doStepPreEvents(runtimeScene);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the object to a position.", + "fullName": "Move to a position", + "functionType": "Action", + "group": "Movement on the path (navigation mesh)", + "name": "SetDestination", + "sentence": "Move _PARAM0_ to _PARAM2_;_PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "const destinationX = eventsFunctionContext.getArgument(\"DestinationX\");", + "const destinationY = eventsFunctionContext.getArgument(\"DestinationY\");", + "", + "behavior.__NavMeshPathfinding.pathfinding.moveTo(runtimeScene, destinationX, destinationY);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + }, + { + "description": "Destination X position", + "name": "DestinationX", + "type": "expression" + }, + { + "description": "Destination Y position", + "name": "DestinationY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is moving on a path.", + "fullName": "Is moving", + "functionType": "Condition", + "group": "Movement on the path (navigation mesh)", + "name": "IsMoving", + "sentence": "_PARAM0_ is moving on a path", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.isMoving();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a path has been found.", + "fullName": "Path found", + "functionType": "Condition", + "group": "Movement on the path (navigation mesh)", + "name": "PathFound", + "sentence": "A path has been found for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFound();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the destination was reached.", + "fullName": "Destination reached", + "functionType": "Condition", + "group": "Movement on the path (navigation mesh)", + "name": "DestinationReached", + "sentence": "_PARAM0_ reached its destination", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.destinationReached();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Get the number of waypoints on the path.", + "fullName": "Waypoint count", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "NodeCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNodeCount();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return a waypoint X position.", + "fullName": "Waypoint X position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "NodeX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "const nodeIndex = eventsFunctionContext.getArgument(\"NodeIndex\");", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNodeX(nodeIndex);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + }, + { + "description": "Node index (start at 0)", + "name": "NodeIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return a waypoint Y position.", + "fullName": "Waypoint Y position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "NodeY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "const nodeIndex = eventsFunctionContext.getArgument(\"NodeIndex\");", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNodeY(nodeIndex);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + }, + { + "description": "Node index (start at 0)", + "name": "NodeIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the index of the next waypoint to reach.", + "fullName": "Index of the next waypoint", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "NextNodeIndex", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNextNodeIndex();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, { - "fullName": "", - "functionType": "Action", - "name": "onCreated", + "description": "Return the next waypoint X position.", + "fullName": "Next waypoint X position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "NextNodeX", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Initiate and attach properties as objects variables", - "comment2": "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::NodeX(Object.Behavior::NextNodeIndex())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the next waypoint Y position.", + "fullName": "Next waypoint Y position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "NextNodeY", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "NavMeshPathfinding::DefineJavaScript" + "value": "SetReturnNumber" }, "parameters": [ - "", - "" + "Object.Behavior::NodeY(Object.Behavior::NextNodeIndex())" ] } ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];\r", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", - "const behavior = object.getBehavior(behaviorName);\r", - "behavior.__NavMeshPathfinding = behavior.__NavMeshPathfinding || {};\r", - "behavior.__NavMeshPathfinding.pathfinding = new gdjs.__NavMeshPathfinding.NavMeshPathfindingBehavior(behavior);\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the previous waypoint X position.", + "fullName": "Previous waypoint X position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "PreviousNodeX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::NodeX(Object.Behavior::NextNodeIndex() - 1)" + ] + } + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38367,26 +39881,31 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", + "description": "Return the previous waypoint Y position.", + "fullName": "Previous waypoint Y position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "PreviousNodeY", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];\r", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", - "const behavior = object.getBehavior(behaviorName);\r", - "\r", - "behavior.__NavMeshPathfinding.pathfinding.doStepPreEvents(runtimeScene);\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::NodeY(Object.Behavior::NextNodeIndex() - 1)" + ] + } + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38403,31 +39922,31 @@ "objectGroups": [] }, { - "description": "Move the object to a position.", - "fullName": "Move to a position", - "functionType": "Action", + "description": "Return the destination X position.", + "fullName": "Destination X position", + "functionType": "Expression", "group": "Movement on the path (navigation mesh)", - "name": "SetDestination", - "sentence": "Move _PARAM0_ to _PARAM2_;_PARAM3_", + "name": "DestinationX", + "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "const destinationX = eventsFunctionContext.getArgument(\"DestinationX\");", - "const destinationY = eventsFunctionContext.getArgument(\"DestinationY\");", - "", - "behavior.__NavMeshPathfinding.pathfinding.moveTo(runtimeScene, destinationX, destinationY);", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::NodeX(Object.Behavior::NodeCount() - 1)" + ] + } + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38439,27 +39958,58 @@ "name": "Behavior", "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", "type": "behavior" - }, + } + ], + "objectGroups": [] + }, + { + "description": "Return the destination Y position.", + "fullName": "Destination Y position", + "functionType": "Expression", + "group": "Movement on the path (navigation mesh)", + "name": "DestinationY", + "sentence": "", + "events": [ { - "description": "Destination X position", - "name": "DestinationX", - "type": "expression" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::NodeY(Object.Behavior::NodeCount() - 1)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "description": "Destination Y position", - "name": "DestinationY", - "type": "expression" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if the object is moving on a path.", - "fullName": "Is moving", - "functionType": "Condition", + "description": "Return the angle of movement of an object on its path.", + "fullName": "Angle of movement on its path", + "functionType": "Expression", "group": "Movement on the path (navigation mesh)", - "name": "IsMoving", - "sentence": "_PARAM0_ is moving on a path", + "name": "MovementAngle", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -38468,7 +40018,10 @@ "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", "const behavior = object.getBehavior(behaviorName);", "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.isMoving();", + "const angle = eventsFunctionContext.getArgument(\"Angle\");", + "const tolerance = eventsFunctionContext.getArgument(\"Tolerance\");", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getMovementAngle(angle, tolerance);", "" ], "parameterObjects": "Object", @@ -38476,6 +40029,9 @@ "eventsSheetExpanded": false } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38492,26 +40048,37 @@ "objectGroups": [] }, { - "description": "Check if a path has been found.", - "fullName": "Path found", + "description": "Compare the angle of movement of an object on its path.", + "fullName": "Angle of movement on its path", "functionType": "Condition", "group": "Movement on the path (navigation mesh)", - "name": "PathFound", - "sentence": "A path has been found for _PARAM0_", + "name": "MovementAngleIsAround", + "sentence": "Angle of movement of _PARAM0_ is _PARAM2_ (tolerance: _PARAM3_ degrees)", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFound();", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "AngleDifference(GetArgumentAsNumber(\"Angle\"), Object.Behavior::MovementAngle())", + "<", + "GetArgumentAsNumber(\"Tolerance\")" + ] + } ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } ], "parameters": [ @@ -38525,17 +40092,27 @@ "name": "Behavior", "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", "type": "behavior" + }, + { + "description": "Angle (in degrees)", + "name": "Angle", + "type": "expression" + }, + { + "description": "Tolerance (in degrees)", + "name": "Tolerance", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Check if the destination was reached.", - "fullName": "Destination reached", - "functionType": "Condition", + "description": "the number of waypoints on the path.", + "fullName": "Speed on the path", + "functionType": "ExpressionAndCondition", "group": "Movement on the path (navigation mesh)", - "name": "DestinationReached", - "sentence": "_PARAM0_ reached its destination", + "name": "Speed", + "sentence": "the speed on the path", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -38544,7 +40121,7 @@ "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", "const behavior = object.getBehavior(behaviorName);", "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.destinationReached();", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getSpeed();", "" ], "parameterObjects": "Object", @@ -38552,6 +40129,9 @@ "eventsSheetExpanded": false } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38568,12 +40148,12 @@ "objectGroups": [] }, { - "description": "Get the number of waypoints on the path.", - "fullName": "Waypoint count", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "NodeCount", - "sentence": "", + "description": "Draw the navigation mesh used for the object.", + "fullName": "Draw navigation mesh", + "functionType": "Action", + "group": "Debug", + "name": "DrawNavMesh", + "sentence": "Draw the navigation mesh used for _PARAM0_ on _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -38582,12 +40162,60 @@ "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", "const behavior = object.getBehavior(behaviorName);", "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNodeCount();", + "const shapePainters = eventsFunctionContext.getObjects(\"ShapePainter\");", + "", + "for (const shapePainter of shapePainters) {", + " behavior.__NavMeshPathfinding.pathfinding.navMeshRenderer.render(runtimeScene, shapePainter);", + "}", "" ], "parameterObjects": "Object", "useStrict": true, - "eventsSheetExpanded": false + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + }, + { + "description": "Shape painter", + "name": "ShapePainter", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "the acceleration of the object.", + "fullName": "Acceleration", + "functionType": "ExpressionAndCondition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "Acceleration", + "sentence": "the acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyAcceleration()" + ] + } + ] } ], "expressionType": { @@ -38609,33 +40237,111 @@ "objectGroups": [] }, { - "description": "Return a waypoint X position.", - "fullName": "Waypoint X position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "NodeX", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Acceleration", + "name": "SetAcceleration", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "const nodeIndex = eventsFunctionContext.getArgument(\"NodeIndex\");", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNodeX(nodeIndex);", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum speed of the object.", + "fullName": "Maximum speed", + "functionType": "ExpressionAndCondition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "MaxSpeed", + "sentence": "the maximum speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyMaxSpeed()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxSpeed", + "name": "SetMaxSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyMaxSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -38647,38 +40353,31 @@ "name": "Behavior", "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", "type": "behavior" - }, - { - "description": "Node index (start at 0)", - "name": "NodeIndex", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Return a waypoint Y position.", - "fullName": "Waypoint Y position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "NodeY", - "sentence": "", + "description": "the rotation speed of the object.", + "fullName": "Rotation speed", + "functionType": "ExpressionAndCondition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "AngularMaxSpeed", + "sentence": "the rotation speed", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "const nodeIndex = eventsFunctionContext.getArgument(\"NodeIndex\");", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNodeY(nodeIndex);", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyAngularMaxSpeed()" + ] + } + ] } ], "expressionType": { @@ -38695,41 +40394,35 @@ "name": "Behavior", "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", "type": "behavior" - }, - { - "description": "Node index (start at 0)", - "name": "NodeIndex", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Return the index of the next waypoint to reach.", - "fullName": "Index of the next waypoint", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "NextNodeIndex", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "AngularMaxSpeed", + "name": "SetAngularMaxSpeed", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getNextNodeIndex();", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyAngularMaxSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -38746,12 +40439,12 @@ "objectGroups": [] }, { - "description": "Return the next waypoint X position.", - "fullName": "Next waypoint X position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "NextNodeX", - "sentence": "", + "description": "the angle offset of the object.", + "fullName": "Angle offset", + "functionType": "ExpressionAndCondition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "AngleOffset", + "sentence": "the angle offset", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -38762,7 +40455,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::NodeX(Object.Behavior::NextNodeIndex())" + "Object.Behavior::PropertyAngleOffset()" ] } ] @@ -38787,11 +40480,10 @@ "objectGroups": [] }, { - "description": "Return the next waypoint Y position.", - "fullName": "Next waypoint Y position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "NextNodeY", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "AngleOffset", + "name": "SetAngleOffset", "sentence": "", "events": [ { @@ -38800,18 +40492,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyAngleOffset" }, "parameters": [ - "Object.Behavior::NodeY(Object.Behavior::NextNodeIndex())" + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -38828,12 +40520,12 @@ "objectGroups": [] }, { - "description": "Return the previous waypoint X position.", - "fullName": "Previous waypoint X position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "PreviousNodeX", - "sentence": "", + "description": "the extra border size of the object.", + "fullName": "Extra border size", + "functionType": "ExpressionAndCondition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "ExtraBorder", + "sentence": "the extra border size", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -38844,7 +40536,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::NodeX(Object.Behavior::NextNodeIndex() - 1)" + "Object.Behavior::PropertyExtraBorder()" ] } ] @@ -38869,11 +40561,10 @@ "objectGroups": [] }, { - "description": "Return the previous waypoint Y position.", - "fullName": "Previous waypoint Y position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "PreviousNodeY", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ExtraBorder", + "name": "SetExtraBorder", "sentence": "", "events": [ { @@ -38882,18 +40573,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyExtraBorder" }, "parameters": [ - "Object.Behavior::NodeY(Object.Behavior::NextNodeIndex() - 1)" + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -38910,12 +40601,12 @@ "objectGroups": [] }, { - "description": "Return the destination X position.", - "fullName": "Destination X position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "DestinationX", - "sentence": "", + "description": "the collision shape of the object.", + "fullName": "Collision shape", + "functionType": "ExpressionAndCondition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "CollisionShape", + "sentence": "the collision shape", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -38923,17 +40614,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::NodeX(Object.Behavior::NodeCount() - 1)" + "Object.Behavior::PropertyCollisionShape()" ] } ] } ], "expressionType": { - "type": "expression" + "supplementaryInformation": "[\"Bounding disk\",\"Dot at center\"]", + "type": "stringWithSelector" }, "parameters": [ { @@ -38951,11 +40643,10 @@ "objectGroups": [] }, { - "description": "Return the destination Y position.", - "fullName": "Destination Y position", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "DestinationY", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "CollisionShape", + "name": "SetCollisionShape", "sentence": "", "events": [ { @@ -38964,18 +40655,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyCollisionShape" }, "parameters": [ - "Object.Behavior::NodeY(Object.Behavior::NodeCount() - 1)" + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Value\")" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -38992,34 +40683,38 @@ "objectGroups": [] }, { - "description": "Return the angle of movement of an object on its path.", - "fullName": "Angle of movement on its path", - "functionType": "Expression", - "group": "Movement on the path (navigation mesh)", - "name": "MovementAngle", - "sentence": "", + "description": "Check if the object should rotate when following its path.", + "fullName": "Rotate object", + "functionType": "Condition", + "group": "Pathfinding configuration (navigation mesh)", + "name": "RotateObject", + "sentence": "_PARAM0_ rotate when following its path", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "const angle = eventsFunctionContext.getArgument(\"Angle\");", - "const tolerance = eventsFunctionContext.getArgument(\"Tolerance\");", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getMovementAngle(angle, tolerance);", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::PropertyRotateObject" + }, + "parameters": [ + "Object", + "Behavior" + ] + } ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -39036,34 +40731,61 @@ "objectGroups": [] }, { - "description": "Compare the angle of movement of an object on its path.", - "fullName": "Angle of movement on its path", - "functionType": "Condition", - "group": "Movement on the path (navigation mesh)", - "name": "MovementAngleIsAround", - "sentence": "Angle of movement of _PARAM0_ is _PARAM2_ (tolerance: _PARAM3_ degrees)", + "description": "Enable or disable the rotation of the object when following its path.", + "fullName": "Rotate object", + "functionType": "Action", + "getterName": "RotateObject", + "group": "Pathfinding configuration (navigation mesh)", + "name": "SetRotateObject", + "sentence": "Enable the rotation of _PARAM0_ on the path: _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "AngleDifference(GetArgumentAsNumber(\"Angle\"), Object.Behavior::MovementAngle())", - "<", - "GetArgumentAsNumber(\"Tolerance\")" + "\"Value\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyRotateObject" }, "parameters": [ - "True" + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyRotateObject" + }, + "parameters": [ + "Object", + "Behavior", + "no" ] } ] @@ -39082,44 +40804,183 @@ "type": "behavior" }, { - "description": "Angle (in degrees)", - "name": "Angle", - "type": "expression" + "description": "Rotate object", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "400", + "type": "Number", + "label": "Acceleration", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "Acceleration" + }, + { + "value": "200", + "type": "Number", + "label": "Maximum speed", + "description": "", + "group": "", + "extraInformation": [], + "hidden": false, + "name": "MaxSpeed" + }, + { + "value": "180", + "type": "Number", + "label": "Rotation speed", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "AngularMaxSpeed" + }, + { + "value": "", + "type": "Boolean", + "label": "Rotate object", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "RotateObject" + }, + { + "value": "0", + "type": "Number", + "label": "Angle offset", + "description": "", + "group": "Rotation", + "extraInformation": [], + "hidden": false, + "name": "AngleOffset" + }, + { + "value": "Bounding disk", + "type": "Choice", + "label": "Collision shape", + "description": "", + "group": "Collision", + "extraInformation": [ + "Bounding disk", + "Dot at center" + ], + "hidden": false, + "name": "CollisionShape" + }, + { + "value": "0", + "type": "Number", + "label": "Extra border size", + "description": "", + "group": "Collision", + "extraInformation": [], + "hidden": false, + "name": "ExtraBorder" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Flag objects as being an obstacle for pathfinding.", + "fullName": "Obstacle for navigation mesh pathfinding (experimental)", + "name": "NavMeshPathfindingObstacleBehavior", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Initiate and attach properties as objects variables", + "comment2": "" }, { - "description": "Tolerance (in degrees)", - "name": "Tolerance", - "type": "expression" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::DefineJavaScript" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "behavior.__NavMeshPathfinding = behavior.__NavMeshPathfinding || {};\r", + "behavior.__NavMeshPathfinding.obstacle =\r", + " new gdjs.__NavMeshPathfinding.NavMeshPathfindingObstacleBehavior(\r", + " runtimeScene, behavior);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the number of waypoints on the path.", - "fullName": "Speed on the path", - "functionType": "ExpressionAndCondition", - "group": "Movement on the path (navigation mesh)", - "name": "Speed", - "sentence": "the speed on the path", + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.pathfinding.pathFollower.getSpeed();", - "" + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__NavMeshPathfinding.obstacle.doStepPreEvents(runtimeScene);" ], "parameterObjects": "Object", "useStrict": true, - "eventsSheetExpanded": false + "eventsSheetExpanded": true } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -39129,33 +40990,26 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Draw the navigation mesh used for the object.", - "fullName": "Draw navigation mesh", + "fullName": "", "functionType": "Action", - "group": "Debug", - "name": "DrawNavMesh", - "sentence": "Draw the navigation mesh used for _PARAM0_ on _PARAM2_", + "name": "onDeActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "const shapePainters = eventsFunctionContext.getObjects(\"ShapePainter\");", - "", - "for (const shapePainter of shapePainters) {", - " behavior.__NavMeshPathfinding.pathfinding.navMeshRenderer.render(runtimeScene, shapePainter);", - "}", - "" + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__NavMeshPathfinding.obstacle.onDeActivate();" ], "parameterObjects": "Object", "useStrict": true, @@ -39171,44 +41025,32 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" - }, - { - "description": "Shape painter", - "name": "ShapePainter", - "supplementaryInformation": "PrimitiveDrawing::Drawer", - "type": "objectList" } ], "objectGroups": [] }, { - "description": "the acceleration of the object.", - "fullName": "Acceleration", - "functionType": "ExpressionAndCondition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "Acceleration", - "sentence": "the acceleration", + "fullName": "", + "functionType": "Action", + "name": "onActivate", + "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyAcceleration()" - ] - } - ] + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__NavMeshPathfinding.obstacle.onActivate();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -39218,7 +41060,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], @@ -39226,27 +41068,22 @@ }, { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Acceleration", - "name": "SetAcceleration", + "functionType": "Action", + "name": "onDestroy", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyAcceleration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", + "const behavior = object.getBehavior(behaviorName);\r", + "\r", + "behavior.__NavMeshPathfinding.obstacle.onDestroy();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true } ], "parameters": [ @@ -39258,19 +41095,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the maximum speed of the object.", - "fullName": "Maximum speed", + "description": "the cell size for obstacle collision mask rasterization. While an object is needed, this will apply to all objects using the behavior.", + "fullName": "Cell size", "functionType": "ExpressionAndCondition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "MaxSpeed", - "sentence": "the maximum speed", + "group": "Navigation mesh configuration", + "name": "CellSize", + "sentence": "the cell size", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -39281,7 +41118,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxSpeed()" + "Object.Behavior::SharedPropertyCellSize()" ] } ] @@ -39299,7 +41136,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], @@ -39308,8 +41145,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "MaxSpeed", - "name": "SetMaxSpeed", + "getterName": "CellSize", + "name": "SetCellSize", "sentence": "", "events": [ { @@ -39318,7 +41155,7 @@ "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyMaxSpeed" + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyCellSize" }, "parameters": [ "Object", @@ -39326,6 +41163,16 @@ "=", "GetArgumentAsNumber(\"Value\")" ] + }, + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] } ] } @@ -39339,19 +41186,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the rotation speed of the object.", - "fullName": "Rotation speed", + "description": "the area left bound. The left bound of the area where objects can go in the scene. While an object is needed, this will apply to all objects using the behavior.", + "fullName": "Area left bound", "functionType": "ExpressionAndCondition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "AngularMaxSpeed", - "sentence": "the rotation speed", + "group": "Navigation mesh configuration", + "name": "AreaLeftBound", + "sentence": "the area left bound", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -39362,7 +41209,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngularMaxSpeed()" + "Object.Behavior::SharedPropertyAreaLeftBound()" ] } ] @@ -39380,7 +41227,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], @@ -39389,8 +41236,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "AngularMaxSpeed", - "name": "SetAngularMaxSpeed", + "getterName": "AreaLeftBound", + "name": "SetAreaLeftBound", "sentence": "", "events": [ { @@ -39399,7 +41246,7 @@ "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyAngularMaxSpeed" + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaLeftBound" }, "parameters": [ "Object", @@ -39407,6 +41254,16 @@ "=", "GetArgumentAsNumber(\"Value\")" ] + }, + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] } ] } @@ -39420,19 +41277,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the angle offset of the object.", - "fullName": "Angle offset", + "description": "the area top bound. The top bound of the area where objects can go in the scene. While an object is needed, this will apply to all objects using the behavior.", + "fullName": "Area top bound", "functionType": "ExpressionAndCondition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "AngleOffset", - "sentence": "the angle offset", + "group": "Navigation mesh configuration", + "name": "AreaTopBound", + "sentence": "the area top bound", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -39443,7 +41300,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleOffset()" + "Object.Behavior::SharedPropertyAreaTopBound()" ] } ] @@ -39461,7 +41318,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], @@ -39470,8 +41327,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "AngleOffset", - "name": "SetAngleOffset", + "getterName": "AreaTopBound", + "name": "SetAreaTopBound", "sentence": "", "events": [ { @@ -39480,7 +41337,7 @@ "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyAngleOffset" + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaTopBound" }, "parameters": [ "Object", @@ -39488,6 +41345,16 @@ "=", "GetArgumentAsNumber(\"Value\")" ] + }, + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] } ] } @@ -39501,19 +41368,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the extra border size of the object.", - "fullName": "Extra border size", + "description": "the area right bound. The right bound of the area where objects can go in the scene (default to the game resolution). While an object is needed, this will apply to all objects using the behavior.", + "fullName": "Area right bound", "functionType": "ExpressionAndCondition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "ExtraBorder", - "sentence": "the extra border size", + "group": "Navigation mesh configuration", + "name": "AreaRightBound", + "sentence": "the area right bound", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -39524,7 +41391,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExtraBorder()" + "Object.Behavior::SharedPropertyAreaRightBound()" ] } ] @@ -39542,7 +41409,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], @@ -39551,8 +41418,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ExtraBorder", - "name": "SetExtraBorder", + "getterName": "AreaRightBound", + "name": "SetAreaRightBound", "sentence": "", "events": [ { @@ -39561,7 +41428,7 @@ "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyExtraBorder" + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaRightBound" }, "parameters": [ "Object", @@ -39569,6 +41436,16 @@ "=", "GetArgumentAsNumber(\"Value\")" ] + }, + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] } ] } @@ -39582,19 +41459,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the collision shape of the object.", - "fullName": "Collision shape", + "description": "the area bottom bound. The bottom bound of the area where objects can go in the scene (default to the game resolution). While an object is needed, this will apply to all objects using the behavior.", + "fullName": "Area bottom bound", "functionType": "ExpressionAndCondition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "CollisionShape", - "sentence": "the collision shape", + "group": "Navigation mesh configuration", + "name": "AreaBottomBound", + "sentence": "the area bottom bound", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -39602,18 +41479,17 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCollisionShape()" + "Object.Behavior::SharedPropertyAreaBottomBound()" ] } ] } ], "expressionType": { - "supplementaryInformation": "[\"Bounding disk\",\"Dot at center\"]", - "type": "stringWithSelector" + "type": "expression" }, "parameters": [ { @@ -39624,7 +41500,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], @@ -39633,8 +41509,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "CollisionShape", - "name": "SetCollisionShape", + "getterName": "AreaBottomBound", + "name": "SetAreaBottomBound", "sentence": "", "events": [ { @@ -39643,61 +41519,23 @@ "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyCollisionShape" + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaBottomBound" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "GetArgumentAsNumber(\"Value\")" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object should rotate when following its path.", - "fullName": "Rotate object", - "functionType": "Condition", - "group": "Pathfinding configuration (navigation mesh)", - "name": "RotateObject", - "sentence": "_PARAM0_ rotate when following its path", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::PropertyRotateObject" + "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" }, "parameters": [ "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "Behavior", + "" ] } ] @@ -39712,71 +41550,33 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Enable or disable the rotation of the object when following its path.", - "fullName": "Rotate object", + "description": "Invalidate navigation mesh.", + "fullName": "Invalidate navigation mesh", "functionType": "Action", - "getterName": "RotateObject", - "group": "Pathfinding configuration (navigation mesh)", - "name": "SetRotateObject", - "sentence": "Enable the rotation of _PARAM0_ on the path: _PARAM2_", + "name": "InvalidateNavMesh", + "private": true, + "sentence": "Invalidate navigation mesh", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"Value\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyRotateObject" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"Value\"" - ] - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.obstacle._manager.invalidateNavMesh();", + "" ], - "actions": [ - { - "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::SetPropertyRotateObject" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - } - ] + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false } ], "parameters": [ @@ -39788,209 +41588,199 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", "type": "behavior" - }, - { - "description": "Rotate object", - "name": "Value", - "type": "yesorno" } ], "objectGroups": [] } ], - "propertyDescriptors": [ + "propertyDescriptors": [], + "sharedPropertyDescriptors": [ { - "value": "400", - "type": "Number", - "label": "Acceleration", + "value": "Top-Down", + "type": "Choice", + "label": "Viewpoint", "description": "", "group": "", - "extraInformation": [], + "extraInformation": [ + "Top-Down", + "Isometry 2:1 (26.565°)", + "True Isometry (30°)" + ], "hidden": false, - "name": "Acceleration" + "name": "Viewpoint" }, { - "value": "200", + "value": "10", "type": "Number", - "label": "Maximum speed", - "description": "", + "label": "Cell size", + "description": "Cell size for obstacle collision mask rasterization.", "group": "", "extraInformation": [], "hidden": false, - "name": "MaxSpeed" + "name": "CellSize" }, { - "value": "180", + "value": "0", "type": "Number", - "label": "Rotation speed", - "description": "", - "group": "Rotation", + "label": "Area left bound", + "description": "The left bound of the area where objects can go in the scene.", + "group": "", "extraInformation": [], "hidden": false, - "name": "AngularMaxSpeed" + "name": "AreaLeftBound" }, { - "value": "", - "type": "Boolean", - "label": "Rotate object", - "description": "", - "group": "Rotation", + "value": "0", + "type": "Number", + "label": "Area top bound", + "description": "The top bound of the area where objects can go in the scene.", + "group": "", "extraInformation": [], "hidden": false, - "name": "RotateObject" + "name": "AreaTopBound" }, { "value": "0", "type": "Number", - "label": "Angle offset", - "description": "", - "group": "Rotation", + "label": "Area right bound", + "description": "The right bound of the area where objects can go in the scene (default to the game resolution).", + "group": "", "extraInformation": [], "hidden": false, - "name": "AngleOffset" + "name": "AreaRightBound" }, { - "value": "Bounding disk", - "type": "Choice", - "label": "Collision shape", - "description": "", - "group": "Collision", - "extraInformation": [ - "Bounding disk", - "Dot at center" - ], + "value": "0", + "type": "Number", + "label": "Area bottom bound", + "description": "The bottom bound of the area where objects can go in the scene (default to the game resolution).", + "group": "", + "extraInformation": [], "hidden": false, - "name": "CollisionShape" + "name": "AreaBottomBound" }, { - "value": "0", + "value": "", "type": "Number", - "label": "Extra border size", + "label": "", "description": "", - "group": "Collision", + "group": "", "extraInformation": [], - "hidden": false, - "name": "ExtraBorder" + "hidden": true, + "name": "IsometricRatio" } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Flag objects as being an obstacle for pathfinding.", - "fullName": "Obstacle for navigation mesh pathfinding (experimental)", - "name": "NavMeshPathfindingObstacleBehavior", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Initiate and attach properties as objects variables", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "NavMeshPathfinding::DefineJavaScript" - }, - "parameters": [ - "", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];\r", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", - "const behavior = object.getBehavior(behaviorName);\r", - "behavior.__NavMeshPathfinding = behavior.__NavMeshPathfinding || {};\r", - "behavior.__NavMeshPathfinding.obstacle =\r", - " new gdjs.__NavMeshPathfinding.NavMeshPathfindingObstacleBehavior(\r", - " runtimeScene, behavior);\r", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - }, + ] + }, + { + "description": "Change the animation according to the movement direction.", + "fullName": "Navigation mesh pathfinding animator", + "name": "NavMeshPathfindingAnimator", + "objectType": "Sprite", + "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "doStepPreEvents", + "name": "onCreated", "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];\r", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", - "const behavior = object.getBehavior(behaviorName);\r", - "\r", - "behavior.__NavMeshPathfinding.obstacle.doStepPreEvents(runtimeScene);" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::PropertyDirectionCount" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": true + "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::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the cell size for obstacle collision mask rasterization. While an object is needed, this will apply to all objects using the behavior.", - "fullName": "Cell size", - "functionType": "ExpressionAndCondition", - "group": "Navigation mesh configuration", - "name": "CellSize", - "sentence": "the cell size", + "fullName": "", + "functionType": "Action", + "name": "onActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -39998,28 +41788,29 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetAnimationDirection" }, "parameters": [ - "Object.Behavior::SharedPropertyCellSize()" + "Object", + "Behavior", + "Object.Behavior::Direction()", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], @@ -40027,33 +41818,146 @@ }, { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "CellSize", - "name": "SetCellSize", + "functionType": "Action", + "name": "doStepPostEvents", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::Speed" + }, + "parameters": [ + "Object", + "NavMeshPathfinding", + "=", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PauseAnimation" + }, + "parameters": [ + "Object" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingBehavior::Speed" + }, + "parameters": [ + "Object", + "NavMeshPathfinding", + ">", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlayAnimation" + }, + "parameters": [ + "Object" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::PropertyIsScalingAnimation" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetAnimationSpeedScale" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyCellSize" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetSharedPropertyNewAnimationDirection" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Object.Behavior::Direction()" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Use a small margin is used to avoid to flicker between 2 directions.", + "comment2": "" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + "inverted": true, + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Object.Behavior:: DirectionDifference(Object.Behavior::SharedPropertyNewAnimationDirection(), Object.Behavior::PropertyAnimationDirection()))", + ">", + "0.5 + 0.03125" + ] + } + ], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetAnimationDirection" }, "parameters": [ "Object", "Behavior", + "Object.Behavior::SharedPropertyNewAnimationDirection()", "" ] } @@ -40064,24 +41968,24 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the area left bound. The left bound of the area where objects can go in the scene. While an object is needed, this will apply to all objects using the behavior.", - "fullName": "Area left bound", + "description": "the animation name of the object.", + "fullName": "Animation name", "functionType": "ExpressionAndCondition", - "group": "Navigation mesh configuration", - "name": "AreaLeftBound", - "sentence": "the area left bound", + "name": "AnimationName", + "sentence": "the animation name", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -40089,28 +41993,29 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::SharedPropertyAreaLeftBound()" + "Object.Behavior::PropertyAnimationName()" ] } ] } ], "expressionType": { - "type": "expression" + "type": "string" }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], @@ -40119,33 +42024,44 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "AreaLeftBound", - "name": "SetAreaLeftBound", + "getterName": "AnimationName", + "name": "SetAnimationName", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::PropertyAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "GetArgumentAsString(\"Value\")" + ] + } + ], "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaLeftBound" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetPropertyAnimationName" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "GetArgumentAsString(\"Value\")" ] }, { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + "value": "SetAnimationName" }, "parameters": [ "Object", - "Behavior", - "" + "Object. Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())" ] } ] @@ -40155,83 +42071,135 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the area top bound. The top bound of the area where objects can go in the scene. While an object is needed, this will apply to all objects using the behavior.", - "fullName": "Area top bound", - "functionType": "ExpressionAndCondition", - "group": "Navigation mesh configuration", - "name": "AreaTopBound", - "sentence": "the area top bound", + "description": "Check if the animation is scaled according to speed.", + "fullName": "Scale animation according to speed", + "functionType": "Condition", + "name": "IsScalingAnimation", + "sentence": "_PARAM0_ animation is scaled according to speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::PropertyIsScalingAnimation" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::SharedPropertyAreaTopBound()" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "AreaTopBound", - "name": "SetAreaTopBound", - "sentence": "", + "description": "Change whether the animation is scaled according to speed or not.", + "fullName": "Scale animation according to speed", + "functionType": "Action", + "name": "SetIsScalingAnimation", + "sentence": "Scale the animation of _PARAM0_ according to speed: _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaTopBound" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetPropertyIsScalingAnimation" }, "parameters": [ "Object", "Behavior", + "no" + ] + }, + { + "type": { + "value": "ChangeAnimationSpeedScale" + }, + "parameters": [ + "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetPropertyIsScalingAnimation" + }, + "parameters": [ + "Object", + "Behavior", + "yes" ] }, { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetAnimationSpeedScale" }, "parameters": [ "Object", @@ -40246,24 +42214,32 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "IsScalingAnimation", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "the area right bound. The right bound of the area where objects can go in the scene (default to the game resolution). While an object is needed, this will apply to all objects using the behavior.", - "fullName": "Area right bound", - "functionType": "ExpressionAndCondition", - "group": "Navigation mesh configuration", - "name": "AreaRightBound", - "sentence": "the area right bound", + "description": "Change the animation speed scale according to the object speed.", + "fullName": "Animation speed scale", + "functionType": "Action", + "name": "SetAnimationSpeedScale", + "private": true, + "sentence": "Change the animation speed scale according to _PARAM0_ speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -40271,38 +42247,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "ChangeAnimationSpeedScale" }, "parameters": [ - "Object.Behavior::SharedPropertyAreaRightBound()" + "Object", + "=", + "Object.NavMeshPathfinding::Speed() / Object.NavMeshPathfinding::MaxSpeed()" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "AreaRightBound", - "name": "SetAreaRightBound", + "description": "Return the object movement direction.", + "fullName": "Direction", + "functionType": "Expression", + "name": "Direction", + "private": true, "sentence": "", "events": [ { @@ -40311,50 +42288,41 @@ "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaRightBound" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - }, - { - "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "" + "(Object.NavMeshPathfinding::MovementAngle() + Object.Behavior::PropertyAngleOffset()) * Object.Behavior::PropertyDirectionCount() / 360" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the area bottom bound. The bottom bound of the area where objects can go in the scene (default to the game resolution). While an object is needed, this will apply to all objects using the behavior.", - "fullName": "Area bottom bound", - "functionType": "ExpressionAndCondition", - "group": "Navigation mesh configuration", - "name": "AreaBottomBound", - "sentence": "the area bottom bound", + "description": "Return the difference between 2 directions.", + "fullName": "Direction dirrerence", + "functionType": "Expression", + "name": "DirectionDifference", + "private": true, + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -40365,7 +42333,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::SharedPropertyAreaBottomBound()" + "mod(mod(GetArgumentAsNumber(\"Direction\") - GetArgumentAsNumber(\"OtherDirection\"), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount() / 2, Object.Behavior::PropertyDirectionCount()) - Object.Behavior::PropertyDirectionCount() / 2" ] } ] @@ -40378,47 +42346,92 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "type": "expression" + }, + { + "description": "Other direction", + "name": "OtherDirection", + "type": "expression" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "AreaBottomBound", - "name": "SetAreaBottomBound", - "sentence": "", + "description": "Change the animation direction of the object.", + "fullName": "Animation direction", + "functionType": "Action", + "name": "SetAnimationDirection", + "private": true, + "sentence": "Change the animation direction of _PARAM0_ to _PARAM2_", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Change the animation but keep the current frame number.", + "comment2": "" + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::SetSharedPropertyAreaBottomBound" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetPropertyAnimationDirection" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "mod(mod(round(GetArgumentAsNumber(\"Value\")), Object.Behavior::PropertyDirectionCount()) + Object.Behavior::PropertyDirectionCount(), Object.Behavior::PropertyDirectionCount())" ] }, { "type": { - "value": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior::InvalidateNavMesh" + "value": "NavMeshPathfinding::NavMeshPathfindingAnimator::SetSharedPropertyAnimationFrame" }, "parameters": [ "Object", "Behavior", - "" + "=", + "Object.Sprite()" + ] + }, + { + "type": { + "value": "SetAnimationName" + }, + "parameters": [ + "Object", + "Object. Behavior::PropertyAnimationName() + ToString(Object.Behavior::PropertyAnimationDirection())" + ] + }, + { + "type": { + "value": "ChangeSprite" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::SharedPropertyAnimationFrame()" ] } ] @@ -40428,131 +42441,110 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", + "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingAnimator", "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Invalidate navigation mesh.", - "fullName": "Invalidate navigation mesh", - "functionType": "Action", - "name": "InvalidateNavMesh", - "private": true, - "sentence": "Invalidate navigation mesh", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "", - "eventsFunctionContext.returnValue = behavior.__NavMeshPathfinding.obstacle._manager.invalidateNavMesh();", - "" - ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "NavMeshPathfinding::NavMeshPathfindingObstacleBehavior", - "type": "behavior" + "description": "Value", + "name": "Value", + "type": "expression" } ], "objectGroups": [] } ], - "propertyDescriptors": [], - "sharedPropertyDescriptors": [ + "propertyDescriptors": [ { - "value": "Top-Down", - "type": "Choice", - "label": "Viewpoint", + "value": "", + "type": "Behavior", + "label": "Navigation mesh pathfinding", "description": "", "group": "", "extraInformation": [ - "Top-Down", - "Isometry 2:1 (26.565°)", - "True Isometry (30°)" + "NavMeshPathfinding::NavMeshPathfindingBehavior" ], "hidden": false, - "name": "Viewpoint" + "name": "NavMeshPathfinding" }, { - "value": "10", - "type": "Number", - "label": "Cell size", - "description": "Cell size for obstacle collision mask rasterization.", - "group": "", + "value": "true", + "type": "Boolean", + "label": "Scale animation according to speed", + "description": "", + "group": "Animation", "extraInformation": [], "hidden": false, - "name": "CellSize" + "name": "IsScalingAnimation" + }, + { + "value": "Walk", + "type": "String", + "label": "Animation name", + "description": "Animations must be called \"Walk0\", \"Walk1\"... for left, down...", + "group": "Animation", + "extraInformation": [], + "hidden": false, + "name": "AnimationName" }, { "value": "0", "type": "Number", - "label": "Area left bound", - "description": "The left bound of the area where objects can go in the scene.", - "group": "", + "unit": "Dimensionless", + "label": "Number of directions", + "description": "Leave to 0 to automatically use 8 when diagonals are allowed and 4 otherwise.", + "group": "Direction", "extraInformation": [], "hidden": false, - "name": "AreaLeftBound" + "name": "DirectionCount" }, { "value": "0", "type": "Number", - "label": "Area top bound", - "description": "The top bound of the area where objects can go in the scene.", - "group": "", + "unit": "DegreeAngle", + "label": "Angle offset", + "description": "Setted to 90°, \"Walk0\" becomes the animation for down.", + "group": "Direction", "extraInformation": [], "hidden": false, - "name": "AreaTopBound" + "name": "AngleOffset" }, { "value": "0", "type": "Number", - "label": "Area right bound", - "description": "The right bound of the area where objects can go in the scene (default to the game resolution).", + "label": "", + "description": "", "group": "", "extraInformation": [], - "hidden": false, - "name": "AreaRightBound" - }, + "hidden": true, + "name": "AnimationDirection" + } + ], + "sharedPropertyDescriptors": [ { "value": "0", "type": "Number", - "label": "Area bottom bound", - "description": "The bottom bound of the area where objects can go in the scene (default to the game resolution).", + "label": "", + "description": "", "group": "", "extraInformation": [], - "hidden": false, - "name": "AreaBottomBound" + "hidden": true, + "name": "NewAnimationDirection" }, { - "value": "", + "value": "0", "type": "Number", "label": "", "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "IsometricRatio" + "name": "AnimationFrame" } ] }