---
name: "createLocation"
type: command
status: ok
groups: ["Locations"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/createLocation
revid: 322768
updated: 2022-06-23T13:56:55Z
---

# createLocation

*Command · Locations · Arma 3 v0.50 · introduced in Armed Assault v1.08*

Locality: effect **local**

## 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](../topics/Location.md#location-types).

The alternative syntax allows to convert a non-editable (built-in) terrain location into an editable one, with the following restrictions:
- it cannot be deleted (but can be [setType](../commands/setType.md) to "Invisible" to hide it)
- it cannot be moved

## Syntax

### Syntax 1

```sqf
createLocation [className, position, sizeX, sizeY]
```

**Parameters:**

- `className`: [String](../topics/String.md)
- `position`: [Position2D](../topics/Position.md#introduction), [Position3D](../topics/Position.md#introduction) or [Object](../topics/Object.md)
- `sizeX`: [Number](../topics/Number.md) - in meters
- `sizeY`: [Number](../topics/Number.md) - in meters

**Returns:** [Location](../topics/Location.md)

### Syntax 2

*since arma3 2.10*

```sqf
createLocation [location]
```

**Parameters:**

- `location`: [Location](../topics/Location.md) - a terrain's location. If a scripted location is provided, it is simply returned

**Returns:** [Location](../topics/Location.md) - a script-editable location

## Examples

### Example 1

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

### Example 2

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

### Example 3

```sqf
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](../commands/setText.md) · [nearestLocation](../commands/nearestLocation.md) · [nearestLocations](../commands/nearestLocations.md) · [locationPosition](../commands/locationPosition.md) · [nearestLocationWithDubbing](../commands/nearestLocationWithDubbing.md) · [setRectangular](../commands/setRectangular.md) · [rectangular](../commands/rectangular.md) · [size](../commands/size.md)

<sub>Source: [BI Community Wiki — createLocation](https://community.bistudio.com/wiki/createLocation) (revision 322768).</sub>
