Arma 3 Scripting

Command in Locations

createLocation

Also available as Markdown and JSON, or read the original wiki page.

Description

Creates a location of the specified class and dimensions at the specified position. Classes are defined in CfgLocationTypes; for possible location types see Location Types.

The alternative syntax allows to convert a non-editable (built-in) terrain location into an editable one, with the following restrictions:

Syntax

Syntax 1

createLocation [className, position, sizeX, sizeY]

Parameters:

Returns: Location

Syntax 2

since arma3 2.10

createLocation [location]

Parameters:

Returns: Location - a script-editable location

Examples

Example 1

_location = createLocation ["NameVillage", [4035,2151,10], 100, 100];

Example 2

_location = createLocation ["NameVillage", [4035,2151,10], 30, 30];
_location setText "Player town";

Example 3

private _terrainLocation = nearestLocation [player, "nameCity"];    // assuming it returns a built-in location
_terrainLocation setType "Invisible";                                // does not do anything
private _editableLocation = createLocation [_terrainLocation];        // does the conversion
_editableLocation setType "Invisible";                                // hides the location

See also

setText · nearestLocation · nearestLocations · locationPosition · nearestLocationWithDubbing · setRectangular · rectangular · size