diff --git a/extensions/community/LoadandSave.json b/extensions/community/LoadandSave.json new file mode 100644 index 000000000..97250612c --- /dev/null +++ b/extensions/community/LoadandSave.json @@ -0,0 +1,748 @@ +{ + "author": "", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Load and Save ", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNvbnRlbnQtc2F2ZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNSw5SDVWNUgxNU0xMiwxOUEzLDMgMCAwLDEgOSwxNkEzLDMgMCAwLDEgMTIsMTNBMywzIDAgMCwxIDE1LDE2QTMsMyAwIDAsMSAxMiwxOU0xNywzSDVDMy44OSwzIDMsMy45IDMsNVYxOUEyLDIgMCAwLDAgNSwyMUgxOUEyLDIgMCAwLDAgMjEsMTlWN0wxNywzWiIgLz48L3N2Zz4=", + "name": "LoadandSave", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/ed9dc9aba04820ae44e5adf70bd3b955cd899dec13739488e94ae6ef2b6ef180_content-save.svg", + "shortDescription": "Load and save object or objects variable and position.", + "version": "1.0.0", + "description": "Load and save object oo objects variable and position. This include angle and other parts to the objects. The Object variables array and structure main name must be \"Variables\" for it with not work. And storage must not be group name that is \"Obj\" and storage name that is \"Save\".", + "tags": [ + "Save", + "Load", + "Objects" + ], + "authorIds": [ + "S1Dr159GgRVwFTmtngHmd8MIMUs2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "name": "Array", + "type": "array", + "children": [] + }, + { + "name": "Store", + "type": "string", + "value": "" + }, + { + "name": "J_Array", + "type": "array", + "children": [] + }, + { + "name": "Array_Json", + "type": "string", + "value": "0" + }, + { + "name": "Climb", + "type": "number", + "value": 0 + }, + { + "name": "Number", + "type": "string", + "value": "0" + }, + { + "name": "Array_Num", + "type": "number", + "value": 0 + }, + { + "name": "Load", + "type": "string", + "value": "0" + }, + { + "name": "Json", + "type": "string", + "value": "0" + } + ], + "eventsFunctions": [ + { + "description": "Save a object or objects during a certain time period.", + "fullName": "Save the Object", + "functionType": "Action", + "name": "Save_Object", + "sentence": "save _PARAM1_ on layer _PARAM5_ every _PARAM3_ seconds. The loader that is _PARAM2_. (_PARAM4_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Loader" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "", + "\"Object\"" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareTimer" + }, + "parameters": [ + "", + "\"Object\"", + ">=", + "Time" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "ResetTimer" + }, + "parameters": [ + "", + "\"Object\"" + ] + }, + { + "type": { + "value": "VariableClearChildren" + }, + "parameters": [ + "Array" + ] + } + ], + "events": [ + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Loader", + "Extra" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Loader", + "0", + "0", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Loader" + ] + } + ], + "actions": [ + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.1" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Loader", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DeleteGroupFichier" + }, + "parameters": [ + "\"Save\"", + "\"Obj\"" + ] + }, + { + "type": { + "value": "EcrireFichierTxt" + }, + "parameters": [ + "\"Save\"", + "\"Obj\"", + "Array_Json" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [ + { + "type": { + "value": "SceneVariablePushString" + }, + "parameters": [ + "Array", + "Object.ObjectName()" + ] + }, + { + "type": { + "value": "SceneVariablePushNumber" + }, + "parameters": [ + "Array", + "Object.X()" + ] + }, + { + "type": { + "value": "SceneVariablePushNumber" + }, + "parameters": [ + "Array", + "Object.Y()" + ] + }, + { + "type": { + "value": "SceneVariablePushNumber" + }, + "parameters": [ + "Array", + "Object.Angle()" + ] + }, + { + "type": { + "value": "SceneVariablePushNumber" + }, + "parameters": [ + "Array", + "Object.ZOrder()" + ] + }, + { + "type": { + "value": "SceneVariablePushString" + }, + "parameters": [ + "Array", + "ObjectVarToJSON(Object,Variables)" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Array_Json", + "=", + "ToJSON(Array)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Object", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "VariableClearChildren" + }, + "parameters": [ + "Array" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Array_Json", + "=", + "ToJSON(Array)" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Save Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Loader", + "name": "Loader", + "type": "objectList" + }, + { + "description": "Set time between 0.1 to 1 seconds", + "name": "Time", + "type": "expression" + }, + { + "description": "For Loader", + "name": "Extra", + "supplementaryInformation": "LoadandSave::Loader", + "type": "behavior" + }, + { + "description": "The layer that the object is on", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Load a object or objects during a certain time period.", + "fullName": "Load the Object", + "functionType": "Action", + "name": "Load_Object", + "sentence": "Load _PARAM1_ on the scene", + "events": [ + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ReadStringFromStorage" + }, + "parameters": [ + "\"Save\"", + "\"Obj\"", + "", + "Load" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "JSONToVariableStructure2" + }, + "parameters": [ + "VariableString(Load)", + "J_Array" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Object_1", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.01" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object_1", + "=", + "0" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object_1", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Object_1", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Climb", + "=", + "0" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "VariableChildCount(J_Array)/6", + "conditions": [], + "actions": [], + "events": [ + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "Number", + "=", + "J_Array[Climb]" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "Number", + "!=", + "Object_1.ObjectName()" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Climb", + "+", + "6" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "Number", + "=", + "Object_1.ObjectName()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Object_1", + "1", + "1", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object_1", + "=", + "1" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object_1", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreAutourPos" + }, + "parameters": [ + "Object_1", + "J_Array[Climb+1]", + "J_Array[Climb+2]", + "0", + "J_Array[Climb+3]" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object_1", + "=", + "J_Array[Climb+3]" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Object_1", + "=", + "J_Array[Climb + 4]" + ] + }, + { + "type": { + "value": "JSONToObjectVariableStructure" + }, + "parameters": [ + "J_Array[Climb+5]", + "Object_1", + "Variables" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Climb", + "+", + "6" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object", + "name": "Object_1", + "type": "objectListOrEmptyIfJustDeclared" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Save the object you want.", + "fullName": "Save", + "name": "Save", + "objectType": "", + "eventsFunctions": [], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + }, + { + "description": "The objects that is used for saving and loading objects of choice.", + "fullName": "Loader", + "name": "Loader", + "objectType": "", + "eventsFunctions": [], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] +} \ No newline at end of file