diff --git a/extensions/community/SakuraDialogSystem.json b/extensions/community/SakuraDialogSystem.json new file mode 100644 index 000000000..95675908b --- /dev/null +++ b/extensions/community/SakuraDialogSystem.json @@ -0,0 +1,4069 @@ +{ + "author": "", + "category": "Game mechanic", + "dimension": "", + "extensionNamespace": "", + "fullName": "Sakura Dialog System", + "gdevelopVersion": "", + "helpPath": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNvbW1lbnQtdGV4dCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDIyQTEsMSAwIDAsMSA4LDIxVjE4SDRBMiwyIDAgMCwxIDIsMTZWNEMyLDIuODkgMi45LDIgNCwySDIwQTIsMiAwIDAsMSAyMiw0VjE2QTIsMiAwIDAsMSAyMCwxOEgxMy45TDEwLjIsMjEuNzFDMTAsMjEuOSA5Ljc1LDIyIDkuNSwyMlYyMkg5TTUsNVY3SDE5VjVINU01LDlWMTFIMTNWOUg1TTUsMTNWMTVIMTVWMTNINVoiIC8+PC9zdmc+", + "name": "SakuraDialogSystem", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/17eca6f19dabe086a3da00dd623928f85e3f4b6749a98430b5da2bfe9506d1bb_comment-text.svg", + "shortDescription": "A dialogue system built from scratch that aims to be more modern.", + "version": "0.1.0", + "description": [ + "A dialog system built from scratch that aims to be more modern and make creating dialogs in GDevelop even easier.", + "", + "This extension makes it easier to create a dialogue system for a game made in GDevelop.", + "", + "*You can load JSON files created with Sakura Script into Visual Studio Code.*", + "", + "For more information, [click here](https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD)" + ], + "tags": [ + "dialogue tree", + "dialogue system", + "visual novel", + "narrative" + ], + "authorIds": [ + "bLei6mp8FMXlGD75f0bd33VOBoL2" + ], + "dependencies": [], + "globalVariables": [ + { + "name": "_dialogIsRunning", + "type": "boolean", + "value": false + }, + { + "folded": true, + "name": "_currentCommand", + "type": "structure", + "children": [ + { + "name": "lastName", + "type": "string", + "value": "0" + }, + { + "folded": true, + "name": "lastParameters", + "type": "array", + "children": [] + }, + { + "name": "parameters", + "type": "array", + "children": [] + }, + { + "name": "useConditional", + "type": "boolean", + "value": false + } + ] + }, + { + "folded": true, + "name": "_options", + "type": "structure", + "children": [ + { + "name": "canSelect", + "type": "boolean", + "value": false + }, + { + "name": "count", + "type": "number", + "value": 0 + } + ] + }, + { + "folded": true, + "name": "_dialogSettings", + "type": "structure", + "children": [ + { + "name": "_LoopArray", + "type": "structure", + "children": [ + { + "name": "IndexLoop", + "type": "array", + "children": [ + { + "type": "number", + "value": 0 + } + ] + }, + { + "folded": true, + "name": "IndexLoopSize", + "type": "array", + "children": [ + { + "type": "number", + "value": 0 + } + ] + }, + { + "name": "currentIndexLoop", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "_currentBranch", + "type": "string", + "value": "Start" + }, + { + "folded": true, + "name": "_currentLoop", + "type": "array", + "children": [] + }, + { + "folded": true, + "name": "_dialogStruct", + "type": "structure", + "children": [] + }, + { + "name": "_lastDialog", + "type": "string", + "value": "0" + }, + { + "name": "_lastLineType", + "type": "string", + "value": "0" + }, + { + "folded": true, + "name": "_lastLoop", + "type": "array", + "children": [ + { + "type": "structure", + "children": [] + } + ] + }, + { + "name": "_lastName", + "type": "string", + "value": "0" + } + ] + }, + { + "name": "_nextDialog", + "type": "boolean", + "value": false + }, + { + "name": "_returnDialog", + "type": "boolean", + "value": false + }, + { + "name": "_isChangeBranch", + "type": "boolean", + "value": false + } + ], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Load the dialog file in JSON format created with Sakura Script from Visual Studio Code.\n\nBy default, the \"Start\" branch is always loaded unless another branch is specified.", + "fullName": "Load dialog file ", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#load-dialog-file", + "name": "LoadJSON", + "sentence": "Load the _PARAM1_ dialog file", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Yarn me parece tan malo, que preferi crear mi sistema de dialogo desde cero, para tener el control total y que los errores que surgan, poder tener como resolverlos" + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// Referenciar el juego", + "const game = runtimeScene.getGame();", + "// Cargar variable (que normalmente siempre está vacia)", + "const dialog = game.getVariablesForExtension(\"SakuraDialogSystem\").get(\"_dialogSettings\").getChild(\"_dialogStruct\");", + "// Cargar JSON y asignarselo a la variable", + "dialog.fromJSObject(game.getJsonManager().getLoadedJson(eventsFunctionContext.getArgument(\"File\")));", + "", + "/*", + "// Comprobar que el JSON se este cargando", + "const dialogJS = JSON.stringify(dialog);", + "console.log(\"dialog JS =\" + dialogJS)", + "*/" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Iniciar la rama \"Start\" (por defecto), esto le da el valor a _lastSize y evita que GetCurrenLine tenga que estas calculando constantemente el tamaño de la rama actual" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._currentLoop" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._dialogStruct[\"labels\"][_dialogSettings._currentBranch]", + "_dialogSettings._currentLoop", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize[0]", + "=", + "VariableChildCount(_dialogSettings._currentLoop) - 1" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"LoadJSON - _dialogSettings._LoopArray.IndexLoopSize[0] = \" + _dialogSettings._LoopArray.IndexLoopSize[0]", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Archivo de dialogo", + "name": "File", + "type": "jsonResource" + } + ], + "objectGroups": [] + }, + { + "description": "Get dialogue line, if after advancing to the end there is nothing more to do (be it a command to go to another branch), the dialogue will end.", + "fullName": "Get dialogue line", + "functionType": "StringExpression", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#get-dialogue-line", + "name": "CurrentLine", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "LineType" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "_LoopArray.IndexLoop[_LoopArray.currentIndexLoop] es lo que maneja los bloques de las condicionales y las opciones\n\nEl _LoopArray.IndexLoop[0], seria el bloque o loop principal de ejecución de los dialogos\n\n_LoopArray.IndexLoop[1] podria ser un bloque de option o conditional\n\nPuede sumarse hasta que no pueda más, pero _LoopArray.currentIndexLoop determina el loop actual, el terminar un loop, hace regresar al anterior, hasta que se quede en solo en el loop principal" + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"GetCurrentLine - \" + ToJSON(_dialogSettings._dialogStruct)", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"GetCurrentLine - _dialogSettings._currentLoop size = \" + ToString(VariableChildCount(_dialogSettings._currentLoop))", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Avance o retroceso de dialogo" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"]" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"dialogue\"" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._lastDialog", + "=", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"]" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"GetCurrentLine - _index = \" + _dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "\"info\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Cuando la linea no es de tipo dialogo, evitar que se devuelva un 0 o undefined" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "!=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "_dialogSettings._lastDialog" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "No creo que esto sea realmente necesario" + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"command\"" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"pass\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"NULL\"" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"END\"" + ] + } + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Go to the next line of dialogue.", + "fullName": "Go to the next line", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#go-to-next-line", + "name": "NextDialog", + "sentence": "Go to the next line of dialogue", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Ir a la siguiente linea de dialogo" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "True", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "!=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get the line type\n\nIt can be \"dialogue\", \"command\", \"option\", or \"conditional\".", + "fullName": "Get line type", + "functionType": "Condition", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#get-line-type", + "name": "LineType", + "sentence": "Line type _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SakuraDialogSystem::IsDialogRunning" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "LineType" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Tipo de linea", + "name": "LineType", + "supplementaryInformation": "[\"dialogue\",\"command\",\"options\",\"conditional\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "A command is a special line of code used to trigger an action within the game.\n\nFor example, changing a background, moving a character, etc.", + "fullName": "Command called", + "functionType": "Condition", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#command-called", + "name": "CallCommand", + "sentence": "The command is called _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "LineType" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Para evitar problemas, no es posible llamar a los comandos predeterminados como propios" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"command\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Comprobar que la linea del comando, concuerde con el parametro" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "CommandName", + "!=", + "\"jump\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "CommandName", + "!=", + "\"end\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "CommandName", + "!=", + "\"set_variable\"" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "CommandName", + "=", + "_currentCommand.lastName" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_currentCommand.useConditional", + "True", + "" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"command\"" + ] + }, + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"current Command = \" + _dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"] ", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Al almacenarlos en _currentCommand.parameters, guardar los comandos en la en la variable _currentCommand.lastParameters, esto para evitar que si el indice actual es 2, pero avanza ahora mismo al 3, la expresión GetCommandParameter pueda obtener los parametros del indice 2" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "VariableChildCount(_currentCommand.parameters)", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "VariableChildCount(_currentCommand.parameters)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_currentCommand.lastParameters[param_index]", + "=", + "_currentCommand.parameters[param_index]" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "param_index", + "+", + "1" + ] + } + ], + "variables": [ + { + "name": "param_index", + "type": "number", + "value": 0 + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"lastParameters = \" + ToJSON(_currentCommand.lastParameters)", + "\"info\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_currentCommand.parameters" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Command name", + "name": "CommandName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Copiar todos los elementos de un array en otro array.", + "fullName": "Copiar un array en otro array", + "functionType": "Action", + "name": "CopyArrayInArray", + "private": true, + "sentence": "Copiar todos los elementos del array _PARAM1_ en _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.Variable} */", + "const arrayO = eventsFunctionContext.getArgument(\"ArrayO\");", + "/** @type {gdjs.Variable} */", + "const arrayD = eventsFunctionContext.getArgument(\"ArrayD\");", + "", + "// Copiar el array de origen en el array destino", + "for (const value of arrayO.getAllChildrenArray())", + " arrayD.pushVariableCopy(value);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Array de origen", + "name": "ArrayO", + "type": "variable" + }, + { + "description": "Array de destino", + "name": "ArrayD", + "type": "variable" + } + ], + "objectGroups": [] + }, + { + "description": "Go to another dialogue branch in your file.", + "fullName": "Go to branch", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#go-to-branch", + "name": "SetBranch", + "sentence": "Go to branch _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Cambiar la rama de dialogo actual por una nueva" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SakuraDialogSystem::IsDialogRunning" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"\"" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._currentBranch", + "=", + "Branch" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._lastLoop" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._dialogStruct[\"labels\"][_dialogSettings._currentBranch]", + "TMPLoop", + "" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._currentLoop" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.currentIndexLoop", + "=", + "0" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "TMPLoop", + "_dialogSettings._currentLoop", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize[0]", + "=", + "VariableChildCount(_dialogSettings._currentLoop) - 1" + ] + } + ], + "variables": [ + { + "name": "TMPLoop", + "type": "array", + "children": [] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "False", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"SetBranch - \" + _dialogSettings._currentBranch + \" - _dialogSettings._LoopArray.IndexLoopSize[0] = \" + _dialogSettings._LoopArray.IndexLoopSize[0]", + "\"info\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Rama", + "name": "Branch", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Get the value of a command parameter.", + "fullName": "Get command parameter", + "functionType": "StringExpression", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#get-command-parameter", + "name": "CommandParameter", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "LineType" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Devolver los valores de los parametros guardados durante la linea de comando anterior\n\nSi el indice donde se guardo es 2, pero justo al llamar a CallCommand, paso a ser 3, esto permite llamar los comandos que estan en el indice 2" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "VariableChildCount(_currentCommand.lastParameters)", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Solo permitir devolver el valor del indice, siempre y cuando, el valor del mismo, no supere el tamaño del Array de los parametros" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "ParamIndex", + "<=", + "VariableChildCount(_currentCommand.lastParameters) - 1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "_currentCommand.lastParameters[ParamIndex]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "ParamIndex", + ">", + "VariableChildCount(_currentCommand.lastParameters) - 1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"0\"" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"No existe el número del parametro \" + ParamIndex + \" en el comando\"", + "\"error\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Si no hay parametros, devolver solo " + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "VariableChildCount(_currentCommand.lastParameters)", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"\"" + ] + } + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Parameter index", + "name": "ParamIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Stop the execution of the dialogue.", + "fullName": "Stop dialogue", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#stop-dialogue", + "name": "StopDialog", + "sentence": "Stop the execution of the dialogue", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "False", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "The dialogue is running.", + "fullName": "Dialogue running", + "functionType": "Condition", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#dialog-is-running", + "name": "IsDialogRunning", + "sentence": "Dialogue is running", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Obtain the one who is currently a speaker.", + "fullName": "Get who", + "functionType": "StringExpression", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#get-who", + "name": "Who", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Obtener el que habla actualmente, puede servir para cambiar los nombres" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"who\"]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "!=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"\"" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "LineType" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "<=", + "_dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Esto evita que se bloquee en la linea de comandos y pass" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ir a la siguiente linea de dialogo" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_nextDialog", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_returnDialog", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "-", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Si no se usa la condición CallCommand, saltar sin tomar en cuenta los comandos" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"command\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_currentCommand.lastName", + "=", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"]" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"command\"" + ] + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Comandos predeterminados (No necesitan a \"CallCommand\")", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Detener la ejecución del dialogo" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"]", + "=", + "\"end\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SakuraDialogSystem::StopDialog" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "False", + "" + ] + }, + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"]", + "=", + "\"jump\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SakuraDialogSystem::SetBranch" + }, + "parameters": [ + "", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"][0]", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"0 SI\"", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"]", + "=", + "\"set_variable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SakuraDialogSystem::SetVariable" + }, + "parameters": [ + "", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"][0]", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"][1]", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Si hay parametros, entonces almacenarlos primero en _currentCommand.parameters" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"])", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"cantidad de parametros de \" + _dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"] + \" = \" + ToString(VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"]))", + "\"info\"", + "" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"])", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_currentCommand.parameters[param_index]", + "=", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"][param_index]" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"current Param = \" + _dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"][param_index]", + "\"info\"", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"current Param index = \" + param_index", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "param_index", + "+", + "1" + ] + } + ] + } + ], + "variables": [ + { + "name": "param_index", + "type": "number", + "value": 0 + } + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"command name = \" + _dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"line\"] + \" - params = \" + ToJSON(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"params\"])", + "\"info\"", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"nextDialog = \" + _nextDialog", + "\"info\"", + "" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "False", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "True", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"_currentCommand.name = \" + ToJSON(_currentCommand.name)", + "\"info\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "No contar las lineas pass" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"pass\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "_dialogSettings._lastLineType", + "=", + "\"pass\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_isChangeBranch", + "False", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "True", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_returnDialog", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "True", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"options\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_options.canSelect", + "True", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"choices size = \" + ToString(VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"]))", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Guardar el valor del tamaño de la linea de option actual" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_options.count", + "=", + "VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"])" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Linea condicional, si las condiciones\n\nEste bloque tiene como objetivo, dar un dinamismo a la hora de que se cumplan ciertas cosas en tu juego\n\nComo reproducir un camino diferente si la condicion es verdadera (if), si se cumple de otra forma (else if) y si no se cumplio ninguna de las formas (else)\n\nHay que decir, que else if puede usarse varias veces, por ende, hay que saber como calcuclar cuantas lineas \"else if\" habra" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"conditional\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "conditionContent almacena el valor de cada llave condicional, por ejemplo if\n\nSe ejecuta siempre y cuando, ni if, o los else if no pasen a stopRepeat a verdadero\n\nSi nunca if o else if, pasaron a stopRepeat a verdadero, entonces se tomara a else como el camino posible" + }, + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"conditions\"]", + "valueIteratorVariableName": "conditionContent", + "keyIteratorVariableName": "conditionName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "stopRepeat", + "=", + "" + ] + } + ], + "actions": [], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"000 - \" + conditionName", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "conditionName", + "!=", + "\"else\"" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::ConditionalParser" + }, + "parameters": [ + "", + "conditionContent", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "stopRepeat", + "True", + "" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "lastConditionName", + "=", + "conditionName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "conditionName", + "=", + "\"else\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "lastConditionName", + "=", + "conditionName" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "stopRepeat", + "True", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Si solo hay un if, y jamás fue verdadero y mucho menos hay un else, entonces saltar la linea conditional sin entrar en el block" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "conditionName", + "=", + "\"if\"" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "stopRepeat", + "=", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "True", + "" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Avanza\"", + "\"info\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Entrar en el loop de block de la condición que se haya cumplido" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "stopRepeat", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Se detuvo el bucle en el \" + lastConditionName", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Guardar el loop actual para poder regresar al loop anterior cuando sea necesario" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._lastLoop[_dialogSettings._LoopArray.currentIndexLoop]" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._currentLoop", + "_dialogSettings._lastLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Limpiar el loop actual, avanzar la variable _currentIndexloop para poder ir correctamente al nuevo loop" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"conditions\"][lastConditionName][\"block\"]", + "TMPLoop", + "" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._currentLoop" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "TMPLoop", + "_dialogSettings._currentLoop", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.currentIndexLoop", + "+", + "1" + ] + }, + { + "type": { + "value": "PushNumber" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]", + "=", + "VariableChildCount(_dialogSettings._currentLoop) - 1" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "stopRepeat", + "False", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "conditionContent", + "type": "structure", + "children": [] + }, + { + "name": "stopRepeat", + "type": "boolean", + "value": false + }, + { + "name": "conditionName", + "type": "string", + "value": "0" + }, + { + "name": "TMPLoop", + "type": "array", + "children": [] + }, + { + "name": "lastConditionName", + "type": "string", + "value": "0" + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Loop principal, si el indice, supera al tamaño del loop, entonces finalizar el dialogo" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "_dialogSettings._LoopArray.currentIndexLoop", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"_dialogSettings._LoopArray.IndexLoop[0] = \" + _dialogSettings._LoopArray.IndexLoop[0] + \" - _dialogSettings._LoopArray.IndexLoopSize[0]\" + _dialogSettings._LoopArray.IndexLoopSize[0]", + "\"info\"", + "" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop[0]", + ">", + "_dialogSettings._LoopArray.IndexLoopSize[0] - 1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "False", + "" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Dialogo finalizado\"", + "\"warning\"", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Si hay más de un loop y ya se finalizo, entonces regresar al loop anterior " + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "_dialogSettings._LoopArray.currentIndexLoop", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"_dialogSettings._LoopArray.currentIndexLoop = \" + _dialogSettings._LoopArray.currentIndexLoop", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"El loop actual es mayor que 0\"", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Si el tamaño del indice, es mayor al tamaño del loop actual, entonces regresar al loop anterior (eliminando antes el loop actual)\n\nSi no hay más loops, se regresara al loop principal guardado en _lastLoop[0]" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]", + ">", + "_dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + }, + { + "type": { + "value": "RemoveVariableAt" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop", + "VariableChildCount(_dialogSettings._LoopArray.IndexLoop) - 1" + ] + }, + { + "type": { + "value": "RemoveVariableAt" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize", + "VariableChildCount(_dialogSettings._LoopArray.IndexLoop) - 1" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.currentIndexLoop", + "-", + "1" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._currentLoop" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._lastLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "_dialogSettings._currentLoop", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]", + "=", + "VariableChildCount(_dialogSettings._currentLoop) - 1" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "+", + "1" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\" 000 - _dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop] = \" + _dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\" loop to 0 - _dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop] = \" + _dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\" 0 _index = \" + _dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop] + \" - currentLine = \" + ToJSON(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]])", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"El loop actual es = \" + _dialogSettings._LoopArray.currentIndexLoop + \" \" + ToJSON(_dialogSettings._currentLoop)", + "\"info\"", + "" + ] + } + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "ToJSON(_dialogSettings._LoopArray.IndexLoop) + \" currentIndexLoop = \" + _dialogSettings._LoopArray.currentIndexLoop", + "\"info\"", + "" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the number of options.", + "fullName": "Get options number", + "functionType": "Expression", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#get-options-number", + "name": "OptionsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"options\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Retornar el número de cantidad de la opción actual" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"])", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "_options.count" + ] + } + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the name of an option using its index.", + "fullName": "Get option name", + "functionType": "StringExpression", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#get-option-name", + "name": "OptionName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"options\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Retornar el nombre de la opción actual (para usarlo en botones)" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"])", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"][OptionIndex][\"text\"]" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"option Name = \" + _currentLoop[_LoopArray.IndexLoop[_LoopArray.currentIndexLoop]][\"choices\"][OptionIndex][\"text\"]", + "\"info\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "OptionIndex", + ">", + "VariableChildCount(_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"]) - 1" + ] + } + ], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"No existe la opción con el número \" + OptionIndex", + "\"error\"", + "" + ] + } + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Option index name", + "name": "OptionIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Confirm option selection using the index of the same.", + "fullName": "Confirm option selection ", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#confirm-option-selection", + "name": "ConfirmSelection", + "sentence": "Confirm option _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"options\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Guardar el loop actual para poder regresar al loop anterior cuando sea necesario" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._lastLoop[_dialogSettings._LoopArray.currentIndexLoop]" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._currentLoop", + "_dialogSettings._lastLoop[_dialogSettings._LoopArray.currentIndexLoop]", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Limpiar el loop actual, avanzar la variable _currentIndexloop para poder ir correctamente al nuevo loop" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"choices\"][OptionIndex][\"block\"]", + "TMPLoop", + "" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "_dialogSettings._currentLoop" + ] + }, + { + "type": { + "value": "SakuraDialogSystem::CopyArrayInArray" + }, + "parameters": [ + "", + "TMPLoop", + "_dialogSettings._currentLoop", + "" + ] + }, + { + "type": { + "value": "PushNumber" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoop", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.currentIndexLoop", + "+", + "1" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "_dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]", + "=", + "VariableChildCount(_dialogSettings._currentLoop) - 1" + ] + } + ] + } + ], + "variables": [ + { + "name": "TMPLoop", + "type": "array", + "children": [] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"ConfirmSelection - _dialogSettings._lastLoop \" + ToJSON(_dialogSettings._lastLoop)", + "\"info\"", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"ConfirmSelection - _dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop] = \" + _dialogSettings._LoopArray.IndexLoopSize[_dialogSettings._LoopArray.currentIndexLoop]", + "\"info\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Indice de opción", + "name": "OptionIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Evaluar la condición del tipo de linea \"conditional\".\n\nDevolvera un booleano si la condicion if o else if, es verdadera, si no se cumple ninguna, se regresa false y por ende, se ejecuta el bloque else.", + "fullName": "Se cumple la condición en la linea \"conditional\"", + "functionType": "Condition", + "name": "ConditionalParser", + "private": true, + "sentence": "Evaluar la condicional contenida en _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"conditional\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// Obtener variable con el contenido de la condición\r", + "const variable = eventsFunctionContext.getArgument(\"ConditionVar\");\r", + "\r", + "// Referenciar escena actual y juego global\r", + "const scene = runtimeScene.getScene().getVariables();\r", + "const game = runtimeScene.getGame().getVariables();\r", + "\r", + "// Analizar la condición y regresar booleano si se cumple o no\r", + "function conditionParser(content){\r", + " // () Posición de nombre de la variable 1, operador 2 y valor a comparar 3\r", + " const regex = /(\\w+)\\s*(==|!=|>=|<=|>|<)\\s*(.+)/;\r", + "\r", + " // obtener la condición como una cadena\r", + " let conditionStr = content.getChild(\"condition\").getAsString();\r", + "\r", + " // Obtener valores de la cadena de condición\r", + " const varName = conditionStr.match(regex)[1]; // Variable de comparación\r", + " const operator = conditionStr.match(regex)[2]; // operador usado\r", + " /** @type {String}**/\r", + " const toComp = conditionStr.match(regex)[3].trim() // Valor a comparar\r", + "\r", + " // Obtener variable de escena\r", + " let sceneVar = scene.get(varName);\r", + "\r", + " // Si la variable no existe como variable de escena\r", + " // Ir por la variable global\r", + " if(!scene.hasVariable(sceneVar)){\r", + " sceneVar = game.get(varName);\r", + " //console.log(\"LOL\");\r", + " }\r", + " // Obtener el tipo de variable a comparar\r", + " let varComp = sceneVar.getType() == \"number\" ? sceneVar.getAsNumber() : sceneVar.getAsString();\r", + " // Variable de comparación\r", + " let valueToComp \r", + "\r", + " // Comprobar que el valor sea un numero, si no, es una cadena\r", + " let regNum = /^-?\\d+(\\.\\d+)?$/;\r", + " valueToComp = regNum.test(toComp) && sceneVar.getType() == \"number\" ? parseFloat(toComp) : toComp.replace(/['\"]+/g, '');\r", + "\r", + " // Comprobar si valueToComp es una cadena y por ende puede ser el nombre de una variable de escena o global\r", + " // Si no, entonces simplemente comparar el valor si es una cadena\r", + " if(typeof valueToComp === \"string\"){\r", + " let isValueVar = valueToComp;\r", + " let scene_game = null;\r", + " // Comprobar que exista la variable en la escena\r", + " if(scene.hasVariable(scene.get(isValueVar))){\r", + " scene_game = scene;\r", + " }\r", + " // Comprobar que exista la variable global\r", + " else if(game.hasVariable(scene.get(isValueVar))){\r", + " scene_game = game;\r", + " }\r", + " // Scene_game no es nulo, por ende si existe la variable en scene o game\r", + " if(scene_game != null){\r", + " // Comprobar la existencia de la variable sea en game o scene\r", + " if(scene_game.hasVariable(scene_game.get(isValueVar))){\r", + " // Comprobar el tipo de la variable\r", + " valueToComp = scene_game.get(isValueVar).getType() == \"number\" ? scene_game.get(isValueVar).getAsNumber() : scene_game.get(isValueVar).getAsString();\r", + " }\r", + " }\r", + " } \r", + "\r", + " // Comprobar el tipo de operador usado\r", + " switch(operator){\r", + " // Devolver la comparativa entre\r", + " case \"==\": return varComp == valueToComp;\r", + " case \"!=\": return varComp != valueToComp;\r", + " case \">\": return varComp > valueToComp;\r", + " case \"<\": return varComp < valueToComp;\r", + " case \">=\": return varComp >= valueToComp;\r", + " case \"<=\": return varComp <= valueToComp;\r", + " }\r", + "}\r", + "\r", + "// Devolver el valor del analisis\r", + "eventsFunctionContext.returnValue = conditionParser(variable);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ] + } + ], + "parameters": [ + { + "description": "Variable donde esta la condicional", + "name": "ConditionVar", + "type": "variable" + } + ], + "objectGroups": [] + }, + { + "description": "Regresar a la linea de dialogo anterior\n\n(Por ahora está en construcción).", + "fullName": "Regresar a la linea anterior", + "functionType": "Action", + "name": "ReturnDialog", + "private": true, + "sentence": "Regresar al dialogo anterior", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Regresar a la linea de dialogo anterior" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "_dialogSettings._currentLoop[_dialogSettings._LoopArray.IndexLoop[_dialogSettings._LoopArray.currentIndexLoop]][\"type\"]", + "=", + "\"dialogue\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_returnDialog", + "True", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "_nextDialog", + "False", + "" + ] + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Save the dialog position in a variable.\n\nNote: This does not save your characters' positions (you'll need to do that manually) or previously saved commands.", + "fullName": "Save State", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#save-state", + "name": "SaveState", + "sentence": "Save state in the variable _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Guardar estado de dialogo, incluyendo comandos, absolutamente todo de la variable _dialogSettings" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "CopyVariableToArgument2" + }, + "parameters": [ + "\"VarToSave\"", + "_dialogSettings" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Variable de estructura ", + "name": "VarToSave", + "type": "variable" + } + ], + "objectGroups": [] + }, + { + "description": "Load dialog position from a variable.\n\nNote: This action currently does not take into account changes to the dialog file (e.g., you changed or deleted a line of dialogue).", + "fullName": "Load State", + "functionType": "Action", + "helpUrl": "https://github.com/QuetzalcoutlDev/SakuraDialogSystemGD/blob/master/docs/README.md#load-state", + "name": "LoadState", + "sentence": "Load state from the variable _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Cargar estado de dialogo, esto regresa a la posición anterior del dialogo" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "_dialogIsRunning", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "CopyArgumentToVariable2" + }, + "parameters": [ + "\"VarToLoad\"", + "_dialogSettings" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Variable de estructura ", + "name": "VarToLoad", + "type": "variable" + } + ], + "objectGroups": [] + }, + { + "description": "Cambiar valor de variable.", + "fullName": "Cambiar valor de variable", + "functionType": "Action", + "name": "SetVariable", + "private": true, + "sentence": "Cambiar valor de variable _PARAM1_ por _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Cambiar valor de variable" + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// Obtener nombre de variable y nuevo valor", + "const varName = eventsFunctionContext.getArgument(\"VarName\");", + "const newValue = eventsFunctionContext.getArgument(\"NewValue\");", + "", + "// Referenciar escena actual y juego global", + "const scene = runtimeScene.getScene().getVariables();", + "const game = runtimeScene.getGame().getVariables();", + "", + "// Obtener variable de escena", + "let sceneVar = scene.get(varName);", + "", + "// Si la variable no existe como variable de escena", + "// Ir por la variable global", + "if(!scene.hasVariable(sceneVar)){", + " console.warn(\"The variable\" + varName + \"does not exist\");", + "", + " sceneVar = game.get(varName);", + "", + " if(!game.hasVariable(sceneVar)){", + " console.warn(\"The variable\" + varName + \"does not exist\");", + " }", + "}", + "", + "// Comprobar que el valor sea un numero, si no, es una cadena", + "let regNum = /^-?\\d+(\\.\\d+)?$/;", + "", + "// Si es un número, entonces cambiar el valor como número", + "if(regNum.test(newValue)){", + " sceneVar.setNumber(parseFloat(newValue));", + "}", + "// Si no, es una cadena", + "else{", + " sceneVar.setString(newValue);", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Nombre de la variable", + "name": "VarName", + "type": "string" + }, + { + "description": "Nuevo valor", + "name": "NewValue", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "LoadJSON" + }, + { + "functionName": "SetBranch" + }, + { + "functionName": "CurrentLine" + }, + { + "functionName": "OptionsCount" + }, + { + "functionName": "OptionName" + }, + { + "functionName": "onScenePostEvents" + }, + { + "functionName": "ConfirmSelection" + }, + { + "functionName": "CallCommand" + }, + { + "functionName": "CommandParameter" + }, + { + "functionName": "Who" + }, + { + "functionName": "NextDialog" + }, + { + "functionName": "ReturnDialog" + }, + { + "functionName": "LineType" + }, + { + "functionName": "IsDialogRunning" + }, + { + "functionName": "StopDialog" + }, + { + "functionName": "CopyArrayInArray" + }, + { + "functionName": "ConditionalParser" + }, + { + "functionName": "SaveState" + }, + { + "functionName": "LoadState" + }, + { + "functionName": "SetVariable" + } + ] + }, + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] +}