Map

Properties


camera

VisualCamera object with information about the position of the camera in visual mode. Read-only.


isDoom

true if the map is in Doom format, false if it isn't. Read-only.


isHexen

true if the map is in Hexen format, false if it isn't. Read-only.


isUDMF

true if the map is in UDMF, false if it isn't. Read-only.


mousePosition

The map coordinates of the mouse position as a Vector2D. Read-only.

Methods


clearAllMarks(mark: bool)

Sets the marked property of all map elements. Can be passed true to mark all map elements.

Parameters

  • mark: false to set the marked property to false (default), true to set the marked property to true

clearAllSelected()

Clears all selected map elements.


clearMarkeLinedefs(mark: bool)

Sets the marked property of all Linedefs. Can be passed true to mark all Linedefs.

Parameters

  • mark: false to set the marked property to false (default), true to set the marked property to true

clearMarkeSectors(mark: bool)

Sets the marked property of all Sectors. Can be passed true to mark all Sectors.

Parameters

  • mark: false to set the marked property to false (default), true to set the marked property to true

clearMarkeSidedefs(mark: bool)

Sets the marked property of all Sidedefs. Can be passed true to mark all Sidedefs.

Parameters

  • mark: false to set the marked property to false (default), true to set the marked property to true

clearMarkedThings(mark: bool)

Sets the marked property of all Things. Can be passed true to mark all Things.

Parameters

  • mark: false to set the marked property to false (default), true to set the marked property to true

clearMarkedVertices(mark: bool)

Sets the marked property of all vertices. Can be passed true to mark all vertices.

Parameters

  • mark: false to set the marked property to false (default), true to set the marked property to true

clearSelectedSectors()

Clears all selected Sectors.


clearSelectedThings()

Clears all selected Things.


clearSelectedVertices()

Clears all selected vertices.


createThing(pos: object, type: int)

Creates a new Thing at the given position. The position can be a Vector2D, Vector3D, or an Array of two numbers or three numbers (note that the z position only works for game configurations that support vertical pos. A thing type can be supplied optionally.

var t1 = UDB.Map.createThing(new UDB.Vector2D(32, 64));
var t2 = UDB.Map.createThing([ 32, 64 ]);
var t3 = UDB.Map.createThing(new UDB.Vector2D(32, 64), 3001); // Create an Imp
var t4 = UDB.Map.createThing([ 32, 64 ], 3001); // Create an Imp

Parameters

  • pos: Position where the Thing should be created at
  • type: Thing type (optional)

Return value

The new Thing


createVertex(pos: object)

Creates a new Vertex at the given position. The position can be a Vector2D or an Array of two numbers.

var v1 = UDB.Map.createVertex(new Vector2D(32, 64));
var v2 = UDB.Map.createVertex([ 32, 64 ]);

Parameters

  • pos: Position where the Vertex should be created at

Return value

The created Vertex


drawLines(data: object)

Draws lines. Data has to be an Array of Array of numbers, Vector2Ds, Vector3Ds, or objects with x and y properties. Note that the first and last element have to be at the same positions to make a complete drawing.

UDB.Map.drawLines([
    new UDB.Vector2D(64, 0),
    new UDB.Vector2D(128, 0),
    new UDB.Vector2D(128, 64),
    new UDB.Vector2D(64, 64),
    new UDB.Vector2D(64, 0)
]);

UDB.Map.drawLines([
    [ 0, 0 ],
    [ 64, 0 ],
    [ 64, 64 ],
    [ 0, 64 ],
    [ 0, 0 ]
]);

Parameters

  • data: Array of positions

Return value

true if drawing was successful, false if it wasn't


getHighlightedLinedef()

Get the currently highlighted Linedef.

Return value

The currently highlighted Linedef or null if no Linedef is highlighted


getHighlightedSector()

Get the currently highlighted Sector.

Return value

The currently highlighted Sector or null if no Sector is highlighted


getHighlightedThing()

Get the currently highlighted Thing.

Return value

The currently highlighted Thing or null if no Thing is highlighted


getHighlightedVertex()

Get the currently highlighted Vertex.

Return value

The currently highlighted Vertex or null if no Vertex is highlighted


getLinedefs()

Returns an Array of all Linedefs in the map.

Return value

Array of Linedefs


getMarkedLinedefs(mark: bool)

Gets all marked (default) or unmarked Linedefs.

Parameters

  • mark: true to get all marked Linedefs (default), false to get all unmarked Linedefs

Return value

missing


getMarkedSectors(mark: bool)

Gets all marked (default) or unmarked Sectors.

Parameters

  • mark: true to get all marked Sectors (default), false to get all unmarked Sectors

Return value

missing


getMarkedSidedefs(mark: bool)

Gets all marked (default) or unmarked Sidedefs.

Parameters

  • mark: true to get all marked Sidedefs (default), false to get all unmarked Sidedefs

Return value

missing


getMarkedThings(mark: bool)

Gets all marked (default) or unmarked Things.

Parameters

  • mark: true to get all marked Things (default), false to get all unmarked Things

Return value

missing


getMarkedVertices(mark: bool)

Gets all marked (default) or unmarked vertices.

Parameters

  • mark: true to get all marked vertices (default), false to get all unmarked vertices

Return value

missing


getMultipleNewTags(count: int)

Gets multiple new tags.

Parameters

  • count: Number of tags to get

Return value

Array of the new tags


getNewTag(usedtags: int[])

Gets a new tag.

Parameters

  • usedtags: Array of tags to skip

Return value

The new tag


getSectors()

Returns an Array of all Sectors in the map.

Return value

Array of Sectors


getSelectedLinedefs(selected: bool)

Gets all selected (default) or unselected Linedefs.

Parameters

  • selected: true to get all selected Linedefs, false to get all unselected ones

Return value

Array of Linedefs


getSelectedOrHighlightedLinedefs()

Gets the currently selected Linedefs or, if no Linedefs are selected, a currently highlightedLinedef`.

Return value

Array of Linedefs


getSelectedOrHighlightedSectors()

Gets the currently selected Sectors or, if no Sectors are selected, a currently highlighted Sector.

Return value

Array of Sectors


getSelectedOrHighlightedThings()

Gets the currently selected Things or, if no Things are selected, a currently highlighted Thing.

Return value

Array of Things


getSelectedOrHighlightedVertices()

Gets the currently selected Vertexs or, if no Vertexs are selected, a currently highlighted Vertex.

Return value

Array of Vertex


getSelectedSectors(selected: bool)

Gets all selected (default) or unselected Sectors.

Parameters

  • selected: true to get all selected Sectors, false to get all unselected ones

Return value

Array of Sectors


getSelectedThings(selected: bool)

Gets all selected (default) or unselected Things.

Parameters

  • selected: true to get all selected Things, false to get all unselected ones

Return value

Array of Things


getSelectedVertices(selected: bool)

Gets all selected (default) or unselected vertices.

Parameters

  • selected: true to get all selected vertices, false to get all unselected ones

Return value

Array of Vertex


getSidedefs()

Returns an Array of all Sidedefs in the map.

Return value

Array of Sidedefs


getSidedefsFromSelectedLinedefs(selected: bool)

Gets all Sidedefs from the selected Linedefs. In classic modes this will return both sidedefs of 2-sided lines, in visual mode it will only return the actually selected Sidedef.

Parameters

  • selected: true to get all Sidedefs of all selected Linedefs, false to get all Sidedefs of all unselected Linedefs

Return value

Array of Sidedef


Version: 3

getSidedefsFromSelectedOrHighlightedLinedefs()

Gets the Sidedefs of the currently selected Linedefs or, if no Linedefs are selected, the Sidedefs of the currently highlighted Linedef. In classic modes this will return both sidedefs of 2-sided lines, in visual mode it will only return the actually selected Sidedef.

Return value

Array of Sidedefs


getThings()

Returns an Array of all Things in the map.

Return value

Array of Things


getVertices()

Returns an Array of all Vertex in the map.

Return value

Array of Vertex


invertAllMarks()

Inverts all marks of all map elements.


invertMarkedLinedefs()

Inverts the marked property of all Linedefs.


invertMarkedSectors()

Inverts the marked property of all Sectors.


invertMarkedSidedefs()

Inverts the marked property of all Sidedefs.


invertMarkedThings()

Inverts the marked property of all Things.


invertMarkedVertices()

Inverts the marked property of all vertices.


joinSectors(sectors: Sector[])

Joins Sectors, keeping lines shared by the Sectors. All Sectors will be joined with the first Sector in the array.

Parameters

  • sectors: Array of Sectors

markSelectedLinedefs(mark: bool)

Marks (default) or unmarks all selected Linedefs.

Parameters

  • mark: true to mark all selected Linedefs (default), false to unmark

markSelectedSectors(mark: bool)

Marks (default) or unmarks all selected Sectors.

Parameters

  • mark: true to mark all selected Sectors (default), false to unmark

markSelectedThings(mark: bool)

Marks (default) or unmarks all selected Things.

Parameters

  • mark: true to mark all selected Things (default), false to unmark

markSelectedVertices(mark: bool)

Marks (default) or unmarks all selected vertices.

Parameters

  • mark: true to mark all selected vertices (default), false to unmark

mergeSectors(sectors: Sector[])

Merges Sectors, deleting lines shared by the Sectors. All Sectors will be merged into the first Sector in the array.

Parameters

  • sectors: Array of Sectors

nearestLinedef(pos: object, maxrange: double)

Gets the Linedef that's nearest to the specified position.

Parameters

  • pos: Position to check against
  • maxrange: Maximum range (optional)

Return value

Nearest Linedef


nearestSidedef(pos: object)

Gets the Sidedef that's nearest to the specified position.

Parameters

  • pos: Position to check against
  • maxrange: Maximum range (optional)

Return value

Nearest Sidedef


nearestThing(pos: object, maxrange: double)

Gets the Thing that's nearest to the specified position.

Parameters

  • pos: Position to check against
  • maxrange: Maximum range (optional)

Return value

Nearest Linedef


nearestVertex(pos: object, maxrange: double)

Gets the Vertex that's nearest to the specified position.

Parameters

  • pos: Position to check against
  • maxrange: Maximum range (optional)

Return value

Nearest Vertex


snapAllToAccuracy(usepreciseposition: bool)

Snaps all vertices and things to the map format accuracy. Call this to ensure the vertices and things are at valid coordinates.

Parameters

  • usepreciseposition: true if decimal places defined by the map format should be used, false if no decimal places should be used

snappedToGrid(pos: object)

Returns the given point snapped to the current grid.

Parameters

  • pos: Point that should be snapped to the grid

Return value

Snapped position as Vector2D


stitchGeometry(mergemode: MergeGeometryMode)

Stitches marked geometry with non-marked geometry.

Parameters

  • mergemode: Mode to merge by as MergeGeometryMode

Return value

true if successful, false if failed

Enums


Version: 5

MergeGeometryMode

How geometry should be merged when geometry is stitched.

UDB.Map.stitchGeometry(UDB.Map.MergeometryMode.MERGE);

Options

  • CLASSIC: Merge vertices only
  • MERGE: Merge vertices and lines
  • REPLACE: Merge vertices and lines, replacing sector geometry