diag setTerrainHeight: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Warning note)
mNo edit summary
(One intermediate revision by one other user not shown)
Line 2: Line 2:


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


|branch= diag
|branch= diag


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


|gr1= Diagnostic
|gr1= Diagnostic
Line 18: Line 17:


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


|x1= <code>[[private]] _fnc_flattenTerrain [[a = b|=]]
|x1= <code>[[private]] _fnc_flattenTerrain [[a = b|=]]
{
{
  [[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_flattenTerrain;</code>
[<nowiki/>[[position]] [[player]], 50, 50, 150] [[spawn]] _fnc_flattenTerrain;</code>


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

Revision as of 13:04, 9 October 2021

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)
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; }; }; }; [position player, 50, 50, 150] 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