{"name":"diag_setTerrainHeight","operator":null,"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":[{"game":"arma3","name":"Arma 3","version":"2.06"}],"since":{"game":"arma3","name":"Arma 3","version":"2.06"},"arma3_since":"2.06","branch":"diag","locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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**. This command is subject to be removed and replaced with: setTerrainHeight","syntaxes":[{"syntax":"position diag_setTerrainHeight height","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":"Position","optional":false,"default":null,"description":null,"types":["Position"],"since":null,"text":"position: Position"},{"name":"height","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"height: Number"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"position","types":["Position"]},"right":{"text":"height","types":["Number"]}}],"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;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["diag_getTerrainHeight"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Arma 3: Scripting Commands: Diagnostic Branch","Command Group: Diagnostic","Introduced with Arma 3 version 2.06","Scripting Commands"]}