diff --git a/extensions/community/RandomFloorPlan.json b/extensions/community/RandomFloorPlan.json new file mode 100644 index 000000000..83e95157c --- /dev/null +++ b/extensions/community/RandomFloorPlan.json @@ -0,0 +1,9517 @@ +{ + "author": "", + "category": "General", + "dimension": "2D", + "extensionNamespace": "", + "fullName": "Random floor plan", + "gdevelopVersion": "", + "helpPath": "https://github.com/henspace/random-floor-plan-extension", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW9mZmljZS1idWlsZGluZy1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5IDNWMjFIMTNWMTcuNUgxMVYyMUg1VjNIMTlNMTUgN0gxN1Y1SDE1VjdNMTEgN0gxM1Y1SDExVjdNNyA3SDlWNUg3VjdNMTUgMTFIMTdWOUgxNVYxMU0xMSAxMUgxM1Y5SDExVjExTTcgMTFIOVY5SDdWMTFNMTUgMTVIMTdWMTNIMTVWMTVNMTEgMTVIMTNWMTNIMTFWMTVNNyAxNUg5VjEzSDdWMTVNMTUgMTlIMTdWMTdIMTVWMTlNNyAxOUg5VjE3SDdWMTlNMjEgMUgzVjIzSDIxVjFaIiAvPjwvc3ZnPg==", + "name": "RandomFloorPlan", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/243510628c7bb9f769196c1b45280e8198ad208644f58d7aedfe4bf8ed778c70_office-building-outline.svg", + "shortDescription": "Random floor plan creation using an internal Tilemap object.", + "version": "1.0.1", + "description": [ + "This extension allows a random floor plan to be created from a `Tilemap` object. The floor plan is formed from", + "interconnected rectangular chambers and is designed to fit within the area of the original tile map painted in the", + "scene. A number of doors can be added around the perimeter of the floor plan. The extension may be useful for Rogue", + "type dungeons. ", + "", + "The extension includes four behaviors:", + "", + "* `FloorPlanBuilder`: this is the core behavior which is added to a `Tilemap` object. It is used to generate the floor", + "plan and facilitates the placement of additional sprites on the floor tiles within the floor plan.", + "* `FloorPlanActor`: added to sprites to allow them to be easily manipulated to enter and exit the floor plan.", + "* `FloorPlanDoor`: is added to sprites to allow them to be overlaid over the floor plan to act as doors into and out", + "of the floor plan. Although doors can be painted onto the floor plan using the tile map tiles, this behavior allows the", + "doors to be animated and facilitates collision detection.", + "* `CacheableObject`: added to objects to allow their positions to be easily saved and restored.", + "", + "It is possible to save the floor plan to a JSON string for subsequent restoration. This could be used to allow a player", + "to return to a previous room. However, any additional sprites added to the floor plan, such as furniture, artefacts or", + "enemies, would need to be saved and restored by the main game and are not the responsibility of the extension. The `CacheableObject` behavior is specifically designed to facilitate the restoration of such objects.", + "", + "The basic use is as follows:", + "", + "* Create a `Tilemap` object.", + "* Add the `Floor Plan Builder` behavior to the `Tilemap`.", + "* Edit the behavior's `Tile Mapping` property to map the nineteen tile types to the appropriate tile ids of the tile map's atlas.", + "* In the scene, paint any tile you like using the tilemap painter. This merely defines the area available for the randomly create floor plan.", + "* In the events, call `BuildRandomPlan` for the `Tilemap` object.", + "", + "In more complex uses, you might want to overlay animated sprites over the floor map's doors. The `FloorPlanDoor` behavior can facilitate this.", + "" + ], + "tags": [ + "tile map", + "random", + "rogue", + "dungeon" + ], + "authorIds": [ + "tC3vZi9LHJR1GNJPIdrawV82a8N2" + ], + "dependencies": [], + "globalVariables": [ + { + "name": "LogMessageGroup", + "type": "string", + "value": "__RandomFloorPlanExtension__" + }, + { + "name": "MoveThroughDoorTweenId", + "type": "string", + "value": "__RandomFloorPlanExension_MoveThroughDoor" + }, + { + "name": "FadeOutTweenId", + "type": "string", + "value": "__RandomFloorPlanExension_FadeOut" + }, + { + "name": "FadeInTweenId", + "type": "string", + "value": "__RandomFloorPlanExension_FAdeIn" + } + ], + "sceneVariables": [ + { + "name": "Blueprint2D", + "type": "array", + "children": [] + }, + { + "folded": true, + "name": "TileTypeSymbols", + "type": "structure", + "children": [ + { + "name": "DoorBottom", + "type": "string", + "value": "^" + }, + { + "name": "DoorLeft", + "type": "string", + "value": ">" + }, + { + "name": "DoorRight", + "type": "string", + "value": "<" + }, + { + "name": "DoorTop", + "type": "string", + "value": "V" + }, + { + "name": "Floor", + "type": "string", + "value": "." + }, + { + "name": "FloorOccupied", + "type": "string", + "value": "?" + }, + { + "name": "InnerCornerBottomLeft", + "type": "string", + "value": "E" + }, + { + "name": "InnerCornerBottomRight", + "type": "string", + "value": "F" + }, + { + "name": "InnerCornerTopLeft", + "type": "string", + "value": "G" + }, + { + "name": "InnerCornerTopRight", + "type": "string", + "value": "H" + }, + { + "name": "Land", + "type": "string", + "value": "~" + }, + { + "name": "OuterCornerBottomLeft", + "type": "string", + "value": "A" + }, + { + "name": "OuterCornerBottomRight", + "type": "string", + "value": "B" + }, + { + "name": "OuterCornerTopLeft", + "type": "string", + "value": "C" + }, + { + "name": "OuterCornerTopRight", + "type": "string", + "value": "D" + }, + { + "name": "Pillar", + "type": "string", + "value": "@" + }, + { + "name": "WallBottom", + "type": "string", + "value": "=" + }, + { + "name": "WallLeft", + "type": "string", + "value": "|" + }, + { + "name": "WallRight", + "type": "string", + "value": "!" + }, + { + "name": "WallTop", + "type": "string", + "value": "-" + } + ] + }, + { + "folded": true, + "name": "SymbolMapping", + "type": "structure", + "children": [ + { + "name": "!", + "type": "array", + "children": [] + }, + { + "name": "-", + "type": "array", + "children": [] + }, + { + "name": ".", + "type": "array", + "children": [] + }, + { + "name": "<", + "type": "array", + "children": [] + }, + { + "name": "=", + "type": "array", + "children": [] + }, + { + "name": ">", + "type": "array", + "children": [] + }, + { + "name": "@", + "type": "array", + "children": [] + }, + { + "name": "A", + "type": "array", + "children": [] + }, + { + "name": "B", + "type": "array", + "children": [] + }, + { + "name": "C", + "type": "array", + "children": [] + }, + { + "name": "D", + "type": "array", + "children": [] + }, + { + "name": "E", + "type": "array", + "children": [] + }, + { + "name": "F", + "type": "array", + "children": [] + }, + { + "name": "G", + "type": "array", + "children": [] + }, + { + "name": "H", + "type": "array", + "children": [] + }, + { + "name": "V", + "type": "array", + "children": [] + }, + { + "name": "^", + "type": "array", + "children": [] + }, + { + "name": "|", + "type": "array", + "children": [] + }, + { + "name": "~", + "type": "array", + "children": [] + } + ] + }, + { + "name": "AdjacentIndices", + "type": "array", + "children": [] + }, + { + "name": "SymbolMapOwner", + "type": "string", + "value": "" + } + ], + "eventsFunctions": [ + { + "description": "Splits the text into separate substrings and populates the target array with the substrings.", + "fullName": "Split text to array", + "functionType": "Action", + "name": "SplitTextToArray", + "private": true, + "sentence": "Split _PARAM1_ at _PARAM2_ and copy resulting array to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "LineEndPos", + "!=", + "-1" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LineEndPos", + "=", + "StrFindFrom(SourceText, Separator, StartPos)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "LineEndPos", + "=", + "-1" + ] + } + ], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "Lines", + "SubStr(SourceText, StartPos, StrLength(SourceText) - StartPos)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "Lines", + "SubStr(SourceText, StartPos, LineEndPos - StartPos)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartPos", + "=", + "LineEndPos + StrLength(Separator)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CopyVariableToArgument2" + }, + "parameters": [ + "\"TargetArray\"", + "Lines" + ] + } + ] + } + ], + "variables": [ + { + "name": "StartPos", + "type": "number", + "value": 0 + }, + { + "name": "LineEndPos", + "type": "number", + "value": 0 + }, + { + "name": "Lines", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Source text", + "name": "SourceText", + "type": "string" + }, + { + "description": "Separator", + "name": "Separator", + "type": "string" + }, + { + "description": "Target array", + "name": "TargetArray", + "type": "variable" + } + ], + "objectGroups": [] + }, + { + "description": "Replace a character in a string at the specified position.", + "fullName": "Replace character at position", + "functionType": "StringExpression", + "name": "ReplaceCharacterAtPosition", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "SubStr(Source, 0, Position) + Replacement + SubStr(Source, Position + 1, StrLength(Source) - Position - 1)\n" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Source", + "name": "Source", + "type": "string" + }, + { + "description": "Replacement", + "name": "Replacement", + "type": "string" + }, + { + "description": "Position", + "name": "Position", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Append an item to text adding a separator from existing text. This is used for text that is likely to be split into an array later.", + "fullName": "Append to text", + "functionType": "StringExpression", + "name": "AppendToText", + "private": true, + "sentence": "Append _PARAM2_ to _PARAM1_ with _PARAM3_ as separator.", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrLength(OriginalText)", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "OriginalText + Separator + TextToAppend" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "OriginalText + TextToAppend" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Original text", + "name": "OriginalText", + "type": "string" + }, + { + "description": "Text to append", + "name": "TextToAppend", + "type": "string" + }, + { + "description": "Separator", + "name": "Separator", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "SplitTextToArray" + }, + { + "functionName": "AppendToText" + }, + { + "functionName": "ReplaceCharacterAtPosition" + } + ] + }, + "eventsBasedBehaviors": [ + { + "description": "Automatically build a floor plan using a tile map. The floor plan comprises a number of different size interconnected chambers stacked in a column.\n\n\n\n", + "fullName": "Floor plan builder", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCgkuc3Qye2ZpbGw6bm9uZTtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MjtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI2LjEsMy45bC0xNCwyLjdjLTIsMC40LTIuNywyLjgtMS4zLDQuMmwxMC41LDEwLjVjMS40LDEuNCwzLjgsMC42LDQuMi0xLjNsMi43LTE0DQoJQzI4LjQsNC43LDI3LjMsMy42LDI2LjEsMy45eiIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjEzLjciIHkxPSIxOC4zIiB4Mj0iMTYiIHkyPSIxNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQuMywyNy43TDQuMywyNy43Yy0xLjMtMS4zLTEuMi0zLjMsMC4yLTQuNWw3LjYtNi40bDMuMSwzLjFsLTYuNCw3LjZDNy43LDI4LjgsNS42LDI4LjksNC4zLDI3Ljd6Ii8+DQo8L3N2Zz4NCg==", + "name": "FloorPlanBuilder", + "objectType": "TileMap::SimpleTileMap", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Construction/e1bcffd53c05043da8856b57481a3af53d8ef483c2ed4bbbecb0a4f83f0a8b7c_Construction_construction_tool_building_trowel.svg", + "eventsFunctions": [ + { + "description": "Build a random floor plan comprising multiple adjoining chambers. ", + "fullName": "Build random plan", + "functionType": "Action", + "name": "BuildRandomPlan", + "sentence": "Build random floor plan using _PARAM0_: _PARAM2_ doors", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "Blueprint2D" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FloorPlanWidth", + "=", + "Object.GridColumnCount()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FloorPlanHeight", + "=", + "Object.GridRowCount()" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "DoorIndices", + "=", + "\"\"" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::DeriveMappingDetailsAsRequired" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::CreateBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddDoorsToBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "DoorCount", + "ExitCount", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "After painting, store the blueprint in the behavior's property and clear the 2D blueprint as no longer required." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::PaintBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint", + "=", + "Object.Behavior::Blueprint2DAsString()" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "Blueprint2D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Door count", + "name": "DoorCount", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Create the 2D blueprint. Note the 2D blueprint is only used during the build.", + "fullName": "Create blueprint", + "functionType": "Action", + "name": "CreateBlueprint2D", + "private": true, + "sentence": "Create 2D blueprint for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FloorPlanHeight", + "=", + "Object.GridRowCount()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FloorPlanWidth", + "=", + "Object.GridColumnCount()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LastRoomWidth", + "=", + "FloorPlanWidth" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Map dimensions \" + FloorPlanHeight + \" rows x \" + FloorPlanWidth + \" columns\"", + "\"info\"", + "LogMessageGroup" + ] + } + ], + "events": [ + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RowCount", + "<", + "FloorPlanHeight - MinRoomHeight" + ] + } + ], + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Loop to create rooms. Note that calls to RandomInRange have 1 subtracted from the max value as we require an exclusive function, but RandomInRange is inclusive." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MaxLeftCol", + "=", + "LastLeftCol + LastRoomWidth - MinRoomWidth" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LeftCol", + "=", + "RandomInRange(0, MaxLeftCol - 1)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActualMinRoomWidth", + "=", + "max(MinRoomWidth, LastLeftCol - LeftCol + MinRoomWidth)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActualMaxRoomWidth", + "=", + "min(MaxRoomWidth, FloorPlanWidth - LeftCol)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RoomWidth", + "=", + "RandomInRange(ActualMinRoomWidth, ActualMaxRoomWidth - 1)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActualMaxRoomHeight", + "=", + "min(MaxRoomHeight, FloorPlanHeight - RowCount)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RoomHeight", + "=", + "RandomInRange(MinRoomHeight, ActualMaxRoomHeight)" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddRoomToBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "LeftCol", + "RoomWidth", + "RoomHeight", + "RoomWidth" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LastLeftCol", + "=", + "LeftCol" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LastRoomWidth", + "=", + "RoomWidth" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RowCount", + "+", + "RoomHeight" + ] + } + ], + "variables": [ + { + "name": "MaxLeftCol", + "type": "number", + "value": 0 + }, + { + "name": "LeftCol", + "type": "number", + "value": 0 + }, + { + "name": "ActualMinRoomWidth", + "type": "number", + "value": 0 + }, + { + "name": "ActualMaxRoomWidth", + "type": "number", + "value": 0 + }, + { + "name": "ActualMaxRoomHeight", + "type": "number", + "value": 0 + }, + { + "name": "RoomWidth", + "type": "number", + "value": 0 + }, + { + "name": "RoomHeight", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight - RowCount", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddLandStripToBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "variables": [ + { + "name": "MaxRowsForBuilding", + "type": "number", + "value": 0 + }, + { + "name": "LastRoomWidth", + "type": "number", + "value": 0 + }, + { + "name": "LastLeftCol", + "type": "number", + "value": 0 + }, + { + "name": "RowCount", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::RemoveAdjoiningWallsFromBlueprint" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::CorrectCornersInBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Add a room to blueprint 2D", + "fullName": "Add room to blueprint 2D", + "functionType": "Action", + "name": "AddRoomToBlueprint2D", + "private": true, + "sentence": "Add _PARAM3_ x _PARAM4_ room to 2D blueprint in _PARAM0_ at column _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "LeftCol + RoomWidth - 1", + "<", + "FloorPlanWidth" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddTopWallToBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "RoomWidth", + "LeftCol", + "LeftCol" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RoomHeight - 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddInternalWallToBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "RoomWidth", + "RoomHeight", + "LeftCol", + "InternalRow", + "" + ] + } + ], + "variables": [ + { + "name": "InternalRow", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "InternalRow" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddBottomWallToBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "RoomWidth", + "LeftCol", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Room exceeds map width so will not be created.\"", + "\"error\"", + "LogMessageGroup" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Left column", + "name": "LeftCol", + "type": "expression" + }, + { + "description": "Room width", + "name": "RoomWidth", + "type": "expression" + }, + { + "description": "Room height", + "name": "RoomHeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Add a top wall to the blueprint 2D", + "fullName": "Add top wall to blueprint 2D", + "functionType": "Action", + "name": "AddTopWallToBlueprint2D", + "private": true, + "sentence": "Add top wall _PARAM2_ tiles long to 2D blueprint in _PARAM0_ at column _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "LeftCol", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.OuterCornerTopLeft" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RoomWidth - 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.WallTop" + ] + } + ], + "variables": [ + { + "name": "LoopIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "LoopIndex" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.OuterCornerTopRight" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth - LeftCol - RoomWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Blueprint2D", + "RowSymbols" + ] + } + ] + } + ], + "variables": [ + { + "name": "RowSymbols", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Room width", + "name": "RoomWidth", + "type": "expression" + }, + { + "description": "Left column", + "name": "LeftCol", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Add a bottom wall to the blueprint 2D", + "fullName": "Add bottom wall to blueprint 2D", + "functionType": "Action", + "name": "AddBottomWallToBlueprint2D", + "private": true, + "sentence": "Add bottom wall _PARAM2_ tiles long to 2D blueprint in _PARAM0_ at column _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "LeftCol", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.OuterCornerBottomLeft" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RoomWidth - 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.WallBottom" + ] + } + ], + "variables": [ + { + "name": "LoopIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "LoopIndex" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.OuterCornerBottomRight" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth- LeftCol - RoomWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Blueprint2D", + "RowSymbols" + ] + } + ] + } + ], + "variables": [ + { + "name": "RowSymbols", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Room width", + "name": "RoomWidth", + "type": "expression" + }, + { + "description": "Left column", + "name": "LeftCol", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Add an internal wall to the blueprint 2D", + "fullName": "Add internal wall to blueprint 2D", + "functionType": "Action", + "name": "AddInternalWallToBlueprint2D", + "private": true, + "sentence": "Add internal wall to room _PARAM2_ x _PARAM3_ to 2D blueprint in _PARAM0_ at column _PARAM4_; internal row _PARAM5_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RoomColumn", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.WallLeft" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "RoomWidth - 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.Floor" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add pillars if required. They always avoid contact with the surrounding walls of the room." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RoomWidth", + ">", + "6" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "InternalColumn", + ">", + "0" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "InternalColumn", + "<", + "RoomWidth - 3" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "InternalRow", + ">", + "0" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "InternalRow", + "<", + "RoomHeight- 3" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "RandomInRange(1, 20)", + ">=", + "D20RollForPillar" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.Pillar" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "Symbol" + ] + } + ] + } + ], + "variables": [ + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "InternalColumn", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "InternalColumn" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.WallRight" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth- RoomColumn - RoomWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Blueprint2D", + "RowSymbols" + ] + } + ] + } + ], + "variables": [ + { + "name": "RowSymbols", + "type": "array", + "children": [] + }, + { + "name": "PillarsAdded", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Room width", + "name": "RoomWidth", + "type": "expression" + }, + { + "description": "Room height", + "name": "RoomHeight", + "type": "expression" + }, + { + "description": "Left column", + "name": "RoomColumn", + "type": "expression" + }, + { + "description": "Internal row", + "name": "InternalRow", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Derive the mapping information from the Tile Mapping property to populate the mapping information in the scene's tile types variable. If the current object owns the current mapping information, the existing mapping is used.", + "fullName": "Derive mapping details if required", + "functionType": "Action", + "name": "DeriveMappingDetailsAsRequired", + "private": true, + "sentence": "Derive mapping information from Tile Mapping property in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "SymbolMapOwner", + "!=", + "Object.ObjectName()" + ] + } + ], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Build symbol map for \" + Object.ObjectName() + \"; current owner \" + SymbolMapOwner", + "\"info\"", + "LogMessageGroup" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Clear the current symbol map." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "StringVariable" + }, + "parameters": [ + "SymbolMapOwner", + "=", + "\"\"" + ] + }, + { + "type": { + "inverted": true, + "value": "StringVariable" + }, + "parameters": [ + "SymbolMapOwner", + "=", + "\"0\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Clear existing map before rebuilding.\"", + "\"info\"", + "LogMessageGroup" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "SymbolMapping", + "valueIteratorVariableName": "SymbolMapEntry", + "keyIteratorVariableName": "Symbol", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "SymbolMapping[Symbol]" + ] + } + ], + "variables": [ + { + "name": "SymbolMapEntry", + "type": "array", + "children": [] + }, + { + "name": "Symbol", + "type": "string", + "value": "" + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::SplitTextToArray" + }, + "parameters": [ + "", + "TileMapping", + "NewLine()", + "Lines", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Lines", + "valueIteratorVariableName": "CurrentLine", + "keyIteratorVariableName": "", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If line starts with #, it's a skipped tile id" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrFind(CurrentLine, \"#\")", + "!=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::SplitTextToArray" + }, + "parameters": [ + "", + "CurrentLine", + "\",\"", + "Entries", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Entries", + "valueIteratorVariableName": "CurrentEntry", + "keyIteratorVariableName": "", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddMappingDetails" + }, + "parameters": [ + "Object", + "Behavior", + "CurrentEntry", + "CurrentTileId", + "" + ] + } + ] + } + ], + "variables": [ + { + "name": "Entries", + "type": "array", + "children": [] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentTileId", + "+", + "1" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Lines", + "type": "array", + "children": [] + }, + { + "name": "CurrentLine", + "type": "string", + "value": "" + }, + { + "name": "Entries", + "type": "array", + "children": [] + }, + { + "name": "CurrentEntry", + "type": "string", + "value": "" + }, + { + "name": "CurrentTileId", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "SymbolMapOwner", + "=", + "Object.ObjectName()" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Takes definition of a tile and adds mapping information to the Mapping scene variable.", + "fullName": "Add mapping to tile type", + "functionType": "Action", + "name": "AddMappingDetails", + "private": true, + "sentence": "Add tile mapping for _PARAM0_ for tile Id _PARAM3_ using mapping information _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::SplitTextToArray" + }, + "parameters": [ + "", + "Entry", + "\"-\"", + "TileInfoParts", + "" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "TileTypeName", + "=", + "StrReplaceAll(TileInfoParts[0], \" \", \"\")" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "TileTypeSymbols", + "TileTypeName" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "CurrentSymbol", + "=", + "TileTypeSymbols[TileTypeName]" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Mapping.TileId", + "=", + "TileId" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "SymbolMapping", + "CurrentSymbol" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildCount" + }, + "parameters": [ + "TileInfoParts", + ">", + "1" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrFind(TileInfoParts[1], \"0\")", + "!=", + "-1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Mapping.NoPaint", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrFind(TileInfoParts[1], \"X\")", + "!=", + "-1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Mapping.FlipX", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrFind(TileInfoParts[1], \"Y\")", + "!=", + "-1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Mapping.FlipY", + "True", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "SymbolMapping[CurrentSymbol]", + "Mapping" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"No child in symbol mapping found for symbol '\" + CurrentSymbol + \"' so \" + TileTypeName + \" ignored.\" ", + "\"error\"", + "LogMessageGroup" + ] + } + ] + } + ], + "variables": [ + { + "name": "CurrentSymbol", + "type": "string", + "value": "" + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Tile type '\" + TileTypeName + \"' is invalid and has been ignored.\"", + "\"error\"", + "LogMessageGroup" + ] + } + ] + } + ], + "variables": [ + { + "name": "TileInfoParts", + "type": "array", + "children": [] + }, + { + "name": "Mapping", + "type": "structure", + "children": [ + { + "name": "FlipX", + "type": "boolean", + "value": false + }, + { + "name": "FlipY", + "type": "boolean", + "value": false + }, + { + "name": "NoPaint", + "type": "boolean", + "value": false + }, + { + "name": "TileId", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "TileTypeName", + "type": "string", + "value": "" + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Entry", + "name": "Entry", + "type": "string" + }, + { + "description": "Tile Id", + "name": "TileId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Remove adjoining walls between adjacent rooms from blueprint.", + "fullName": "Remove adjoining walls from blueprint", + "functionType": "Action", + "name": "RemoveAdjoiningWallsFromBlueprint", + "private": true, + "sentence": "Remove adjoining walls from blueprint in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Loop through 2D blueprint rows but skipping the first and last ones." + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight- 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Row", + "=", + "RowLoopIndex + 1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Loop through all columns in row but skipping first and last ones" + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth- 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Col", + "=", + "ColLoopIndex + 1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::SymbolIsHorizontalWall" + }, + "parameters": [ + "Object", + "Behavior", + "Blueprint2D[Row][Col]", + "" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::SymbolIsHorizontalWall" + }, + "parameters": [ + "Object", + "Behavior", + "Blueprint2D[Row + 1][Col]", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.Floor" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row + 1][Col]", + "=", + "TileTypeSymbols.Floor" + ] + } + ] + } + ], + "variables": [ + { + "name": "ColLoopIndex", + "type": "number", + "value": 0 + }, + { + "name": "Col", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "ColLoopIndex" + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "RowLoopIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "RowLoopIndex" + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the blueprint symbol represents a horizontal wall.", + "fullName": "Symbol is horizontal wall", + "functionType": "Condition", + "name": "SymbolIsHorizontalWall", + "private": true, + "sentence": "_PARAM2_ is horizontal wall", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.WallBottom" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.WallTop" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Symbol", + "name": "Symbol", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Correct corners so internal corners are used where necessary in the 2D blueprint.", + "fullName": "Correct corners in blueprint", + "functionType": "Action", + "name": "CorrectCornersInBlueprint2D", + "private": true, + "sentence": "Correct corners in 2D blueprint for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Loop through blueprint rows but skipping the first and last ones" + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight- 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Row", + "=", + "LoopIndex + 1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Loop through all columns in row" + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "SymbolAbove", + "=", + "Blueprint2D[Row - 1][Col]" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Symbol", + "=", + "Blueprint2D[Row][Col]" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "SymbolBelow", + "=", + "Blueprint2D[Row + 1][Col]" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.OuterCornerTopLeft" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::SymbolIsWall" + }, + "parameters": [ + "Object", + "Behavior", + "SymbolAbove", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.WallLeft" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row - 1][Col]", + "=", + "TileTypeSymbols.InnerCornerTopRight" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.OuterCornerTopRight" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::SymbolIsWall" + }, + "parameters": [ + "Object", + "Behavior", + "SymbolAbove", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.WallRight" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row - 1][Col]", + "=", + "TileTypeSymbols.InnerCornerTopLeft" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.OuterCornerBottomLeft" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "SymbolBelow", + "=", + "TileTypeSymbols.OuterCornerTopLeft" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.WallLeft" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row + 1][Col]", + "=", + "TileTypeSymbols.WallLeft" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::SymbolIsWall" + }, + "parameters": [ + "Object", + "Behavior", + "SymbolBelow", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.WallLeft" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row + 1][Col]", + "=", + "TileTypeSymbols.InnerCornerBottomRight" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.OuterCornerBottomRight" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "SymbolBelow", + "=", + "TileTypeSymbols.OuterCornerTopRight" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.WallRight" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row + 1][Col]", + "=", + "TileTypeSymbols.WallRight" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::SymbolIsWall" + }, + "parameters": [ + "Object", + "Behavior", + "SymbolBelow", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Col]", + "=", + "TileTypeSymbols.WallRight" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row + 1][Col]", + "=", + "TileTypeSymbols.InnerCornerBottomLeft" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Col", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "SymbolAbove", + "type": "string", + "value": "" + }, + { + "name": "SymbolBelow", + "type": "string", + "value": "" + } + ], + "loopIndexVariable": "Col" + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "LoopIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "LoopIndex" + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the blueprint symbol represents a wall in any orientation.", + "fullName": "Symbol is wall", + "functionType": "Condition", + "name": "SymbolIsWall", + "private": true, + "sentence": "_PARAM2_ is a wall", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.WallBottom" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.WallLeft" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.WallRight" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.WallTop" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Symbol", + "name": "Symbol", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Paint the 2D blueprint. The 2D blueprint is only valid while the floor plan is being built.", + "fullName": "Paint blueprint 2D", + "functionType": "Action", + "name": "PaintBlueprint2D", + "private": true, + "sentence": "Paint _PARAM0_ from blueprint", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildCount" + }, + "parameters": [ + "Blueprint2D", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Row", + "<", + "VariableChildCount(Blueprint2D)" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Col", + "<", + "VariableChildCount(Blueprint2D[Row])" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Symbol", + "=", + "Blueprint2D[Row][Col]" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::PaintTileForSymbol" + }, + "parameters": [ + "Object", + "Behavior", + "Symbol", + "Col", + "Row", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "TileMap::RemoveTileAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row" + ] + } + ] + } + ], + "variables": [ + { + "name": "Col", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "MappingIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Col" + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Row" + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"No blueprint available, so nothing to paint. Call BuildBlueprint first!\"", + "\"error\"", + "LogMessageGroup" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Log the floor plan to the console.", + "fullName": "Log floor plan", + "functionType": "Action", + "name": "LogFloorPlan", + "sentence": "Log _PARAM0_ floor plan", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Row", + "=", + "VariableChildCount(Blueprint2D)" + ] + } + ], + "events": [ + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Row", + ">=", + "0" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Row", + "-", + "1" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Blueprint2D[Row]", + "valueIteratorVariableName": "Symbol", + "keyIteratorVariableName": "", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "BlueprintText", + "+", + "Symbol" + ] + } + ], + "variables": [ + { + "name": "Symbol", + "type": "string", + "value": "" + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Blueprint: \" + BlueprintText", + "\"info\"", + "" + ] + } + ] + } + ], + "variables": [ + { + "name": "BlueprintText", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Add strip of land to the 2D blueprint covering the entire tile map", + "fullName": "Add land strip to blueprint 2D", + "functionType": "Action", + "name": "AddLandStripToBlueprint2D", + "private": true, + "sentence": "Add strip of land to 2D blueprint in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushString" + }, + "parameters": [ + "RowSymbols", + "TileTypeSymbols.Land" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Blueprint2D", + "RowSymbols" + ] + } + ] + } + ], + "variables": [ + { + "name": "RowSymbols", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Paint tile appropriate to blueprint symbol.", + "fullName": "Paint tile for symbol", + "functionType": "Action", + "name": "PaintTileForSymbol", + "private": true, + "sentence": "Paint tile in _PARAM0_ for symbol _PARAM2_ at grid position [_PARAM3_, _PARAM4_]", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Symbol", + "=", + "BlueprintSymbol" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "BlueprintSymbol", + "=", + "TileTypeSymbols.FloorOccupied" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Symbol", + "=", + "TileTypeSymbols.Floor" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MappingIndex", + "=", + "RandomInRange(0, VariableChildCount(SymbolMapping[Symbol]) - 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "SymbolMapping[Symbol][MappingIndex].NoPaint", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TileMap::RemoveTileAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "TileMap::SimpleTileMap::SetTileIdAtGrid" + }, + "parameters": [ + "Object", + "=", + "SymbolMapping[Symbol][MappingIndex].TileId", + "Col", + "Row" + ] + }, + { + "type": { + "value": "TileMap::FlipTileOnXAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "" + ] + }, + { + "type": { + "value": "TileMap::FlipTileOnYAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "SymbolMapping[Symbol][MappingIndex].FlipX", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TileMap::FlipTileOnXAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "SymbolMapping[Symbol][MappingIndex].FlipY", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TileMap::FlipTileOnYAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "yes" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "MappingIndex", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Symbol", + "name": "BlueprintSymbol", + "type": "string" + }, + { + "description": "Column", + "name": "Col", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Center sprite on a random unoccupied floor tile and optionally mark the floor tile as occupied. If no free space the sprite is not moved. Note that occupation of tiles is not dynamically updated during the game.", + "fullName": "Center sprite on random free floor", + "functionType": "Action", + "name": "CenterSpriteOnRandomFreeFloor", + "sentence": " Center _PARAM2_ on random free floor tile in _PARAM0_; mark as occupied: _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "Object.Behavior::RandomBlueprintSymbolIndex(TileTypeSymbols.Floor)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Index", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Column", + "=", + "Object.Behavior::BlueprintIndexAsColumn(Index)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Row", + "=", + "Object.Behavior::BlueprintIndexAsRow(Index)" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::CenterSpriteAtGridPos" + }, + "parameters": [ + "Object", + "Behavior", + "Sprite", + "Column", + "Row", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MarkAsOccupied", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::MarkGridPositionOccupied" + }, + "parameters": [ + "Object", + "Behavior", + "Column", + "Row", + "" + ] + } + ] + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "Column", + "type": "number", + "value": 0 + } + ] + } + ], + "variables": [ + { + "name": "Index", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Sprite", + "name": "Sprite", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Mark as occupied", + "name": "MarkAsOccupied", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Center sprite on tile at grid position. No check is made on the validity of the position. ", + "fullName": "Center sprite at grid position", + "functionType": "Action", + "name": "CenterSpriteAtGridPos", + "sentence": "Center _PARAM2_ on tile at grid position [_PARAM3_, _PARAM4_] in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Sprite", + "=", + "Object.TileCenterX(Column, Row)", + "=", + "Object.TileCenterY(Column, Row)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Sprite", + "name": "Sprite", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Convert the floor plan to JSON.", + "fullName": "Floor plan to JSON", + "functionType": "StringExpression", + "name": "FloorPlanToJSON", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Get tile map information for the tile ids actually used." + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TileInfo.TileId", + "=", + "Object.TileIdAtGrid(Col, Row)" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "TileInfo.FlipX", + "False", + "Object.TileIdAtGrid(Col, Row)" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "TileInfo.FlipY", + "False", + "Object.TileIdAtGrid(Col, Row)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TileMap::IsTileFlippedOnXAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "TileInfo.FlipX", + "True", + "Object.TileIdAtGrid(Col, Row)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TileMap::IsTileFlippedOnYAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "TileInfo.FlipY", + "True", + "Object.TileIdAtGrid(Col, Row)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "RowDetails", + "TileInfo" + ] + } + ] + } + ], + "variables": [ + { + "name": "Col", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Col" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "TileMapIds", + "RowDetails" + ] + } + ] + } + ], + "variables": [ + { + "name": "RowDetails", + "type": "array", + "children": [] + }, + { + "name": "TileInfo", + "type": "structure", + "children": [ + { + "name": "FlipX", + "type": "boolean", + "value": false + }, + { + "name": "FlipY", + "type": "boolean", + "value": false + }, + { + "name": "TileId", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Row" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Copy data into the Data structure and return as JSON string" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Data.Blueprint", + "=", + "Blueprint" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Data.DoorIndices", + "=", + "DoorIndices" + ] + }, + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Data.TileMapIds", + "TileMapIds" + ] + }, + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "ToJSON(Data)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + } + ] + } + ], + "variables": [ + { + "name": "Data", + "type": "structure", + "children": [ + { + "name": "Blueprint", + "type": "string", + "value": "" + }, + { + "name": "DoorIndices", + "type": "string", + "value": "" + }, + { + "name": "TileMapIds", + "type": "array", + "children": [] + } + ] + }, + { + "name": "TileMapIds", + "type": "array", + "children": [] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Restore the floor plan from JSON string previously created by call to Floor plan to JSON. ", + "fullName": "Restore floor plan from JSON", + "functionType": "Action", + "name": "RestoreFloorPlanFromJSON", + "sentence": "Restore _PARAM0_ floor plan from JSON _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "JSONToVariableStructure2" + }, + "parameters": [ + "JSON", + "Data" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "SymbolMapOwner", + "!=", + "Object.ObjectName()" + ] + } + ], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::DeriveMappingDetailsAsRequired" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Restore the blueprint" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint", + "=", + "Data.Blueprint" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::ClearAllOccupation" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Restore door indices" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "DoorIndices", + "=", + "Data.DoorIndices" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Restore the tile map tile ids" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FloorPlanHeight", + "=", + "VariableChildCount(Data.TileMapIds[0])" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FloorPlanWidth", + "=", + "VariableChildCount(Data.TileMapIds[0][0])" + ] + }, + { + "type": { + "value": "TileMap::SimpleTileMap::SetGridRowCount" + }, + "parameters": [ + "Object", + "=", + "FloorPlanHeight" + ] + }, + { + "type": { + "value": "TileMap::SimpleTileMap::SetGridColumnCount" + }, + "parameters": [ + "Object", + "=", + "FloorPlanWidth" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Restoring floor plan \" + FloorPlanWidth + \" x \" + FloorPlanHeight ", + "\"info\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "TileMap::FlipTileOnXAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "no" + ] + }, + { + "type": { + "value": "TileMap::FlipTileOnXAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "no" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Restoring tile at [\" + Col + \", \" + Row + \"]. Tile Id \" + Data.TileMapIds[0][Row][Col].TileId", + "\"info\"", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Data.TileMapIds[0][Row][Col].TileId", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "TileMap::SimpleTileMap::SetTileIdAtGrid" + }, + "parameters": [ + "Object", + "=", + "Data.TileMapIds[0][Row][Col].TileId", + "Col", + "Row" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "TileMap::RemoveTileAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Data.TileMapIds[0][Row][Col].FlipX", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TileMap::FlipTileOnXAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Data.TileMapIds[0][Row][Col].FlipY", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TileMap::FlipTileOnYAtGridCoordinates" + }, + "parameters": [ + "Object", + "Col", + "Row", + "yes" + ] + } + ] + } + ], + "variables": [ + { + "name": "Col", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Col" + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Row" + } + ], + "variables": [ + { + "name": "Data", + "type": "structure", + "children": [ + { + "name": "Blueprint", + "type": "string", + "value": "" + }, + { + "name": "DoorIndices", + "type": "string", + "value": "" + }, + { + "name": "TileMapIds", + "type": "array", + "children": [] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "JSON ( saved from Floor plan to JSON)", + "name": "JSON", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Center a sprite on the closest tile. No adjustment is made to the occupation state of floor tiles.", + "fullName": "Center sprite on closest tile", + "functionType": "Action", + "name": "CenterSpriteOnClosestTile", + "sentence": "Center _PARAM2_ on closest tile in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridX", + "=", + "Object.GridX(Sprite.CenterX(), Sprite.CenterY())" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridY", + "=", + "Object.GridY(Sprite.CenterX(), Sprite.CenterY())" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Sprite", + "=", + "Object.TileCenterX(GridX, GridY)", + "=", + "Object.TileCenterY(GridX, GridY)" + ] + } + ], + "variables": [ + { + "name": "GridX", + "type": "number", + "value": 0 + }, + { + "name": "GridY", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Sprite", + "name": "Sprite", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Convert the 2D blueprint used during the build process to a simple string.", + "fullName": "Blueprint 2D as string", + "functionType": "StringExpression", + "name": "Blueprint2DAsString", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Result", + "+", + "Blueprint2D[Row][Col]" + ] + } + ], + "variables": [ + { + "name": "Col", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Col" + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Row" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Result" + ] + } + ] + } + ], + "variables": [ + { + "name": "Result", + "type": "string", + "value": "" + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Convert the index in the blueprint to its equivalent row in the tile map grid.", + "fullName": "Blueprint index as row", + "functionType": "Expression", + "name": "BlueprintIndexAsRow", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "floor(Index / FloorPlanWidth)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Index", + "name": "Index", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Convert the index in the blueprint to its equivalent column in the tile map grid.", + "fullName": "Blueprint index as column", + "functionType": "Expression", + "name": "BlueprintIndexAsColumn", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(Index, FloorPlanWidth)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Index", + "name": "Index", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Convert grid position to blueprint index", + "fullName": "Grid pos to blueprint index", + "functionType": "Expression", + "name": "GridPosToBlueprintIndex", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Row * FloorPlanWidth + Column" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Get the blueprint symbol at a grid position", + "fullName": "Blueprint symbol at grid position", + "functionType": "Expression", + "name": "BlueprintSymbolAtGridPos", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "StrAt(Blueprint, Object.Behavior::GridPosToBlueprintIndex(Column, Row))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Randomly select the index for a symbol from the blueprint that matches a symbol in the string of possible symbols. -1 if none found.", + "fullName": "Random blueprint symbol index", + "functionType": "Expression", + "name": "RandomBlueprintSymbolIndex", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StrLength(Blueprint)", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrFind(Symbols, StrAt(Blueprint, SymbolIndex))", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Indices", + "SymbolIndex" + ] + } + ] + } + ], + "variables": [ + { + "name": "SymbolIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "SymbolIndex" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildCount" + }, + "parameters": [ + "Indices", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Indices[RandomInRange(0, VariableChildCount(Indices) - 1)]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Failed to find any of following symbols in blueprint: \" + Symbols ", + "\"warning\"", + "LogMessageGroup" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "-1" + ] + } + ] + } + ], + "variables": [ + { + "name": "Indices", + "type": "array", + "children": [] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Symbols", + "name": "Symbols", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Mark the grid position as occupied.", + "fullName": "Mark grid position occupied", + "functionType": "Action", + "name": "MarkGridPositionOccupied", + "sentence": "Mark grid position [_PARAM2_, _PARAM3_] in _PARAM0_ as occupied", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column, Row)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TileTypeSymbols.Floor", + "=", + "StrAt(Blueprint, Index)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint", + "=", + "RandomFloorPlan::ReplaceCharacterAtPosition(Blueprint, TileTypeSymbols.FloorOccupied, Index)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TileTypeSymbols.FloorOccupied", + "=", + "StrAt(Blueprint, Index)" + ] + } + ], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Cannot occupy grid position [\" + Column + \", \" + Row + \"] as it is already occupied.\"", + "\"warning\"", + "LogMessageGroup" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Cannot occupy grid position [\" + Column + \", \" + Row + \"] as it isn't a floor tile.\"", + "\"error\"", + "LogMessageGroup" + ] + } + ] + } + ], + "variables": [ + { + "name": "Index", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Mark the grid position as unoccupied.", + "fullName": "Mark grid position unoccupied", + "functionType": "Action", + "name": "MarkGridPositionUnoccupied", + "sentence": "Mark grid position [_PARAM2_, _PARAM3_] in _PARAM0_ as unoccupied", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column, Row)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TileTypeSymbols.FloorOccupied", + "=", + "StrAt(Blueprint, Index)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint", + "=", + "RandomFloorPlan::ReplaceCharacterAtPosition(Blueprint, TileTypeSymbols.Floor, Index)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Cannot clear occupation of grid position [\" + Column + \", \" + Row + \"] as it isn't an occupied floor tile.\"", + "\"info\"", + "LogMessageGroup" + ] + } + ] + } + ], + "variables": [ + { + "name": "Index", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Mark the all floor tiles as unoccupied.", + "fullName": "Clear all occupation", + "functionType": "Action", + "name": "ClearAllOccupation", + "sentence": "Clear all floor tile occupation in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint", + "=", + "StrReplaceAll(Blueprint, TileTypeSymbols.FloorOccupied, TileTypeSymbols.Floor)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Add doors to blueprint 2D", + "fullName": "Add doors to blueprint 2D", + "functionType": "Action", + "name": "AddDoorsToBlueprint2D", + "private": true, + "sentence": "Add _PARAM2_ doors to 2D blueprint in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add doors. Note entrance and exits are created alternately to prevent a large number of one type preventing the creation of the other." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActualDoors", + "=", + "DoorCount" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::FindSymbolsInBlueprint2D" + }, + "parameters": [ + "Object", + "Behavior", + "TileTypeSymbols.WallBottom + TileTypeSymbols.WallLeft + TileTypeSymbols.WallRight + TileTypeSymbols.WallTop", + "FreeWallIndices", + "yes", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove adjacent tiles" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildCount" + }, + "parameters": [ + "FreeWallIndices", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"There are no free walls so no doors added.\"", + "\"warning\"", + "LogMessageGroup" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "FreeWallIndices", + "valueIteratorVariableName": "Coordinates", + "keyIteratorVariableName": "", + "conditions": [], + "actions": [], + "variables": [ + { + "name": "Coordinates", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If there are not enough free wall spaces, share them out." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildCount" + }, + "parameters": [ + "FreeWallIndices", + "<", + "DoorCount" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActualDoors", + "=", + "VariableChildCount(FreeWallIndices)" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Not enough free wall spaces so door count reduced to \" + ToString(ActualDoors)", + "\"warning\"", + "LogMessageGroup" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "ActualDoors", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "RandomInRange(0, VariableChildCount(FreeWallIndices) - 1)" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::AddDoorToBlueprint2DAtGridPos" + }, + "parameters": [ + "Object", + "Behavior", + "FreeWallIndices[Index].Column", + "FreeWallIndices[Index].Row", + "", + "" + ] + }, + { + "type": { + "value": "RemoveVariableAt" + }, + "parameters": [ + "FreeWallIndices", + "Index" + ] + } + ], + "variables": [ + { + "name": "Index", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "variables": [ + { + "name": "ActualDoors", + "type": "number", + "value": 0 + }, + { + "name": "FreeWallIndices", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Door count", + "name": "DoorCount", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Search the 2D blueprint to find tiles with symbols contained in string of candidate symbols.", + "fullName": "Find symbols in blueprint 2D", + "functionType": "Action", + "name": "FindSymbolsInBlueprint2D", + "private": true, + "sentence": "Populate _PARAM3_ with coordinates of tiles in 2D blueprint of _PARAM0_: symbols: _PARAM2_; exclude adjacent: _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "AdjacentIndices" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanHeight", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "FloorPlanWidth", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Check if adjacent to already saved coordinate" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ExcludeAdjacent", + "False", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "RandomFloorPlan::FloorPlanBuilder::InAdjacentIndices" + }, + "parameters": [ + "Object", + "Behavior", + "Col", + "Row", + "", + "" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "StrFind(Symbols, Blueprint2D[Row][Col])", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Coordinate.Column", + "=", + "Col" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Coordinate.Row", + "=", + "Row" + ] + }, + { + "type": { + "value": "PushVariable" + }, + "parameters": [ + "Indices", + "Coordinate" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Col", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Col" + } + ], + "variables": [ + { + "name": "Row", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "Row" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildCount" + }, + "parameters": [ + "Indices", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Failed to find any of following symbols in blueprint 2D: \" + Symbols ", + "\"warning\"", + "LogMessageGroup" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CopyVariableToArgument2" + }, + "parameters": [ + "\"ResultingIndices\"", + "Indices" + ] + }, + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "AdjacentIndices" + ] + } + ] + } + ], + "variables": [ + { + "name": "Indices", + "type": "array", + "children": [] + }, + { + "name": "Coordinate", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "RestrictedIndices", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Symbols", + "name": "Symbols", + "type": "string" + }, + { + "description": "Resulting indices array", + "name": "ResultingIndices", + "type": "variable" + }, + { + "description": "Exclude adjacent tiles", + "name": "ExcludeAdjacent", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Add a door to the 2D blueprint at the grid position.", + "fullName": "Add door to blueprint 2D at grid pos", + "functionType": "Action", + "name": "AddDoorToBlueprint2DAtGridPos", + "private": true, + "sentence": "Add door at [_PARAM2_, _PARAM3_] in _PARAM0_ 2D blueprint;", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "WallSymbol", + "=", + "Blueprint2D[Row][Column]" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallSymbol", + "=", + "TileTypeSymbols.WallBottom" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Column]", + "=", + "TileTypeSymbols[\"DoorBottom\"]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallSymbol", + "=", + "TileTypeSymbols.WallLeft" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Column]", + "=", + "TileTypeSymbols[\"DoorLeft\"]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallSymbol", + "=", + "TileTypeSymbols.WallRight" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Column]", + "=", + "TileTypeSymbols[\"DoorRight\"]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallSymbol", + "=", + "TileTypeSymbols.WallTop" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Blueprint2D[Row][Column]", + "=", + "TileTypeSymbols[\"DoorTop\"]" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Attempt to add door at [\" + Column + \", \" + Row + \"] ignored as not a wall tile.\"", + "\"error\"", + "LogMessageGroup" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Failed", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Failed", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "DoorIndices", + "=", + "RandomFloorPlan::AppendToText(DoorIndices, ToString(Object.Behavior::GridPosToBlueprintIndex(Column, Row)), \",\")" + ] + } + ] + } + ], + "variables": [ + { + "name": "WallSymbol", + "type": "string", + "value": "" + }, + { + "name": "Failed", + "type": "boolean", + "value": false + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Center sprite on the doorstep adjacent to a door number. The first door added is door number 0.", + "fullName": "Center sprite on doorstep", + "functionType": "Action", + "name": "CenterSpriteOnDoorstep", + "sentence": "Center _PARAM2_ on doorstep of door number _PARAM3_ in _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::FindDoorInformation" + }, + "parameters": [ + "Object", + "Behavior", + "DoorNumber", + "DoorInformation", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "DoorInformation.Symbol", + "!=", + "\"\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::CenterSpriteAtGridPos" + }, + "parameters": [ + "Object", + "Behavior", + "Sprite", + "DoorInformation.Doorstep.Column", + "DoorInformation.Doorstep.Row", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "DoorInformation", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Doorstep", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "WallAlignment", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Sprite", + "name": "Sprite", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Door number", + "name": "DoorNumber", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Find the information about a door. Result is provided back in result parameter with the following children: Symbol, WallAlignment, Column, Row and Doorstep. The Doorstep child contains further children, Row and Column, for the position of the associated internal doorstep. Symbol is blank on error. This method is rarely needed externally.", + "fullName": "Find door information", + "functionType": "Action", + "name": "FindDoorInformation", + "sentence": "Find door number _PARAM2_ in _PARAM0_. Result in _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::SplitTextToArray" + }, + "parameters": [ + "", + "DoorIndices", + "\",\"", + "Doors", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "DoorNumber", + "<", + "VariableChildCount(Doors)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Result.Symbol", + "=", + "StrAt(Blueprint, Doors[DoorNumber])" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Column", + "=", + "Object.Behavior::BlueprintIndexAsColumn(Doors[DoorNumber])" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Row", + "=", + "Object.Behavior::BlueprintIndexAsRow(Doors[DoorNumber])" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Doorstep.Column", + "=", + "Result.Column" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Doorstep.Row", + "=", + "Result.Row" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Result.Symbol", + "=", + "TileTypeSymbols.DoorBottom" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Result.WallAlignment", + "=", + "\"Bottom\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Doorstep.Row", + "-", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Result.Symbol", + "=", + "TileTypeSymbols.DoorLeft" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Result.WallAlignment", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Doorstep.Column", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Result.Symbol", + "=", + "TileTypeSymbols.DoorRight" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Result.WallAlignment", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Doorstep.Column", + "-", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Result.Symbol", + "=", + "TileTypeSymbols.DoorTop" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Result.WallAlignment", + "=", + "\"Top\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Result.Doorstep.Row", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Door number does not point to valid wall. DoorIndices incorrect; contact developer.\"", + "\"error\"", + "LogMessageGroup" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Door number \" + DoorNumber + \" invalid.\"", + "\"error\"", + "LogMessageGroup" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CopyVariableToArgument2" + }, + "parameters": [ + "\"Information\"", + "Result" + ] + } + ] + } + ], + "variables": [ + { + "name": "Doors", + "type": "array", + "children": [] + }, + { + "name": "Result", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Doorstep", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "WallAlignment", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Door number", + "name": "DoorNumber", + "type": "expression" + }, + { + "description": "Information", + "name": "Information", + "type": "variable" + } + ], + "objectGroups": [] + }, + { + "description": "Get the number of doors in the floor plan.", + "fullName": "Number of doors", + "functionType": "Expression", + "name": "NumberOfDoors", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::SplitTextToArray" + }, + "parameters": [ + "", + "DoorIndices", + "\",\"", + "Doors", + "" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VariableChildCount(Doors)" + ] + } + ], + "variables": [ + { + "name": "Doors", + "type": "array", + "children": [] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Mark doorstep associated with door number as occupied.", + "fullName": "Mark doorstep occupied", + "functionType": "Action", + "name": "MarkDoorstepOccupied", + "sentence": "Mark doorstep of door number _PARAM2_ in _PARAM0_ as occupied", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::FindDoorInformation" + }, + "parameters": [ + "Object", + "Behavior", + "DoorNumber", + "DoorInformation", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "DoorInformation.Symbol", + "!=", + "\"\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::MarkGridPositionOccupied" + }, + "parameters": [ + "Object", + "Behavior", + "DoorInformation.Doorstep.Column", + "DoorInformation.Doorstep.Row", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "DoorInformation", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Doorstep", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "WallAlignment", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Door number", + "name": "DoorNumber", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Log the current symbol map. This can be used to help find errors in the Tile Mapping property.", + "fullName": "Log symbol map ", + "functionType": "Action", + "name": "LogSymbolMap", + "sentence": "Log _PARAM0_ symbol map to the console", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Logging symbol map used for \" + Object.ObjectName()", + "\"info\"", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "TileTypeSymbols", + "valueIteratorVariableName": "TileTypeSymbol", + "keyIteratorVariableName": "TileTypeName", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TileTypeName", + "!=", + "\"FloorOccupied\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Message", + "=", + "TileTypeName + \" = [\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "SymbolMapping[TileTypeSymbol]", + "valueIteratorVariableName": "TileInfo", + "keyIteratorVariableName": "", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Message", + "+", + "\" {ID: \" + TileInfo.TileId + \", FlipX: \" + TileInfo.FlipX + \", FlipY: \" + TileInfo.FlipY + \", NoPaint: \" + TileInfo.NoPaint + \"},\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "Message +\" ]\"", + "\"info\"", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "TileTypeSymbol", + "type": "string", + "value": "" + }, + { + "name": "TileTypeName", + "type": "string", + "value": "" + }, + { + "name": "TileInfo", + "type": "structure", + "children": [ + { + "name": "FlipX", + "type": "boolean", + "value": false + }, + { + "name": "FlipY", + "type": "boolean", + "value": false + }, + { + "name": "NoPaint", + "type": "boolean", + "value": false + }, + { + "name": "TileId", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "Message", + "type": "string", + "value": "" + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check whether this grid position is in the array of adjacent indices. Optionally add adjacent indices to the global AdjacentIndices", + "fullName": "In adjacent indices", + "functionType": "Condition", + "name": "InAdjacentIndices", + "private": true, + "sentence": "Grid pos [_PARAM2_, _PARAM3_] already in Adjacent Indices; add if not: _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MaxLoops", + "=", + "VariableChildCount(AdjacentIndices)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Convert grid coordinate and surrounding positions to linear indices" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "IndexCenter", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column, Row)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "IndexAbove", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column, Row - 1)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "IndexBelow", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column, Row + 1)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "IndexLeft", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column - 1, Row)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "IndexRight", + "=", + "Object.Behavior::GridPosToBlueprintIndex(Column + 1, Row)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Search for current center in array of indices. End search if found." + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "AlreadyIncluded", + "False", + "-1" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "LoopIndex", + "<", + "MaxLoops" + ] + } + ], + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "IndexCenter", + "=", + "AdjacentIndices[LoopIndex]" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "AlreadyIncluded", + "True", + "LoopIndex" + ] + } + ], + "variables": [ + { + "name": "LoopIndex", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "LoopIndex" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If not already included add the indices surrounding the center to the array of adjacent indices." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "AlreadyIncluded", + "False", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "AddIfNotIncluded", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PushNumber" + }, + "parameters": [ + "AdjacentIndices", + "IndexAbove" + ] + }, + { + "type": { + "value": "PushNumber" + }, + "parameters": [ + "AdjacentIndices", + "IndexBelow" + ] + }, + { + "type": { + "value": "PushNumber" + }, + "parameters": [ + "AdjacentIndices", + "IndexLeft" + ] + }, + { + "type": { + "value": "PushNumber" + }, + "parameters": [ + "AdjacentIndices", + "IndexRight" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "AlreadyIncluded", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + } + ], + "variables": [ + { + "name": "MaxLoops", + "type": "number", + "value": 0 + }, + { + "name": "IndexAbove", + "type": "number", + "value": 0 + }, + { + "name": "IndexBelow", + "type": "number", + "value": 0 + }, + { + "name": "IndexLeft", + "type": "number", + "value": 0 + }, + { + "name": "IndexRight", + "type": "number", + "value": 0 + }, + { + "name": "IndexCenter", + "type": "number", + "value": 0 + }, + { + "name": "AlreadyIncluded", + "type": "boolean", + "value": false + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Column", + "name": "Column", + "type": "expression" + }, + { + "description": "Row", + "name": "Row", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Update indices if not included", + "name": "AddIfNotIncluded", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Mark all doorsteps as occupied.", + "fullName": "Mark all doorsteps occupied", + "functionType": "Action", + "name": "MarkAllDoorstepsOccupied", + "sentence": "Mark all doorsteps in _PARAM0_ as occupied", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::SplitTextToArray" + }, + "parameters": [ + "", + "DoorIndices", + "\",\"", + "Doors", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "VariableChildCount(Doors)", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::MarkDoorstepOccupied" + }, + "parameters": [ + "Object", + "Behavior", + "DoorNumber", + "" + ] + } + ], + "variables": [ + { + "name": "DoorNumber", + "type": "number", + "value": 0 + } + ], + "loopIndexVariable": "DoorNumber" + } + ], + "variables": [ + { + "name": "Doors", + "type": "array", + "children": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "BuildRandomPlan" + }, + { + "functionName": "CenterSpriteOnClosestTile" + }, + { + "functionName": "CenterSpriteOnDoorstep" + }, + { + "functionName": "CenterSpriteAtGridPos" + }, + { + "functionName": "CenterSpriteOnRandomFreeFloor" + }, + { + "functionName": "FindDoorInformation" + }, + { + "functionName": "ClearAllOccupation" + }, + { + "functionName": "MarkDoorstepOccupied" + }, + { + "functionName": "MarkAllDoorstepsOccupied" + }, + { + "functionName": "MarkGridPositionOccupied" + }, + { + "functionName": "MarkGridPositionUnoccupied" + }, + { + "functionName": "RestoreFloorPlanFromJSON" + }, + { + "functionName": "FloorPlanToJSON" + }, + { + "functionName": "NumberOfDoors" + }, + { + "functionName": "LogFloorPlan" + }, + { + "functionName": "LogSymbolMap" + }, + { + "functionName": "AddBottomWallToBlueprint2D" + }, + { + "functionName": "AddDoorsToBlueprint2D" + }, + { + "functionName": "AddDoorToBlueprint2DAtGridPos" + }, + { + "functionName": "AddInternalWallToBlueprint2D" + }, + { + "functionName": "AddLandStripToBlueprint2D" + }, + { + "functionName": "AddMappingDetails" + }, + { + "functionName": "AddRoomToBlueprint2D" + }, + { + "functionName": "AddTopWallToBlueprint2D" + }, + { + "functionName": "BlueprintIndexAsColumn" + }, + { + "functionName": "BlueprintIndexAsRow" + }, + { + "functionName": "BlueprintSymbolAtGridPos" + }, + { + "functionName": "CorrectCornersInBlueprint2D" + }, + { + "functionName": "CreateBlueprint2D" + }, + { + "functionName": "DeriveMappingDetailsAsRequired" + }, + { + "functionName": "FindSymbolsInBlueprint2D" + }, + { + "functionName": "InAdjacentIndices" + }, + { + "functionName": "GridPosToBlueprintIndex" + }, + { + "functionName": "PaintBlueprint2D" + }, + { + "functionName": "PaintTileForSymbol" + }, + { + "functionName": "RandomBlueprintSymbolIndex" + }, + { + "functionName": "RemoveAdjoiningWallsFromBlueprint" + }, + { + "functionName": "SymbolIsHorizontalWall" + }, + { + "functionName": "SymbolIsWall" + }, + { + "functionName": "Blueprint2DAsString" + } + ] + }, + "propertyDescriptors": [ + { + "value": "16", + "type": "Number", + "label": "Max columns for room", + "description": "Maximum width of a room in columns.", + "name": "MaxRoomWidth" + }, + { + "value": "16", + "type": "Number", + "label": "Max rows for room", + "description": "Maximum height of a room in rows.", + "name": "MaxRoomHeight" + }, + { + "value": "DoorBottom\nDoorLeft\nDoorRight\nDoorTop\nFloor\nInnerCornerBottomLeft\nInnerCornerBottomRight\nInnerCornerTopLeft\nInnerCornerTopRight\nLand, Land-X\nOuterCornerBottomLeft\nOuterCornerBottomRight\nOuterCornerTopLeft\nOuterCornerTopRight\nPillar\nWallBottom\nWallLeft\nWallRight\nWallTop", + "type": "MultilineString", + "label": "Tile order", + "description": "Map the tile types to the tilemap's atlas. The Pascal-case type names define the tile type. E.g. 'WallTop' identifies the tile used to draw the top wall of a room. The associated tile identifier (id) of the tile in the tilemap object is taken from zero-based line number in the property. So the first line defines the tile type associated with the first tile in the atlas (tile id 0). Similarly, the next line maps to tile id 1 and so on. One line can be used for multiple tile types by separating the type names with commas. The name can immediately followed by a hyphen (no spaces) and a modifier string. The characters contained in the modifier adjust how the tile is painted: X flips in the X direction; Y flips in the Y direction; 0 prevents the tile being painted at all.\n", + "name": "TileMapping" + }, + { + "value": "4", + "type": "Number", + "label": "Min room height", + "description": "Minimum height of a room in tiles.", + "name": "MinRoomHeight" + }, + { + "value": "4", + "type": "Number", + "label": "Min room width", + "description": "Minimum width of a room in tiles.", + "name": "MinRoomWidth" + }, + { + "value": "20", + "type": "Number", + "label": "D20 roll for pillar", + "description": "When adding floor tiles, the engine rolls a D20 (twenty sided die). If the roll is greater than or equal to this property, a pillar is added instead of a floor tile. A value greater than 20 will result in no pillars.", + "name": "D20RollForPillar" + }, + { + "value": "", + "type": "String", + "label": "Blueprint", + "description": "Blueprint for the floor plan. This is populated from the 2 dimensional array used during the build process.", + "hidden": true, + "name": "Blueprint" + }, + { + "value": "", + "type": "Number", + "label": "Floor plan width", + "description": "Width of floor plan in tiles (columns).", + "hidden": true, + "name": "FloorPlanWidth" + }, + { + "value": "", + "type": "Number", + "label": "Floor plan height", + "description": "Height of floor plan in tiles (rows).", + "hidden": true, + "name": "FloorPlanHeight" + }, + { + "value": "", + "type": "String", + "label": "Door indices", + "description": "Comma separated list of indices into the blueprint that hold doors.", + "hidden": true, + "name": "DoorIndices" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "D20RollForPillar" + }, + { + "propertyName": "MinRoomHeight" + }, + { + "propertyName": "MinRoomWidth" + }, + { + "propertyName": "TileMapping" + }, + { + "propertyName": "MaxRoomHeight" + }, + { + "propertyName": "MaxRoomWidth" + }, + { + "propertyName": "FloorPlanHeight" + }, + { + "propertyName": "FloorPlanWidth" + }, + { + "propertyName": "Blueprint" + }, + { + "propertyName": "DoorIndices" + } + ] + } + }, + { + "description": "Animated door for aligning with a floor plan. The sprite can be rotated to align with the wall on which it is located. Alternatively different animations can be applied for different walls. The animation number used for opening and closing events should be set. The default is to use animation 0 for opening events and 1 for closing.", + "fullName": "Floor plan door", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvb3Itb3BlbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiwzQzEwLjg5LDMgMTAsMy44OSAxMCw1SDNWMTlIMlYyMUgyMlYxOUgyMVY1QzIxLDMuODkgMjAuMTEsMyAxOSwzSDEyTTEyLDVIMTlWMTlIMTJWNU01LDExSDdWMTNINVYxMVoiIC8+PC9zdmc+", + "name": "FloorPlanDoor", + "objectType": "Sprite", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/dcf85bffaf256cccba6eec6105714d3763e13e3101d20d272ed274645c249562_door-open.svg", + "eventsFunctions": [ + { + "description": "Set door state to open and play closing animation.", + "fullName": "Open door", + "functionType": "Action", + "name": "OpenDoor", + "sentence": "Open _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Bottom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "BottomWallAnimationOpening" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "LeftWallAnimationOpening" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Right\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "RightWallAnimationOpening" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "TopWallAnimationOpening" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "OpenState", + "True", + "" + ] + }, + { + "type": { + "value": "ChangeSprite" + }, + "parameters": [ + "Object", + "=", + "0" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::PlayAnimation" + }, + "parameters": [ + "Object", + "Animation" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Set door state to closed and play closing animation.", + "fullName": "Close door", + "functionType": "Action", + "name": "CloseDoor", + "sentence": "Close _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Bottom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "BottomWallAnimationClosing" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "LeftWallAnimationClosing" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Right\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "RightWallAnimationClosing" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Object", + "Animation", + "=", + "TopWallAnimationClosing" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "OpenState", + "False", + "" + ] + }, + { + "type": { + "value": "ChangeSprite" + }, + "parameters": [ + "Object", + "=", + "0" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::PlayAnimation" + }, + "parameters": [ + "Object", + "Animation" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Align the door with a door in object that can build floor plans.", + "fullName": "Align with floor plan door", + "functionType": "Action", + "name": "AlignWithFloorPlanDoor", + "sentence": "Align _PARAM0_ with door number _PARAM4_ in _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::FindDoorInformation" + }, + "parameters": [ + "FloorPlanBuilder", + "BuildFloorPlans", + "DoorNumber", + "DoorInformation", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "DoorInformation.WallAlignment", + "!=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AlignedDoorNumber", + "=", + "DoorNumber" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "DoorInformation.WallAlignment" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanDoor::CloseDoor" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::CenterSpriteAtGridPos" + }, + "parameters": [ + "FloorPlanBuilder", + "BuildFloorPlans", + "Object", + "DoorInformation.Column", + "DoorInformation.Row", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Bottom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "BottomWallRotation" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "LeftWallRotation" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "WallAlignment", + "=", + "\"Right\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "RightWallRotation" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "TopWallRotation" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "DoorInformation", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "string", + "value": "" + }, + { + "name": "Doorstep", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "number", + "value": 0 + }, + { + "name": "WallAlignment", + "type": "string", + "value": "" + } + ] + }, + { + "name": "AnimationNumber", + "type": "number", + "value": 0 + }, + { + "name": "AnimationRotation", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + }, + { + "description": "Floor plan builder", + "name": "FloorPlanBuilder", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "objectList" + }, + { + "description": "Build floor plans", + "name": "BuildFloorPlans", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Door number", + "name": "DoorNumber", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if door is open.", + "fullName": "Open", + "functionType": "Condition", + "name": "Open", + "sentence": "_PARAM0_ is open", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "OpenState", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the actor has collided with an open door, is not current passing through a door.", + "fullName": "Floor plan actor can pass", + "functionType": "Condition", + "name": "FloorPlanActorCanPassDoor", + "sentence": "_PARAM2_ can pass through _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanDoor::Open" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Actor", + "Object", + "", + "", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "RandomFloorPlan::FloorPlanActor::PassingThroughDoor" + }, + "parameters": [ + "Actor", + "FloorPlanActor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + }, + { + "description": "Actor", + "name": "Actor", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Floor plan actor", + "name": "FloorPlanActor", + "supplementaryInformation": "RandomFloorPlan::FloorPlanActor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "The number of the door in the floor plan with which the door has been aligned. -1 if not aligned.", + "fullName": "Door number", + "functionType": "Expression", + "name": "DoorNumber", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "AlignedDoorNumber" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle door state between open and closed.", + "fullName": "Toggle door state", + "functionType": "Action", + "name": "ToggleDoor", + "sentence": "Toggle _PARAM0_ state", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanDoor::Open" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanDoor::CloseDoor" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanDoor::OpenDoor" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "AlignWithFloorPlanDoor" + }, + { + "functionName": "CloseDoor" + }, + { + "functionName": "OpenDoor" + }, + { + "functionName": "ToggleDoor" + }, + { + "functionName": "Open" + }, + { + "functionName": "FloorPlanActorCanPassDoor" + }, + { + "functionName": "DoorNumber" + } + ] + }, + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Bottom wall rotation", + "description": "Rotation to apply if added to a bottom wall", + "name": "BottomWallRotation" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Bottom wall animation - opening", + "description": "Animation number to apply if opening a bottom wall door", + "name": "BottomWallAnimationOpening" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Left wall rotation", + "description": "Rotation to apply if added to a left-hand wall", + "name": "LeftWallRotation" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Right wall rotation", + "description": "Rotation to apply if added to a right-hand wall", + "name": "RightWallRotation" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Top wall rotation", + "description": "Rotation to apply if added to a top wall", + "name": "TopWallRotation" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Top wall animation - opening", + "description": "Animation number to apply if opening top wall door", + "name": "TopWallAnimationOpening" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Right wall animation - opening", + "description": "Animation number to apply if opening a right-hand wall door", + "name": "RightWallAnimationOpening" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Left wall animation - opening", + "description": "Animation number to apply if opening a left-hand wall door", + "name": "LeftWallAnimationOpening" + }, + { + "value": "", + "type": "Choice", + "label": "Wall alignment", + "description": "Holds the type of wall to which the door was aligned.", + "choices": [ + { + "label": "Top wall", + "value": "Top" + }, + { + "label": "Bottom wall", + "value": "Bottom" + }, + { + "label": "Left wall", + "value": "Left" + }, + { + "label": "Right wall", + "value": "Right" + } + ], + "hidden": true, + "name": "WallAlignment" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Bottom wall animation - closing", + "description": "Animation number to apply if closing a bottom wall door", + "name": "BottomWallAnimationClosing" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Left wall animation - closing", + "description": "Animation number to apply if closing a left-hand wall door", + "name": "LeftWallAnimationClosing" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Top wall animation - closing", + "description": "Animation number to apply if closing top wall door", + "name": "TopWallAnimationClosing" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Right wall animation - closing", + "description": "Animation number to apply if closing a right-hand wall door", + "name": "RightWallAnimationClosing" + }, + { + "value": "", + "type": "Boolean", + "label": "Open state", + "description": "State of the door. True if opening or open.", + "hidden": true, + "name": "OpenState" + }, + { + "value": "-1", + "type": "Number", + "label": "Door number", + "description": "This is the door number in the floor plan with which the door was aligned.", + "hidden": true, + "name": "AlignedDoorNumber" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "BottomWallRotation" + }, + { + "propertyName": "LeftWallRotation" + }, + { + "propertyName": "RightWallRotation" + }, + { + "propertyName": "TopWallRotation" + }, + { + "propertyName": "BottomWallAnimationOpening" + }, + { + "propertyName": "BottomWallAnimationClosing" + }, + { + "propertyName": "LeftWallAnimationOpening" + }, + { + "propertyName": "LeftWallAnimationClosing" + }, + { + "propertyName": "RightWallAnimationOpening" + }, + { + "propertyName": "RightWallAnimationClosing" + }, + { + "propertyName": "TopWallAnimationOpening" + }, + { + "propertyName": "TopWallAnimationClosing" + }, + { + "propertyName": "OpenState" + }, + { + "propertyName": "AlignedDoorNumber" + }, + { + "propertyName": "WallAlignment" + } + ] + } + }, + { + "description": "Automatically enter and exit rooms via doors.", + "fullName": "Floor plan actor", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWh1bWFuLW1hbGUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIsMkEyLDIgMCAwLDEgMTQsNEEyLDIgMCAwLDEgMTIsNkEyLDIgMCAwLDEgMTAsNEEyLDIgMCAwLDEgMTIsMk0xMC41LDdIMTMuNUEyLDIgMCAwLDEgMTUuNSw5VjE0LjVIMTRWMjJIMTBWMTQuNUg4LjVWOUEyLDIgMCAwLDEgMTAuNSw3WiIgLz48L3N2Zz4=", + "name": "FloorPlanActor", + "objectType": "Sprite", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/ac685637baf20be9e4c4f99d35394482d4ba2f04f27e6b3055d58b91b53e87af_human-male.svg", + "eventsFunctions": [ + { + "description": "Enter sprite via door number.", + "fullName": "Enter sprite via door number", + "functionType": "Action", + "name": "EnterFloorPlanViaDoorNumber", + "sentence": "Enter _PARAM0_ into _PARAM2_ via door number _PARAM4_; duration _PARAM5_ s; fade in: _PARAM6_; mark occupied _PARAM7_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::FindDoorInformation" + }, + "parameters": [ + "FloorplanBuilder", + "BuildFloorPlans", + "DoorNumber", + "DoorInformation", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "DoorInformation.Symbol", + "!=", + "\"\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::CenterSpriteAtGridPos" + }, + "parameters": [ + "FloorplanBuilder", + "BuildFloorPlans", + "Object", + "DoorInformation.Column", + "DoorInformation.Row", + "" + ] + }, + { + "type": { + "value": "Tween::TweenBehavior::AddObjectPositionTween2" + }, + "parameters": [ + "Object", + "Tween", + "MoveThroughDoorTweenId", + "FloorplanBuilder.TileCenterX(DoorInformation.Doorstep.Column, DoorInformation.Doorstep.Row) - Object.Width() / 2", + "FloorplanBuilder.TileCenterY(DoorInformation.Doorstep.Column, DoorInformation.Doorstep.Row) - Object.Height() / 2", + "\"linear\"", + "Duration", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "FadeIn", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectOpacityTween2" + }, + "parameters": [ + "Object", + "Tween", + "FadeInTweenId", + "255", + "\"linear\"", + "Duration", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "MarkAsOccupied", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "RandomFloorPlan::FloorPlanBuilder::MarkGridPositionOccupied" + }, + "parameters": [ + "FloorplanBuilder", + "BuildFloorPlans", + "DoorInformation.Doorstep.Column", + "DoorInformation.Doorstep.Row", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "DoorInformation", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Doorstep", + "type": "structure", + "children": [ + { + "name": "Column", + "type": "number", + "value": 0 + }, + { + "name": "Row", + "type": "number", + "value": 0 + } + ] + }, + { + "name": "Row", + "type": "number", + "value": 0 + }, + { + "name": "Symbol", + "type": "string", + "value": "" + }, + { + "name": "WallAlignment", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanActor", + "type": "behavior" + }, + { + "description": "Floor plan builder", + "name": "FloorplanBuilder", + "supplementaryInformation": "TileMap::SimpleTileMap", + "type": "objectList" + }, + { + "description": "Build floor plans", + "name": "BuildFloorPlans", + "supplementaryInformation": "RandomFloorPlan::FloorPlanBuilder", + "type": "behavior" + }, + { + "description": "Door number", + "name": "DoorNumber", + "type": "expression" + }, + { + "description": "Duration (s)", + "name": "Duration", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Mark as occupied", + "name": "MarkAsOccupied", + "optional": true, + "type": "yesorno" + }, + { + "description": "FadeIn", + "name": "FadeIn", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the actor is currently passing through a door and being moved by the behavior. If it is, the main game should normally stop any interactions.", + "fullName": "Passing through door", + "functionType": "Condition", + "name": "PassingThroughDoor", + "sentence": "_PARAM0_ is passing through door", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::IsPlaying" + }, + "parameters": [ + "Object", + "Tween", + "MoveThroughDoorTweenId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanActor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Exit sprite via door. No check on the alignment of the sprite with the door is made.", + "fullName": "Enter sprite via door", + "functionType": "Action", + "name": "ExitFloorPlanViaDoor", + "sentence": "Exit _PARAM0_ via door _PARAM2_; duration _PARAM4_ s; fade out _PARAM5_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectPositionTween2" + }, + "parameters": [ + "Object", + "Tween", + "MoveThroughDoorTweenId", + "Door.CenterX() - Object.Width() / 2", + "Door.CenterY() - Object.Height() / 2", + "\"linear\"", + "Duration", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "FadeOut", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectOpacityTween2" + }, + "parameters": [ + "Object", + "Tween", + "FadeOutTweenId", + "0", + "\"linear\"", + "Duration", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::FloorPlanActor", + "type": "behavior" + }, + { + "description": "Door", + "name": "Door", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Floor plan door", + "name": "FloorPlanDoor", + "supplementaryInformation": "RandomFloorPlan::FloorPlanDoor", + "type": "behavior" + }, + { + "description": "Duration (s)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Fade out", + "name": "FadeOut", + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "ExitFloorPlanViaDoor" + }, + { + "functionName": "EnterFloorPlanViaDoorNumber" + }, + { + "functionName": "PassingThroughDoor" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "Required behavior to allow movement of sprite.", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "choices": [], + "name": "Tween" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "Tween" + } + ] + } + }, + { + "description": "Simple caching of an object's 2D position. This is primarily to facilitate the restoration of objects in restored floor plans.", + "fullName": "Cacheable object", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNhY2hlZCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOSw4TDE1LDEySDE4QTYsNiAwIDAsMSAxMiwxOEMxMSwxOCAxMC4wMywxNy43NSA5LjIsMTcuM0w3Ljc0LDE4Ljc2QzguOTcsMTkuNTQgMTAuNDMsMjAgMTIsMjBBOCw4IDAgMCwwIDIwLDEySDIzTTYsMTJBNiw2IDAgMCwxIDEyLDZDMTMsNiAxMy45Nyw2LjI1IDE0LjgsNi43TDE2LjI2LDUuMjRDMTUuMDMsNC40NiAxMy41Nyw0IDEyLDRBOCw4IDAgMCwwIDQsMTJIMUw1LDE2TDksMTIiIC8+PC9zdmc+", + "name": "CacheableObject", + "objectType": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/4876af2dc79a7a4e44305a9f41b469d22e635d6b01239756ee61442e6d78145e_cached.svg", + "eventsFunctions": [ + { + "description": "Cache the current position (x, y, angle).", + "fullName": "Cache current position", + "functionType": "Action", + "name": "CacheCurrentPosition", + "sentence": "Cache _PARAM0_ current position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CachedX", + "=", + "Object.X()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CachedY", + "=", + "Object.Y()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CachedAngle", + "=", + "Object.Angle()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::CacheableObject", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Restore the cached position (x, y, angle).", + "fullName": "Restore cached position", + "functionType": "Action", + "name": "RestoreCachedPosition", + "sentence": "Restore _PARAM0_ cached position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetX" + }, + "parameters": [ + "Object", + "=", + "CachedX" + ] + }, + { + "type": { + "value": "SetY" + }, + "parameters": [ + "Object", + "=", + "CachedY" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "CachedAngle" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RandomFloorPlan::CacheableObject", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "CacheCurrentPosition" + }, + { + "functionName": "RestoreCachedPosition" + } + ] + }, + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Cached angle", + "description": "Cached angle", + "hidden": true, + "name": "CachedAngle" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Cached y", + "description": "Cached y position", + "hidden": true, + "name": "CachedY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Cached x position", + "description": "Cached x position", + "hidden": true, + "name": "CachedX" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "CachedAngle" + }, + { + "propertyName": "CachedY" + }, + { + "propertyName": "CachedX" + } + ] + } + } + ], + "eventsBasedObjects": [] +}