{"name":"createLocation","operator":null,"title":"createLocation","type":"command","url":"https://community.bistudio.com/wiki/createLocation","revid":322768,"updated":"2022-06-23T13:56:55Z","groups":["Locations"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.08"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.08"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Creates a location of the specified class and dimensions at the specified position.\nClasses are defined in `CfgLocationTypes`; for possible location types see Location Types.\n\nThe alternative syntax allows to convert a non-editable (built-in) terrain location into an editable one, with the following restrictions:\n- it cannot be deleted (but can be setType to \"Invisible\" to hide it)\n- it cannot be moved","syntaxes":[{"syntax":"createLocation [className, position, sizeX, sizeY]","since":null,"effect":null,"exec":null,"params":[{"name":"className","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"className: String"},{"name":"position","type":"Position2D, Position3D or Object","optional":false,"default":null,"description":null,"types":["Position2D","Position3D","Object"],"since":null,"text":"position: Position2D, Position3D or Object"},{"name":"sizeX","type":"Number","optional":false,"default":null,"description":"in meters","types":["Number"],"since":null,"text":"sizeX: Number - in meters"},{"name":"sizeY","type":"Number","optional":false,"default":null,"description":"in meters","types":["Number"],"since":null,"text":"sizeY: Number - in meters"}],"returns":{"type":"Location","types":["Location"],"description":null,"text":"Location"},"form":"unary","operator":null,"left":null,"right":{"text":"[className, position, sizeX, sizeY]","types":["Array"]}},{"syntax":"createLocation [location]","since":"arma3 2.10","effect":null,"exec":null,"params":[{"name":"location","type":"Location","optional":false,"default":null,"description":"a terrain's location. If a scripted location is provided, it is simply returned","types":["Location"],"since":null,"text":"location: Location - a terrain's location. If a scripted location is provided, it is simply returned"}],"returns":{"type":"Location","types":["Location"],"description":"a script-editable location","text":"Location - a script-editable location"},"form":"unary","operator":null,"left":null,"right":{"text":"[location]","types":["Array"]}}],"examples":[{"text":"```sqf\n_location = createLocation [\"NameVillage\", [4035,2151,10], 100, 100];\n```","code":["_location = createLocation [\"NameVillage\", [4035,2151,10], 100, 100];"]},{"text":"```sqf\n_location = createLocation [\"NameVillage\", [4035,2151,10], 30, 30];\n_location setText \"Player town\";\n```","code":["_location = createLocation [\"NameVillage\", [4035,2151,10], 30, 30];\n_location setText \"Player town\";"]},{"text":"```sqf\nprivate _terrainLocation = nearestLocation [player, \"nameCity\"];    // assuming it returns a built-in location\n_terrainLocation setType \"Invisible\";                                // does not do anything\nprivate _editableLocation = createLocation [_terrainLocation];        // does the conversion\n_editableLocation setType \"Invisible\";                                // hides the location\n```","code":["private _terrainLocation = nearestLocation [player, \"nameCity\"];\t// assuming it returns a built-in location\n_terrainLocation setType \"Invisible\";\t\t\t\t\t\t\t\t// does not do anything\nprivate _editableLocation = createLocation [_terrainLocation];\t\t// does the conversion\n_editableLocation setType \"Invisible\";\t\t\t\t\t\t\t\t// hides the location"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setText","nearestLocation","nearestLocations","locationPosition","nearestLocationWithDubbing","setRectangular","rectangular","size"],"notes":[],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Locations","Introduced with Armed Assault version 1.08","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}