diag setTerrainHeight: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(formatting)
m (Text replacement - "{{HashLink" to "{{Link")
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


|game1= arma3diag
|game1= arma3
|version1= 2.06


|version1= 2.05
|branch= diag


|descr= Changes the terrain height of the cell in which given position lies. This command is only available with [[Arma 3: Diagnostics Exe]].</br>
|descr= Changes the terrain height of the cell in which given position lies. This command is only available with [[Arma 3: Diagnostics Exe]].
[[File:A3 diag setTerrainHeight.png|350px|See Example 1 for the code|thumb|right]]
[[File:A3 diag setTerrainHeight.png|thumb|350px|See {{Link|#Example 1}} for the code]]
{{Feature|warning|This causes an instant CTD when ''position'' is out of the map! ({{hl|&lt; 0}} and/or {{hl|&gt; [[worldSize]]}})}}
{{Feature|obsolete|This command is subject to be removed and replaced with: [[setTerrainHeight]]|arma3|2.10}}


|gr1= Diagnostic
|gr1= Diagnostic


|s1= position [[{{PAGENAMEE}}]] height
|s1= position [[diag_setTerrainHeight]] height


|p1= position: [[Array]] - In format [[Position]]
|p1= position: [[Array]] in format [[Position]]


|p2= height: [[Number]]
|p2= height: [[Number]]


|x1= <code>[[private]] _fnc_flattenTerrain [[a = b|=]]
|r1= [[Nothing]]
 
|x1= <sqf>
private _fnc_flattenTerrain =
{
{
  [[params]] ["_start", "_a", "_b", "_h"];
params ["_start", "_a", "_b", "_h"];


  [[for]] "_xStep" [[from]] 0 [[to]] _a [[do]]
for "_xStep" from 0 to _a do
  {
{
    [[for]] "_yStep" [[from]] 0 [[to]] _b [[do]]
for "_yStep" from 0 to _b do
    {
{
      _start [[vectorAdd]] [_xStep, _yStep, 0] '''diag_setTerrainHeight''' _h;
_start vectorAdd [_xStep, _yStep, 0] diag_setTerrainHeight _h;
    };
};
  };
};
};
};


<nowiki>[</nowiki>[[position]] [[player]], 50, 50, 150] [[spawn]] _fnc_flattenTer[[rain]];</code>
private _desiredTerrainHeight = 150;
[getPosWorld player, 50, 50, _desiredTerrainHeight] spawn _fnc_flattenTerrain;
</sqf>


|seealso=
|seealso= [[diag_getTerrainHeight]]
}}
}}

Latest revision as of 17:43, 4 January 2023

Hover & click on the images for description
Only available in Diagnostic branch(es).

Description

Description:
Changes the terrain height of the cell in which given position lies. This command is only available with Arma 3: Diagnostics Exe.
See Example 1 for the code
This causes an instant CTD when position is out of the map! (< 0 and/or > worldSize)
🕖
This information is obsolete as of Arma 3 v2.10. Reason: This command is subject to be removed and replaced with: setTerrainHeight
Groups:
Diagnostic

Syntax

Syntax:
position diag_setTerrainHeight height
Parameters:
position: Array in format Position
height: Number
Return Value:
Nothing

Examples

Example 1:
private _fnc_flattenTerrain = { params ["_start", "_a", "_b", "_h"]; for "_xStep" from 0 to _a do { for "_yStep" from 0 to _b do { _start vectorAdd [_xStep, _yStep, 0] diag_setTerrainHeight _h; }; }; }; private _desiredTerrainHeight = 150; [getPosWorld player, 50, 50, _desiredTerrainHeight] spawn _fnc_flattenTerrain;

Additional Information

See also:
diag_getTerrainHeight

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note