setTerrainHeight: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Some wiki formatting) |
Lou Montana (talk | contribs) (Add Global Effect + Server Only) |
||
Line 5: | Line 5: | ||
|branch= dev | |branch= dev | ||
|eff= global | |||
|serverExec= server | |||
|gr1= Diagnostic | |gr1= Diagnostic | ||
Line 14: | Line 18: | ||
** are internally converted (rounded) to heightmap coordinates | ** are internally converted (rounded) to heightmap coordinates | ||
** are stored in the JIP queue | ** are stored in the JIP queue | ||
** are '''not''' removed if the | ** are '''not''' removed from the JIP queue if the values are set back to terrain's default value | ||
** are updated in the JIP queue for updated positions '''if''' the same group of positions are edited (order does not matter, but amount does) | ** are updated in the JIP queue for updated positions '''if''' the same group of positions are edited (order does not matter, but amount does) | ||
** are '''not''' updated and sent twice (old one then new one) if position edits are not exactly the same (see point above and {{Link|#Example 2}}). | ** are '''not''' updated and sent twice (old one then new one) if position edits are not exactly the same (see point above and {{Link|#Example 2}}). |
Revision as of 15:17, 22 June 2022
Description
- Description:
Set the current terrain's altitude on provided location(s).
- Groups:
- Diagnostic
Syntax
- Syntax:
- setTerrainHeight [positionAndAltitudeArray, adjustObjects]
- Parameters:
- positionAndAltitudeArray: Array of Array in format PositionASL - [[x1, y1, newASLHeight1], [x2, y2, newASLHeight2], ... ]
- adjustObjects: Boolean - (Optional, default true) if true then objects on modified points are moved up/down to keep the same ATL height
- Return Value:
- Nothing
Examples
- Example 1:
- private _fnc_flattenTerrain = { params ["_start", "_a", "_b", "_h"]; private _newPositions = []; for "_xStep" from 0 to _a do { for "_yStep" from 0 to _b do { private _newHeight = _start vectorAdd [_xStep, _yStep, 0]; _newHeight set [2, _h]; _newPositions pushBack _newHeight; }; }; _newPositions; }; private _desiredTerrainHeight = 150; setTerrainHeight [[getPosWorld player, 50, 50, _desiredTerrainHeight] call _fnc_flattenTerrain, true];
- Example 2:
- Bad example:
Good example:// first update setTerrainHeight [[1000, 1000, 25], [1005, 1000, 25]]; // second update setTerrainHeight [[1005, 1000, 50]]; // this will make the JIP queue keep both messages// first update setTerrainHeight [[1000, 1000, 25], [1005, 1000, 25]]; // second update setTerrainHeight [[1000, 1000, 25], [1005, 1000, 50]]; // this will update the JIP queue properly
Additional Information
- See also:
- getTerrainInfo 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