Map
┗> Class
Stores and manages the currently loaded map.
If a map in scrips/world/maps is defined as a folder, map data can be placed in data.lua, and a file named map.lua can be used to define a custom Map object for that map.
Methods
Map:addTileLayer(depth: any, battle_border: any)
Arguments:
| depth: any | |
| battle_border: any |
Returns:
| 1: TileLayer |
Map:createTileObject(data: any, x: any, y: any, width: any, height: any)
Arguments:
| data: any | |
| x: any | |
| y: any | |
| width: any | |
| height: any |
Returns:
| 1: TileObject |
Map:draw()
Map:getEvent(id: string|number)
Gets a specific event present in the current map.
@param id — The unique numerical id of an event OR the text id of an event type to get the first instance of.
@return event — The event instnace, or nil if it was not found.
Arguments:
| id: string|number | The unique numerical id of an event OR the text id of an event type to get the first instance of. |
Returns:
| event: Event? | The event instnace, or |
Map:getEvents(name: string?)
Gets a list of all instances of one type of event in the current maps
@param name — The text id of the event to search for, fetches every event if nil
@return events — A table containing every instance of the event in the current map
Arguments:
| name: string? | The text id of the event to search for, fetches every event if |
Returns:
| events: Event[] | A table containing every instance of the event in the current map |
Map:getMarker(name: string)
Gets a specific marker from the current map.
@param name — The name of the marker to search for.
@return x — The x-coordinate of the marker's center.
@return y — The y-coordinate of the marker's center.
Arguments:
| name: string | The name of the marker to search for. |
Returns:
| x: number | The x-coordinate of the marker's center. |
| y: number | The y-coordinate of the marker's center. |
Map:getTile(x: any, y: any, layer: any)
Arguments:
| x: any | |
| y: any | |
| layer: any |
Returns:
| 1: unknown|nil | |
| 2: integer|unknown |
Map:getTileObjectRect(data: any)
Arguments:
| data: any |
Returns:
| 1: unknown | |
| 2: unknown | |
| 3: unknown | |
| 4: unknown |
Map:load()
Map:loadController(name: any, data: any)
Arguments:
| name: any | |
| data: any |
Returns:
| 1: Event|FountainShadowController|Object|ToggleController|unknown |
Map:loadObject(name: any, data: any)
Arguments:
| name: any | |
| data: any |
Returns:
| 1: CameraTarget|ChaserEnemy|CyberTrashCan|DarkFountain|Event...(+24) |
Map:loadObjects(layer: any, depth: any, layer_type: any)
Arguments:
| layer: any | |
| depth: any | |
| layer_type: any |
Fields
Undocumented
Map.depth_per_layer: number
its not perfect, but i doubt anyone will have 1000 layers
Map.object_layer: unknown
If there are no object layers, set the object depth to the marker layer's depth
Map.tile_layer: integer
Set the tile layer depth to the closest tile layer below the object layer