{"name":"diag_setTerrainHeight","title":"diag setTerrainHeight","type":"command","url":"https://community.bistudio.com/wiki/diag_setTerrainHeight","revid":377518,"updated":"2026-01-02T06:52:04Z","groups":["Diagnostic"],"status":"deprecated","replaced_by":["setTerrainHeight"],"games":{"arma3":"2.06"},"since":"arma3 2.06","arma3_since":"2.06","branch":["diag"],"description":"Changes the terrain height of the cell in which given position lies. This command is only available with Arma 3: Diagnostics Exe.\n\n> [!WARNING]\n> This causes an instant CTD when *position* is out of the map! (`< 0` and/or `> worldSize`)\n\n> [!CAUTION]\n> This information is **obsolete** as of Arma 3 v2.10. Reason: This command is subject to be removed and replaced with: setTerrainHeight","syntaxes":[{"syntax":"position diag_setTerrainHeight height","params":[{"name":"position","type":"Position","type_expr":"Position"},{"name":"height","type":"Number","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"position"},"right":{"text":"height"}}],"examples":[{"text":"```sqf\nprivate _fnc_flattenTerrain =\n{\n    params [\"_start\", \"_a\", \"_b\", \"_h\"];\n\n    for \"_xStep\" from 0 to _a do\n    {\n        for \"_yStep\" from 0 to _b do\n        {\n            _start vectorAdd [_xStep, _yStep, 0] diag_setTerrainHeight _h;\n        };\n    };\n};\n\nprivate _desiredTerrainHeight = 150;\n[getPosWorld player, 50, 50, _desiredTerrainHeight] spawn _fnc_flattenTerrain;\n```","code":["private _fnc_flattenTerrain =\n{\n\tparams [\"_start\", \"_a\", \"_b\", \"_h\"];\n\n\tfor \"_xStep\" from 0 to _a do\n\t{\n\t\tfor \"_yStep\" from 0 to _b do\n\t\t{\n\t\t\t_start vectorAdd [_xStep, _yStep, 0] diag_setTerrainHeight _h;\n\t\t};\n\t};\n};\n\nprivate _desiredTerrainHeight = 150;\n[getPosWorld player, 50, 50, _desiredTerrainHeight] spawn _fnc_flattenTerrain;"]}],"see_also":["diag_getTerrainHeight"]}