diff --git a/extensions/reviewed/ShadowClones.json b/extensions/reviewed/ShadowClones.json index 6c5859adb..02a7ec89e 100644 --- a/extensions/reviewed/ShadowClones.json +++ b/extensions/reviewed/ShadowClones.json @@ -1,17 +1,18 @@ { "author": "Tristan Rhodes (https://victrisgames.itch.io/) and Entropy (https://www.youtube.com/channel/UClvkb12nOWFgWnQ56NF9Rcw)", "category": "Visual effect", + "dimension": "2D", "extensionNamespace": "", - "gdevelopVersion": ">=5.5.222", "fullName": "Animate Shadow Clones", - "helpPath": "https://www.youtube.com/watch?v=2t4ANYgrrak", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1hcnJhbmdlLWFib3ZlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTMsMUMxLjg5LDEgMSwxLjg5IDEsM1YxNEMxLDE1LjExIDEuODksMTYgMywxNkM2LjY3LDE2IDEwLjMzLDE2IDE0LDE2QzE1LjExLDE2IDE2LDE1LjExIDE2LDE0QzE2LDEwLjMzIDE2LDYuNjcgMTYsM0MxNiwxLjg5IDE1LjExLDEgMTQsMUgzTTMsM0gxNFYxNEgzVjNNMTgsN1Y5SDIwVjIwSDlWMThIN1YyMEM3LDIxLjExIDcuODksMjIgOSwyMkgyMEMyMS4xMSwyMiAyMiwyMS4xMSAyMiwyMFY5QzIyLDcuODkgMjEuMTEsNyAyMCw3SDE4WiIgLz48L3N2Zz4=", "name": "ShadowClones", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-arrange-above.svg", - "shortDescription": "Create fading shadow clone trail.", - "version": "0.7.1", + "shortDescription": "Create a fading shadow clone trail.", + "version": "0.8.0", "description": [ - "Select the primary object, the shadow clone object, the number of shadow clones, the number of frames between shadow clones, the rate that shadow clones will reduce opacity and size (if desired), the Z-value and the layer the shadow clones will be created on.", + "Create a fading shadow clone trail.", "", "This extension can be used to:", "", @@ -24,7 +25,6 @@ "These object variables are provided to manage the shadow clones:", "", "- ShadowCloneOrder: Shadow clone identifier, where 1 is the shadow clone closest to the primary object", - "- FramesBehindPrimary: The number of frames that the shadow clone is behind the primary object", "", "Notes: ", "- For shadow clones to work, this action must be run every frame.", @@ -49,16 +49,467 @@ "authorIds": [ "q8ubdigLvIRXLxsJDDTaokO41mc2", "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "m4hBMBTUilft4s1V4FQQPakVDGx1" + "m4hBMBTUilft4s1V4FQQPakVDGx1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" ], "dependencies": [], + "globalVariables": [], + "sceneVariables": [], "eventsFunctions": [ { "description": "Select the primary object, the shadow clone object, the number of shadow clones, the number of frames between shadow clones, the rate that shadow clones will fade away (if desired), the Z-value of the shadow clones, and the layer the shadow clones will be created on.", "fullName": "Animate shadow clones that follow the path of a primary object", "functionType": "Action", "name": "AnimateShadowClones", + "private": true, "sentence": "Create and animate _PARAM3_ copies of _PARAM2_ that follow the position of _PARAM1_, with _PARAM4_ empty frames between shadow clones, and fading the opacity of shadow clones by _PARAM5_ per clone. Shrink scale of shadow clones by _PARAM6_ per clone. Shadow clones will be created on _PARAM7_ layer with a Z-value of _PARAM8_. Match X scale: _PARAM9_ Match Y scale: _PARAM10_ Match angle: _PARAM11_ Match animation: _PARAM12_ Match animation frame: _PARAM13_ Match vertical flip: _PARAM14_ Match horizontal flip: _PARAM15_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchScaleX", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchScaleXValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchScaleY", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchScaleYValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchAngle", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchAngleValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchAnimation", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchAnimationValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchAnimationFrame", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchAnimationFrameValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchVerticalFlip", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchVerticalFlipValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchHorizontalFlip", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchHorizontalFlipValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShadowClones::AnimateShadowClonesWithCapabilities" + }, + "parameters": [ + "", + "PrimaryObject", + "Scale", + "Flippable", + "Opacity", + "Animation", + "ShadowCloneObject", + "Scale", + "Flippable", + "Opacity", + "Animation", + "ClonesCount", + "max(1, GapFrames)", + "(PrimaryObject.Opacity::Value() - FadeSpeed) / PrimaryObject.Opacity::Value()", + "(PrimaryObject.Opacity::Value() - FadeSpeed * ClonesCount) / PrimaryObject.Opacity::Value()", + "PrimaryObject.Scale::Value() - ClonesCount * ShrinkSpeed / 100", + "ShadowCloneLayer", + "ShadowCloneZValue", + "MatchScaleXValue", + "MatchScaleYValue", + "MatchAngleValue", + "MatchAnimationValue", + "MatchAnimationFrameValue", + "MatchVerticalFlipValue", + "MatchHorizontalFlipValue", + "" + ] + } + ] + } + ], + "variables": [ + { + "name": "MatchAngleValue", + "persistentUuid": "dcae69c4-371f-488f-9873-63b471e3f935", + "type": "number", + "value": 0 + }, + { + "name": "MatchScaleYValue", + "persistentUuid": "a2e084bc-556d-4add-853a-32a6b76bd5ad", + "type": "number", + "value": 0 + }, + { + "name": "CopyOfMatchAngleValue", + "persistentUuid": "f8832b1b-1fcd-4c0b-a522-b792cba4c099", + "type": "number", + "value": 0 + }, + { + "name": "MatchAnimationValue", + "persistentUuid": "318d3b6f-bfc8-41e5-a462-f5f06a05d32d", + "type": "number", + "value": 0 + }, + { + "name": "MatchAnimationFrameValue", + "persistentUuid": "64a6cba3-36f4-4d64-aa59-30511bf04f0c", + "type": "number", + "value": 0 + }, + { + "name": "MatchVerticalFlipValue", + "persistentUuid": "a320ddff-b590-4c8d-80c4-c3b4f0dbcb9f", + "type": "number", + "value": 0 + }, + { + "name": "MatchHorizontalFlipValue", + "persistentUuid": "cebe98df-7dab-45c9-84c0-ebecd3d82e9e", + "type": "number", + "value": 0 + }, + { + "name": "MatchScaleXValue", + "persistentUuid": "cb15a452-ad88-4612-b7f8-1806710133a6", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object that shadow clones will follow", + "name": "PrimaryObject", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Shadows clones will be made of this object (Cannot be the same object used for primary object)", + "name": "ShadowCloneObject", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Number of shadow clones (Default: 1)", + "name": "ClonesCount", + "type": "expression" + }, + { + "description": "Number of empty frames between shadow clones (Default: 1)", + "name": "GapFrames", + "type": "expression" + }, + { + "description": "Fade speed (Range: 0 to 255) (Default: 0)", + "longDescription": "Decrease in opacity for each consecutive shadow clone ", + "name": "FadeSpeed", + "type": "expression" + }, + { + "description": "Shrink speed (Range: 0 to 100) (Default: 0)", + "longDescription": "Decrease in scale for each consecutive shadow clone ", + "name": "ShrinkSpeed", + "type": "expression" + }, + { + "description": "Shadow clones will be created on this layer. (Default: \"\") (Base Layer)", + "name": "ShadowCloneLayer", + "type": "layer" + }, + { + "description": "Z value for created shadow clones", + "name": "ShadowCloneZValue", + "type": "expression" + }, + { + "description": "Match X scale of primary object:", + "name": "MatchScaleX", + "type": "yesorno" + }, + { + "description": "Match Y scale of primary object:", + "name": "MatchScaleY", + "type": "yesorno" + }, + { + "description": "Match angle of primary object:", + "name": "MatchAngle", + "type": "yesorno" + }, + { + "description": "Match animation of primary object:", + "name": "MatchAnimation", + "type": "yesorno" + }, + { + "description": "Match animation frame of primary object:", + "name": "MatchAnimationFrame", + "type": "yesorno" + }, + { + "description": "Match the vertical flip of primary object:", + "name": "MatchVerticalFlip", + "type": "yesorno" + }, + { + "description": "Match the horizontal flip of primary object:", + "name": "MatchHorizontalFlip", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Delete shadow clone objects that are linked to a primary object.", + "fullName": "Delete shadow clone objects that are linked to a primary object", + "functionType": "Action", + "name": "DeleteShadowClones", + "private": true, + "sentence": "Delete all _PARAM2_ that are linked to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "ShadowClones", + "conditions": [ + { + "type": { + "value": "LinkedObjects::PickObjectsLinkedTo" + }, + "parameters": [ + "", + "ShadowClones", + "PrimaryObject" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "ShadowClones", + "" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "PrimaryObject", + "ClonesCreated", + "=", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "PrimaryObject", + "History" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Primary object", + "name": "PrimaryObject", + "type": "objectList" + }, + { + "description": "Shadow clones", + "name": "ShadowClones", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Select the primary object, the shadow clone object, the number of shadow clones, the number of frames between shadow clones, the rate that shadow clones will fade away (if desired), the Z-value of the shadow clones, and the layer the shadow clones will be created on.", + "fullName": "Animate shadow clones that follow the path of a primary object", + "functionType": "Action", + "name": "AnimateShadowClonesWithCapabilities", + "private": true, + "sentence": "Create and animate _PARAM11_ copies of _PARAM6_ that follow the position of _PARAM1_, with _PARAM12_ empty frames between shadow clones, and fading the opacity of shadow clones from _PARAM13_ to _PARAM14_. Shrink scale of shadow clones by _PARAM15_ per clone. Shadow clones will be created on _PARAM16_ layer with a Z-value of _PARAM17_. Match X scale: _PARAM18_ Match Y scale: _PARAM19_ Match angle: _PARAM20_ Match animation: _PARAM21_ Match animation frame: _PARAM22_ Match vertical flip: _PARAM23_ Match horizontal flip: _PARAM24_", "events": [ { "colorB": 228, @@ -70,19 +521,38 @@ "type": "BuiltinCommonInstructions::Group", "events": [ { - "type": "BuiltinCommonInstructions::ForEach", - "object": "PrimaryObject", + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Calculate the max frames behind the primary that a shadow will exist" + }, + { + "type": "BuiltinCommonInstructions::Standard", "conditions": [], - "actions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FramesCount", + "=", + "ClonesCount * FramesGap" + ] + } + ], "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Initialize variables", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -94,36 +564,36 @@ "textG": 0, "textR": 0 }, - "comment": "Read input variables", - "comment2": "" + "comment": "Clean-up unused history" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "When there are no longer values at the end of the array." }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "ModVarObjet" + "value": "VarObjet" }, "parameters": [ - "PrimaryObject", - "TotalShadowClones", - "=", - "NumberOfShadowClones" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FramesBetweenShadowClones", - "=", - "FramesBetweenShadowClones" + "Object", + "Head", + ">=", + "FramesCount - 1" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -135,82 +605,27 @@ "textG": 0, "textR": 0 }, - "comment": "Fix default value (min=1)", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "FramesBetweenShadowClones", - "<", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FramesBetweenShadowClones", - "=", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate the max frames behind the primary that a shadow will exist", - "comment2": "" + "comment": "We cut the end of the array." }, { - "type": "BuiltinCommonInstructions::Standard", + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(History) - (Object.Variable(Head) + 1)", "conditions": [], "actions": [ { "type": { - "value": "ModVarObjet" + "value": "ObjectVariableRemoveChild" }, "parameters": [ - "PrimaryObject", - "MaxFramesBehind", - "=", - "PrimaryObject.Variable(TotalShadowClones)*PrimaryObject.Variable(FramesBetweenShadowClones)" + "Object", + "History", + "ToString(Object.VariableChildCount(History) - 1)" ] } ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Create Shadow Clones", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -221,55 +636,10 @@ "textG": 0, "textR": 0 }, - "comment": "Create the right number of shadow clones (but only when there is position data)", - "comment2": "" + "comment": "Move the head to the next index\nThe History array is used as a circular buffer (thus the mod)" }, { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "ClonesCreated", - "<", - "PrimaryObject.Variable(TotalShadowClones)" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString((PrimaryObject.Variable(ClonesCreated) + 1) * PrimaryObject.Variable(FramesBetweenShadowClones))].xpos", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString((PrimaryObject.Variable(ClonesCreated) + 1) * PrimaryObject.Variable(FramesBetweenShadowClones))].ypos", - "!=", - "0" - ] - } - ] - } - ], + "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { @@ -277,369 +647,777 @@ "value": "ModVarObjet" }, "parameters": [ - "PrimaryObject", - "ClonesCreated", - "+", - "1" + "Object", + "Head", + "=", + "mod(Object.Variable(Head) + 1, max(FramesCount, Object.VariableChildCount(History)))" ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create shadow clones and link them to the primary object", - "comment2": "" }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "ShadowCloneObject", - "PrimaryObject.X()", - "PrimaryObject.Y()", - "ShadowCloneLayer" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "ShadowCloneOrder", - "=", - "PrimaryObject.Variable(ClonesCreated)" - ] - }, - { - "type": { - "value": "SetZOrder" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "ShadowCloneZValue" - ] - }, - { - "type": { - "value": "LinkedObjects::LinkObjects" - }, - "parameters": [ - "", - "PrimaryObject", - "ShadowCloneObject" - ] - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Change shadow clones based on the history of the PrimaryObject", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::ForEach", - "object": "ShadowCloneObject", - "conditions": [ { "type": { - "value": "LinkedObjects::PickObjectsLinkedTo" + "value": "SetNumberVariable" }, "parameters": [ - "", - "PrimaryObject", - "ShadowCloneObject" + "Head", + "=", + "Object.Variable(Head)" ] } ], - "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move shadow clones ", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Create Shadow Clones", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "SetXY" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].xpos)", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].ypos)" + "comment": "Create the right number of shadow clones (but only when there is position data)" + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "min(ClonesCount, floor(Object.VariableChildCount(History) / FramesGap)) - Object.Variable(ClonesCreated)", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "ClonesCreated", + "+", + "1" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Clone", + "Object.X()", + "Object.Y()", + "CloneLayer" + ] + }, + { + "type": { + "value": "SetZOrder" + }, + "parameters": [ + "Clone", + "=", + "CloneZValue" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Clone", + "ShadowCloneOrder", + "=", + "Object.Variable(ClonesCreated)" + ] + }, + { + "type": { + "value": "LinkedObjects::LinkObjects" + }, + "parameters": [ + "", + "Object", + "Clone" + ] + } ] } - ] + ], + "parameters": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Change shadow clones based on the history of the PrimaryObject", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAngle", - "True", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LinkedObjects::PickObjectsLinkedTo" + }, + "parameters": [ + "", + "Clone", + "Object", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Clone", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Delete shadow clone if we have decreased number of shadow clones." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Clone", + "ShadowCloneOrder", + ">", + "ClonesCount" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Clone", + "" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "ClonesCreated", + "-", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "mod(Head - Clone.Variable(ShadowCloneOrder) * FramesGap, FramesCount)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Ratio", + "=", + "Clone.Variable(ShadowCloneOrder) / ClonesCount" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Clone", + "=", + "Object.Variable(History[Index].xpos)", + "=", + "Object.Variable(History[Index].ypos)" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Clone", + "Opacity2", + "=", + "Object.Opacity::Value() * lerp(OpacityStart, OpacityEnd, Ratio)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "ScaleEnd", + "!=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Clone", + "Scale2", + "=", + "lerp(Object.Scale::X(), ScaleEnd, Ratio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Clone", + "Scale2", + "=", + "lerp(Object.Scale::Y(), ScaleEnd, Ratio)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchScaleX", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Clone", + "Scale2", + "=", + "Object.Variable(History[Index].xscale)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchScaleY", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Clone", + "Scale2", + "=", + "Object.Variable(History[Index].yscale)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchAngle", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Clone", + "=", + "Object.Variable(History[Index].angle)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchAnimation", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Clone", + "Animation2", + "=", + "Object.Variable(History[Index].animation)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchAnimationFrame", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime" + }, + "parameters": [ + "Clone", + "Animation2", + "=", + "Object.Variable(History[Index].frame)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchHorizontalFlip", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Clone", + "horizontalflip", + "=", + "Object.Variable(History[Index].horizontalflip)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Clone", + "horizontalflip", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Clone", + "Flippable2", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Clone", + "horizontalflip", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Clone", + "Flippable2", + "yes" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "MatchVerticalFlip", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Clone", + "verticalflip", + "=", + "Object.Variable(History[Index].verticalflip)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Clone", + "verticalflip", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipY" + }, + "parameters": [ + "Clone", + "Flippable2", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Clone", + "verticalflip", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipY" + }, + "parameters": [ + "Clone", + "Flippable2", + "yes" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Index", + "persistentUuid": "ed4119b6-5f73-4938-824d-1a69f6c92782", + "type": "number", + "value": 0 + }, + { + "name": "Ratio", + "type": "number", + "value": 0 + } ] } ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].angle)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Only change scale if ShrinkSpeed has not been set", - "comment2": "" + "parameters": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Update history of the PrimaryObject ", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "BooleanVariable" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "MatchScaleX", - "True", - "" - ] + "comment": "Record new current position at the head index\nIt's done last because it is written over the oldest position" }, { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScaleWidth" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].xscale)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Only change scale if ShrinkSpeed has not been set", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchScaleY", - "True", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].xpos", + "=", + "Object.X()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].ypos", + "=", + "Object.Y()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].animation", + "=", + "Object.Animation::Index()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].frame", + "=", + "Object.Animation::ElapsedTime()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].angle", + "=", + "Object.Angle()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].xscale", + "=", + "Object.Scale::X()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].yscale", + "=", + "Object.Scale::Y()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "History[Head].height", + "=", + "Object.Height()" + ] + } ] }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScaleHeight" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].yscale)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAnimation", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeAnimation" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].animation)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAnimationFrame", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeSprite" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].frame)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchHorizontalFlip", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "horizontalflip", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].horizontalflip)" - ] - } - ], - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "ObjectVariableAsBoolean" + "inverted": true, + "value": "FlippableCapability::FlippableBehavior::FlippedX" }, "parameters": [ - "ShadowCloneObject", - "horizontalflip", - "=" + "Object", + "Flippable" ] } ], "actions": [ { "type": { - "value": "FlipX" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "ShadowCloneObject", - "no" + "Object", + "History[Head].horizontalflip", + "=" ] } ] @@ -649,79 +1427,50 @@ "conditions": [ { "type": { - "value": "ObjectVariableAsBoolean" + "value": "FlippableCapability::FlippableBehavior::FlippedX" }, "parameters": [ - "ShadowCloneObject", - "horizontalflip", - "True" + "Object", + "Flippable" ] } ], "actions": [ { "type": { - "value": "FlipX" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "ShadowCloneObject", - "yes" + "Object", + "History[Head].horizontalflip", + "True" ] } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchVerticalFlip", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "verticalflip", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(ShadowCloneOrder)*PrimaryObject.Variable(FramesBetweenShadowClones))].verticalflip)" - ] - } - ], - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "ObjectVariableAsBoolean" + "inverted": true, + "value": "FlippableCapability::FlippableBehavior::FlippedY" }, "parameters": [ - "ShadowCloneObject", - "verticalflip", - "=" + "Object", + "Flippable" ] } ], "actions": [ { "type": { - "value": "FlipY" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "ShadowCloneObject", - "no" + "Object", + "History[Head].verticalflip", + "=" ] } ] @@ -731,2518 +1480,1225 @@ "conditions": [ { "type": { - "value": "ObjectVariableAsBoolean" + "value": "FlippableCapability::FlippableBehavior::FlippedY" }, "parameters": [ - "ShadowCloneObject", - "verticalflip", - "True" + "Object", + "Flippable" ] } ], "actions": [ { "type": { - "value": "FlipY" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "ShadowCloneObject", - "yes" + "Object", + "History[Head].verticalflip", + "True" ] } ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change opacity of shadow clone (if requested)", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "FadeSpeed", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Opacity" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Opacity()-FadeSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "FadeSpeed", - "=", - "0" - ] - } ], - "actions": [ - { - "type": { - "value": "Opacity" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Opacity()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Shrink shadow clones (if requested)", - "comment2": "" - }, + "parameters": [] + } + ], + "variables": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "!=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeScaleWidth" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleX()-(ShrinkSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)/100)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeScaleHeight" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleY()-(ShrinkSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)/100)" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Delete shadow clone if we have decreased number of shadow clones. Reset counter variable.", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "ShadowCloneOrder", - ">", - "PrimaryObject.Variable(TotalShadowClones)" - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "ShadowCloneObject", - "" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ClonesCreated", - "-", - "1" - ] - } - ] + "name": "Head", + "type": "number", + "value": 0 } ] } + ] + } + ], + "variables": [ + { + "name": "FramesCount", + "persistentUuid": "50834f36-0a0f-4fb3-8025-0981a140b492", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object that shadow clones will follow", + "name": "Object", + "type": "objectList" + }, + { + "description": "Scalable objects", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Flippable objects", + "name": "Flippable", + "supplementaryInformation": "FlippableCapability::FlippableBehavior", + "type": "behavior" + }, + { + "description": "Objects with opacity", + "name": "Opacity", + "supplementaryInformation": "OpacityCapability::OpacityBehavior", + "type": "behavior" + }, + { + "description": "Objects with animations", + "name": "Animation", + "supplementaryInformation": "AnimatableCapability::AnimatableBehavior", + "type": "behavior" + }, + { + "description": "Shadows clones will be made of this object (Cannot be the same object used for primary object)", + "name": "Clone", + "type": "objectList" + }, + { + "description": "Scalable objects", + "name": "Scale2", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Flippable objects", + "name": "Flippable2", + "supplementaryInformation": "FlippableCapability::FlippableBehavior", + "type": "behavior" + }, + { + "description": "Objects with opacity", + "name": "Opacity2", + "supplementaryInformation": "OpacityCapability::OpacityBehavior", + "type": "behavior" + }, + { + "description": "Objects with animations", + "name": "Animation2", + "supplementaryInformation": "AnimatableCapability::AnimatableBehavior", + "type": "behavior" + }, + { + "description": "Number of shadow clones", + "name": "ClonesCount", + "type": "expression" + }, + { + "description": "Number of empty frames between shadow clones", + "name": "FramesGap", + "type": "expression" + }, + { + "description": "First clone opacity (from 0 to 1) (Default: 0)", + "name": "OpacityStart", + "type": "expression" + }, + { + "description": "Last clone opacity (from 0 to 1) (Default: 0)", + "name": "OpacityEnd", + "type": "expression" + }, + { + "description": "Scale end (from 0 to 1)", + "name": "ScaleEnd", + "type": "expression" + }, + { + "description": "Clone layer", + "name": "CloneLayer", + "type": "layer" + }, + { + "description": "Clone Z-order", + "name": "CloneZValue", + "type": "expression" + }, + { + "description": "Match X scale of object", + "name": "MatchScaleX", + "type": "expression" + }, + { + "description": "Match Y scale of object", + "name": "MatchScaleY", + "type": "expression" + }, + { + "description": "Match angle of object", + "name": "MatchAngle", + "type": "expression" + }, + { + "description": "Match animation of object", + "name": "MatchAnimation", + "type": "expression" + }, + { + "description": "Match animation frame of object", + "name": "MatchAnimationFrame", + "type": "expression" + }, + { + "description": "Match the vertical flip of object", + "name": "MatchVerticalFlip", + "type": "expression" + }, + { + "description": "Match the horizontal flip of object", + "name": "MatchHorizontalFlip", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "AnimateShadowClones" + }, + { + "functionName": "AnimateShadowClonesWithCapabilities" + }, + { + "functionName": "DeleteShadowClones" + } + ] + }, + "eventsBasedBehaviors": [ + { + "description": "Create a fading shadow clone trail.", + "fullName": "Shadow clone emitter", + "helpPath": "", + "iconUrl": "", + "name": "ShadowCloneEmitter", + "objectType": "", + "previewIconUrl": "", + "eventsFunctions": [ + { + "description": "Create and animate a fading shadow clone trail. This action must be called every frame.", + "fullName": "Animate shadow clones", + "functionType": "Action", + "name": "AnimateClones", + "sentence": "Create and animate copies of _PARAM2_ that follow the position of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchScaleX", + "True", + "" + ] + } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchScaleXValue", + "=", + "1" + ] + } + ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update history of the PrimaryObject ", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "BooleanVariable" }, - "comment": "Clean-up unused history", - "comment2": "" - }, + "parameters": [ + "MatchScaleY", + "True", + "" + ] + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataCleaningCounter", - "=", - "PrimaryObject.Variable(MaxFramesBehind)+1" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchScaleYValue", + "=", + "1" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "ObjectVariableChildExists" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory", - "ToString(PrimaryObject.Variable(DataCleaningCounter))" - ] - } - ], - "conditions": [], - "actions": [ - { - "type": { - "value": "ObjectVariableRemoveChild" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory", - "ToString(PrimaryObject.Variable(DataCleaningCounter))" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataCleaningCounter", - "+", - "1" - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchAngle", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "Reset temp variable for iterating through child objects", - "comment2": "" - }, + "parameters": [ + "MatchAngleValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataMoveCounter", - "=", - "PrimaryObject.Variable(MaxFramesBehind)" - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchAnimation", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "Move position history to the next higher index, starting from the highest number (FramesBehind-1)", - "comment2": "" - }, + "parameters": [ + "MatchAnimationValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataMoveCounter", - ">", - "1" - ] - } - ], - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move object history to one higher frame", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].xpos", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].xpos)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].ypos", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].ypos)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].angle", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].angle)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].animation", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].animation)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].frame", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].frame)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].xscale", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].xscale)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].yscale", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].yscale)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].width", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].width)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].height", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].height)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].horizontalflip", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].horizontalflip)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].verticalflip", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].verticalflip)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataMoveCounter", - "-", - "1" - ] - } - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchAnimationFrame", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "Record new current position in index = 1", - "comment2": "" - }, + "parameters": [ + "MatchAnimationFrameValue", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.xpos", - "=", - "PrimaryObject.X()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.ypos", - "=", - "PrimaryObject.Y()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.animation", - "=", - "PrimaryObject.Animation()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.frame", - "=", - "PrimaryObject.Sprite()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.angle", - "=", - "PrimaryObject.Angle()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.xscale", - "=", - "PrimaryObject.ScaleX()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.yscale", - "=", - "PrimaryObject.ScaleY()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.width", - "=", - "PrimaryObject.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.height", - "=", - "PrimaryObject.Height()" - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchVerticalFlip", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "FlippedX" - }, - "parameters": [ - "PrimaryObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.horizontalflip", - "=" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchVerticalFlipValue", + "=", + "1" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FlippedX" - }, - "parameters": [ - "PrimaryObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.horizontalflip", - "True" - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MatchHorizontalFlip", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "FlippedY" - }, - "parameters": [ - "PrimaryObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.verticalflip", - "=" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MatchHorizontalFlipValue", + "=", + "1" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FlippedY" - }, - "parameters": [ - "PrimaryObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.verticalflip", - "True" - ] - } + "type": { + "value": "ShadowClones::AnimateShadowClonesWithCapabilities" + }, + "parameters": [ + "", + "Object", + "Scale", + "Flippable", + "Opacity", + "Animation", + "Clone", + "Scale2", + "Flippable2", + "Opacity2", + "Animation2", + "ClonesCount", + "FramesGap", + "OpacityStart", + "max(OpacityEnd, (OpacityStart - OpacityEnd) / (ClonesCount + 1))", + "max(ScaleEnd, 1 / (ClonesCount + 1))", + "Object.Layer()", + "Object.ZOrder() - 1", + "MatchScaleXValue", + "MatchScaleYValue", + "MatchAngleValue", + "MatchAnimationValue", + "MatchAnimationFrameValue", + "MatchVerticalFlipValue", + "MatchHorizontalFlipValue", + "" ] } - ], - "parameters": [] + ] + } + ], + "variables": [ + { + "name": "MatchAngleValue", + "persistentUuid": "c84f45ca-f103-4558-bdfb-aaf8a7febcfd", + "type": "number", + "value": 0 + }, + { + "name": "MatchScaleYValue", + "persistentUuid": "e75cfb0e-be5c-4e99-9301-b89bb4bd8fe5", + "type": "number", + "value": 0 + }, + { + "name": "CopyOfMatchAngleValue", + "persistentUuid": "4ed09474-15ca-476d-a50a-e6e8c4c2d317", + "type": "number", + "value": 0 + }, + { + "name": "MatchAnimationValue", + "persistentUuid": "ca65f23d-4f53-47ef-982e-acd26f995aba", + "type": "number", + "value": 0 + }, + { + "name": "MatchAnimationFrameValue", + "persistentUuid": "c7951025-20f3-4ab6-80ba-7b7370dbe6a4", + "type": "number", + "value": 0 + }, + { + "name": "MatchVerticalFlipValue", + "persistentUuid": "2a548444-f50b-49d6-a947-e5ef63f4d94a", + "type": "number", + "value": 0 + }, + { + "name": "MatchHorizontalFlipValue", + "persistentUuid": "1b2838f3-5c22-4780-bd48-350b7591d6fc", + "type": "number", + "value": 0 + }, + { + "name": "MatchScaleXValue", + "persistentUuid": "c5faadef-e5ca-47ce-8483-deedd685dc8a", + "type": "number", + "value": 0 } ] } ], - "parameters": [] + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + }, + { + "description": "Shadow clone", + "longDescription": "Must be a different object that the one with emitter behavior.", + "name": "Clone", + "type": "objectList" + }, + { + "description": "Scalable objects", + "name": "Scale2", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Flippable objects", + "name": "Flippable2", + "supplementaryInformation": "FlippableCapability::FlippableBehavior", + "type": "behavior" + }, + { + "description": "Objects with opacity", + "name": "Opacity2", + "supplementaryInformation": "OpacityCapability::OpacityBehavior", + "type": "behavior" + }, + { + "description": "Objects with animations", + "name": "Animation2", + "supplementaryInformation": "AnimatableCapability::AnimatableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "disabled": true, - "folded": true, - "name": "Animate Shadow Clones OLD VERSION", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "description": "the number of clones following the object.", + "fullName": "Number of clones", + "functionType": "ExpressionAndCondition", + "group": "Shadow clone emitter configuration", + "name": "ClonesCount", + "sentence": "the number of clones", "events": [ { - "type": "BuiltinCommonInstructions::ForEach", - "object": "PrimaryObject", + "type": "BuiltinCommonInstructions::Standard", "conditions": [], - "actions": [], - "events": [ + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Manage Shadows", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Read input variables", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "TotalShadowClones", - "=", - "NumberOfShadowClones" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FramesBetweenShadowClones", - "=", - "FramesBetweenShadowClones" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Fix default value (min=1)", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "FramesBetweenShadowClones", - "<", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FramesBetweenShadowClones", - "=", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate the max frames behind the primary that a shadow will exist", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "MaxFramesBehind", - "=", - "PrimaryObject.Variable(TotalShadowClones)*PrimaryObject.Variable(FramesBetweenShadowClones)" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create the right number of shadows", - "comment2": "" - }, - { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "<", - "PrimaryObject.Variable(MaxFramesBehind)" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(FrameCounter)+1)].xpos", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(FrameCounter)+1)].ypos", - "!=", - "0" - ] - } - ] - } - ], - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "+", - "1" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create shadow clones at proper intervals and link them to the primary object", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "mod(PrimaryObject.Variable(FrameCounter),PrimaryObject.Variable(FramesBetweenShadowClones))", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "ShadowCloneObject", - "PrimaryObject.X()", - "PrimaryObject.Y()", - "ShadowCloneLayer" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "FramesBehindPrimary", - "=", - "PrimaryObject.Variable(FrameCounter)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "ShadowCloneOrder", - "=", - "PrimaryObject.Variable(FrameCounter)/PrimaryObject.Variable(FramesBetweenShadowClones)" - ] - }, - { - "type": { - "value": "ModVarObjetTxt" - }, - "parameters": [ - "ShadowCloneObject", - "ShadowCloneGroupID", - "=", - "ShadowCloneGroupID" - ] - }, - { - "type": { - "value": "SetZOrder" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "ShadowCloneZValue" - ] - }, - { - "type": { - "value": "LinkedObjects::LinkObjects" - }, - "parameters": [ - "", - "PrimaryObject", - "ShadowCloneObject" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Copy current state of PrimaryObject", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAngle", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Angle()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchScaleX", - "True", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScaleWidth" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleX()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchScaleY", - "True", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScaleHeight" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleY()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAnimation", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeAnimation" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Animation()" - ] - }, - { - "type": { - "value": "PauseAnimation" - }, - "parameters": [ - "ShadowCloneObject" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAnimationFrame", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeSprite" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Sprite()" - ] - }, - { - "type": { - "value": "PauseAnimation" - }, - "parameters": [ - "ShadowCloneObject" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Set fade", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "FadeSpeed", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Opacity" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "255-FadeSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Set scale", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "!=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeScaleWidth" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleX()-(ShrinkSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)/100)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeScaleHeight" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleY()-(ShrinkSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)/100)" - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move shadow clones ", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::ForEach", - "object": "ShadowCloneObject", - "conditions": [ - { - "type": { - "value": "VarObjetTxt" - }, - "parameters": [ - "ShadowCloneObject", - "ShadowCloneGroupID", - "=", - "ShadowCloneGroupID" - ] - }, - { - "type": { - "value": "LinkedObjects::PickObjectsLinkedTo" - }, - "parameters": [ - "", - "PrimaryObject", - "ShadowCloneObject" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move shadow clones", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetXY" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].xpos)", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].ypos)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAngle", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].angle)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Only change scale if ShrinkSpeed has not been set", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchScaleX", - "True", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScaleWidth" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].xscale)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Only change scale if ShrinkSpeed has not been set", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchScaleY", - "True", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScaleHeight" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].yscale)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAnimation", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeAnimation" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].animation)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "MatchAnimationFrame", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeSprite" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(ShadowCloneObject.Variable(FramesBehindPrimary))].frame)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Update FramesBehindPrimary if the FramesBetweenShadowClones has changed ", - "comment2": "" - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShadowCloneObject.Variable(FramesBehindPrimary) / ShadowCloneObject.Variable(ShadowCloneOrder)", - "!=", - "PrimaryObject.Variable(FramesBetweenShadowClones)" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "FramesBehindPrimary", - "=", - "ShadowCloneObject.Variable(ShadowCloneOrder) * PrimaryObject.Variable(FramesBetweenShadowClones)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Delete shadow clone if we have decreased number of shadow clones or changed distance between clones. Reset counter variable.", - "comment2": "" - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "ShadowCloneOrder", - ">", - "PrimaryObject.Variable(TotalShadowClones)" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShadowCloneObject.Variable(FramesBehindPrimary) / ShadowCloneObject.Variable(ShadowCloneOrder)", - "!=", - "PrimaryObject.Variable(FramesBetweenShadowClones)" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "ShadowCloneObject", - "" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "-", - "min(ShadowCloneObject.Variable(FramesBehindPrimary) / ShadowCloneObject.Variable(ShadowCloneOrder),PrimaryObject.Variable(FramesBetweenShadowClones))" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Don't let counter go negative", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "=", - "0" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "ShadowCloneObject", - "FramesBehindPrimary", - ">", - "PrimaryObject.Variable(MaxFramesBehind)" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShadowCloneObject.Variable(FramesBehindPrimary) / ShadowCloneObject.Variable(ShadowCloneOrder)", - "!=", - "PrimaryObject.Variable(FramesBetweenShadowClones)" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "ShadowCloneObject", - "" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "-", - "ShadowCloneObject.Variable(FramesBehindPrimary) / ShadowCloneObject.Variable(ShadowCloneOrder)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Don't let counter go negative", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "FrameCounter", - "=", - "0" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change opacity of shadow clone", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "FadeSpeed", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Opacity" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "255-FadeSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Set scale", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "ShrinkSpeed", - "!=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeScaleWidth" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleX()-(ShrinkSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)/100)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeScaleHeight" - }, - "parameters": [ - "ShadowCloneObject", - "=", - "PrimaryObject.ScaleY()-(ShrinkSpeed*ShadowCloneObject.Variable(ShadowCloneOrder)/100)" - ] - } - ] - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update PrimaryObject history", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Clean-up unused history", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataCleaningCounter", - "=", - "PrimaryObject.Variable(MaxFramesBehind)" - ] - } - ] - }, - { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "ObjectVariableChildExists" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory", - "ToString(PrimaryObject.Variable(DataCleaningCounter)+1)" - ] - } - ], - "conditions": [], - "actions": [ - { - "type": { - "value": "ObjectVariableRemoveChild" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory", - "ToString(PrimaryObject.Variable(DataCleaningCounter)+1)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataCleaningCounter", - "+", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reset temp variable for iterating through child objects", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataMoveCounter", - "=", - "PrimaryObject.Variable(MaxFramesBehind)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move position history to the next higher index, starting from the highest number (FramesBehind-1)", - "comment2": "" - }, - { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataMoveCounter", - ">", - "1" - ] - } - ], - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move object history to one higher frame", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].xpos", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].xpos)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].ypos", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].ypos)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].angle", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].angle)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].animation", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].animation)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].frame", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].frame)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].xscale", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].xscale)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].yscale", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].yscale)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].width", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].width)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter))].height", - "=", - "PrimaryObject.Variable(ObjectHistory[ToString(PrimaryObject.Variable(DataMoveCounter)-1)].height)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "DataMoveCounter", - "-", - "1" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Record new current position in index = 1", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.xpos", - "=", - "PrimaryObject.X()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.ypos", - "=", - "PrimaryObject.Y()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.animation", - "=", - "PrimaryObject.Animation()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.frame", - "=", - "PrimaryObject.Sprite()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.angle", - "=", - "PrimaryObject.Angle()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.xscale", - "=", - "PrimaryObject.ScaleX()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.yscale", - "=", - "PrimaryObject.ScaleY()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.width", - "=", - "PrimaryObject.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory.1.height", - "=", - "PrimaryObject.Height()" - ] - } - ] - } - ], - "parameters": [] + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ClonesCount" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ClonesCount", + "group": "Shadow clone emitter configuration", + "name": "SetClonesCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ClonesCount", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the number of frames between 2 clones.", + "fullName": "Frames gap", + "functionType": "ExpressionAndCondition", + "group": "Shadow clone emitter configuration", + "name": "FramesGap", + "sentence": "the frames gap", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FramesGap" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FramesGap", + "group": "Shadow clone emitter configuration", + "name": "SetFramesGap", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FramesGap", + "=", + "Value" + ] } ] } ], - "parameters": [] - } - ], - "parameters": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] + }, { - "description": "Object that shadow clones will follow", - "name": "PrimaryObject", - "supplementaryInformation": "Sprite", - "type": "objectList" + "description": "the first clone opacity (from 0 to 1).", + "fullName": "First clone opacity", + "functionType": "ExpressionAndCondition", + "group": "Shadow clone emitter configuration", + "name": "OpacityStart", + "sentence": "the first clone opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OpacityStart" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Shadows clones will be made of this object (Cannot be the same object used for primary object)", - "name": "ShadowCloneObject", - "supplementaryInformation": "Sprite", - "type": "objectList" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OpacityStart", + "group": "Shadow clone emitter configuration", + "name": "SetOpacityStart", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OpacityStart", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Number of shadow clones (Default: 1)", - "name": "NumberOfShadowClones", - "type": "expression" + "description": "the last clone opacity (from 0 to 1).", + "fullName": "Last clone opacity", + "functionType": "ExpressionAndCondition", + "group": "Shadow clone emitter configuration", + "name": "OpacityEnd", + "sentence": "the last clone opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OpacityEnd" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Number of empty frames between shadow clones (Default: 1)", - "name": "FramesBetweenShadowClones", - "type": "expression" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OpacityEnd", + "group": "Shadow clone emitter configuration", + "name": "SetOpacityEnd", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OpacityEnd", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Fade speed (Range: 0 to 255) (Default: 0)", - "longDescription": "Decrease in opacity for each consecutive shadow clone ", - "name": "FadeSpeed", - "type": "expression" + "description": "the last clone scale (from 0 to 1).", + "fullName": "Last clone scale", + "functionType": "ExpressionAndCondition", + "group": "Shadow clone emitter configuration", + "name": "ScaleEnd", + "sentence": "the last clone scale", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScaleEnd" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Shrink speed (Range: 0 to 100) (Default: 0)", - "longDescription": "Decrease in scale for each consecutive shadow clone ", - "name": "ShrinkSpeed", - "type": "expression" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScaleEnd", + "group": "Shadow clone emitter configuration", + "name": "SetScaleEnd", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ScaleEnd", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Shadow clones will be created on this layer. (Default: \"\") (Base Layer)", - "name": "ShadowCloneLayer", - "type": "layer" + "description": "Delete shadow clone objects that are linked to a primary object.", + "fullName": "Delete shadow clones", + "functionType": "Action", + "name": "DeleteClones", + "sentence": "Delete all _PARAM2_ that are linked to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ShadowClones::DeleteShadowClones" + }, + "parameters": [ + "", + "Object", + "Clone", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShadowClones::ShadowCloneEmitter", + "type": "behavior" + }, + { + "description": "Shadow clone", + "name": "Clone", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "AnimateClones" + }, + { + "functionName": "DeleteClones" + }, + { + "folderName": "Shadow clone emitter configuration", + "children": [ + { + "functionName": "ClonesCount" + }, + { + "functionName": "SetClonesCount" + }, + { + "functionName": "FramesGap" + }, + { + "functionName": "SetFramesGap" + }, + { + "functionName": "OpacityStart" + }, + { + "functionName": "SetOpacityStart" + }, + { + "functionName": "OpacityEnd" + }, + { + "functionName": "SetOpacityEnd" + }, + { + "functionName": "ScaleEnd" + }, + { + "functionName": "SetScaleEnd" + } + ] + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable objects", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "choices": [], + "name": "Scale" }, { - "description": "Z value for created shadow clones", - "name": "ShadowCloneZValue", - "type": "expression" + "value": "", + "type": "Behavior", + "label": "Flippable objects", + "extraInformation": [ + "FlippableCapability::FlippableBehavior" + ], + "choices": [], + "name": "Flippable" }, { - "description": "Match X scale of primary object:", - "name": "MatchScaleX", - "type": "yesorno" + "value": "", + "type": "Behavior", + "label": "Objects with opacity", + "extraInformation": [ + "OpacityCapability::OpacityBehavior" + ], + "choices": [], + "name": "Opacity" }, { - "description": "Match Y scale of primary object:", - "name": "MatchScaleY", - "type": "yesorno" + "value": "", + "type": "Behavior", + "label": "Objects with animations", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "choices": [], + "name": "Animation" }, { - "description": "Match angle of primary object:", - "name": "MatchAngle", - "type": "yesorno" + "value": "5", + "type": "Number", + "label": "Number of clones", + "name": "ClonesCount" }, { - "description": "Match animation of primary object:", - "name": "MatchAnimation", - "type": "yesorno" + "value": "8", + "type": "Number", + "label": "Frames gap", + "name": "FramesGap" }, { - "description": "Match animation frame of primary object:", - "name": "MatchAnimationFrame", - "type": "yesorno" + "value": "0", + "type": "Number", + "label": "Last clone opacity", + "description": "Values from 0 to 1.", + "name": "OpacityEnd" }, { - "description": "Match the vertical flip of primary object:", - "name": "MatchVerticalFlip", - "type": "yesorno" + "value": "1", + "type": "Number", + "label": "Last clone scale", + "description": "Values from 0 to 1.", + "name": "ScaleEnd" }, { - "description": "Match the horizontal flip of primary object:", - "name": "MatchHorizontalFlip", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Delete shadow clone objects that are linked to a primary object.", - "fullName": "Delete shadow clone objects that are linked to a primary object", - "functionType": "Action", - "name": "DeleteShadowClones", - "sentence": "Delete all _PARAM2_ that are linked to _PARAM1_", - "events": [ + "value": "true", + "type": "Boolean", + "label": "Match object X scale", + "advanced": true, + "name": "MatchScaleX" + }, { - "type": "BuiltinCommonInstructions::ForEach", - "object": "ShadowClones", - "conditions": [ - { - "type": { - "value": "LinkedObjects::PickObjectsLinkedTo" - }, - "parameters": [ - "", - "ShadowClones", - "PrimaryObject" - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "ShadowClones", - "" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "ClonesCreated", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "PrimaryObject", - "TotalShadowClones", - "=", - "0" - ] - }, - { - "type": { - "value": "ObjectVariableClearChildren" - }, - "parameters": [ - "PrimaryObject", - "ObjectHistory" - ] - } - ] - } - ], - "parameters": [ + "value": "true", + "type": "Boolean", + "label": "Match object Y scale", + "advanced": true, + "name": "MatchScaleY" + }, { - "description": "Primary object", - "name": "PrimaryObject", - "type": "objectList" + "value": "true", + "type": "Boolean", + "label": "Match object angle", + "advanced": true, + "name": "MatchAngle" }, { - "description": "Shadow clones", - "name": "ShadowClones", - "type": "objectList" + "value": "true", + "type": "Boolean", + "label": "Match object animation", + "advanced": true, + "name": "MatchAnimation" + }, + { + "value": "true", + "type": "Boolean", + "label": "Match object animation", + "advanced": true, + "name": "MatchAnimationFrame" + }, + { + "value": "true", + "type": "Boolean", + "label": "Match object vertical flip", + "advanced": true, + "name": "MatchVerticalFlip" + }, + { + "value": "true", + "type": "Boolean", + "label": "Match object horizontal flip", + "advanced": true, + "name": "MatchHorizontalFlip" + }, + { + "value": "0.5", + "type": "Number", + "label": "First clone opacity", + "description": "Values from 0 to 1.", + "name": "OpacityStart" } ], - "objectGroups": [] + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "Scale" + }, + { + "propertyName": "Flippable" + }, + { + "propertyName": "Opacity" + }, + { + "propertyName": "Animation" + }, + { + "propertyName": "ClonesCount" + }, + { + "propertyName": "FramesGap" + }, + { + "propertyName": "OpacityStart" + }, + { + "propertyName": "OpacityEnd" + }, + { + "propertyName": "ScaleEnd" + }, + { + "propertyName": "MatchScaleX" + }, + { + "propertyName": "MatchScaleY" + }, + { + "propertyName": "MatchAngle" + }, + { + "propertyName": "MatchAnimation" + }, + { + "propertyName": "MatchAnimationFrame" + }, + { + "propertyName": "MatchVerticalFlip" + }, + { + "propertyName": "MatchHorizontalFlip" + } + ] + } } ], - "eventsBasedBehaviors": [], "eventsBasedObjects": [] -} \ No newline at end of file +}