setTerrainHeight: Difference between revisions
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.10 |branch= dev |gr1= Diagnostic |descr= {{Wiki|WIP}} |s1= setTerrainHeight |r1= Nothing |x1= <sqf>setTerrainHeight...") |
(Fill in some data) |
||
Line 9: | Line 9: | ||
|descr= {{Wiki|WIP}} | |descr= {{Wiki|WIP}} | ||
Warning, this command is dangerous and if used incorrectly will cause issues. | |||
Heightmap changes are stored in JIP queue, when doing multiple command invocations with the exact same XY positions (same number, same coordinates, order can be different) and different heights, the JIP messages will be merged which saves memory and network bandwidth and performance (each message is processed seperately) for joining clients. | |||
If even just one position is missing or extra or different a new JIP message will be created, each new client will get the old and the new message, which costs bandwidth and performance because the client has to process both heightmap updates seperately. | |||
JIP messages do NOT remove themselves if all positions are returned back to their original values, so if changes to different areas are done during a mission, they will accumulate in JIP queue. | |||
setTerrainHeight should be used to set the height of an "area", and if that area should be further adjusted, the whole area should be adjusted and not just a subsection of it. | |||
|s1= [[setTerrainHeight]] | |s1= [[setTerrainHeight]] | ||
Line 14: | Line 25: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <sqf>setTerrainHeight [ [ [X, Y, NewHeight], [X2, Y2, NewHeight2] ], adjustObjects];</sqf> | |x1= <sqf>setTerrainHeight [ [ [X, Y, NewHeight], [X2, Y2, NewHeight2], ... ], adjustObjects];</sqf> | ||
|p1= [ [X, Y, NewHeight], ... ]: [[Array]] of [[Array]] in format [[PositionASL]] | |||
XY are world coordinates, and are internally converted to heightmap coordinates like so | |||
<sqf> | |||
_hRes = (getTerrainInfo select 3) | |||
_heightmapCoordinates = [round(_x/_hRes), round(_y/_hres)]; | |||
</sqf> | |||
|p2= adjustObjects: [[Bool]] optional, default true. If true then objects on modified points are moved up/down to keep the same ATL height (Danger! Even objects in the sky above modified terrain are adjusted) | |||
|seealso= | |seealso= [[getTerrainInfo]] [[getTerrainHeight]] | ||
}} | }} |
Revision as of 13:14, 20 June 2022
Description
- Description:
Warning, this command is dangerous and if used incorrectly will cause issues.
Heightmap changes are stored in JIP queue, when doing multiple command invocations with the exact same XY positions (same number, same coordinates, order can be different) and different heights, the JIP messages will be merged which saves memory and network bandwidth and performance (each message is processed seperately) for joining clients.
If even just one position is missing or extra or different a new JIP message will be created, each new client will get the old and the new message, which costs bandwidth and performance because the client has to process both heightmap updates seperately.
JIP messages do NOT remove themselves if all positions are returned back to their original values, so if changes to different areas are done during a mission, they will accumulate in JIP queue.
setTerrainHeight should be used to set the height of an "area", and if that area should be further adjusted, the whole area should be adjusted and not just a subsection of it.- Groups:
- Diagnostic
Syntax
- Syntax:
- setTerrainHeight
- Parameters:
- [ [X, Y, NewHeight], ... ]: Array of Array in format PositionASL XY are world coordinates, and are internally converted to heightmap coordinates like so
- adjustObjects: Bool optional, default true. If true then objects on modified points are moved up/down to keep the same ATL height (Danger! Even objects in the sky above modified terrain are adjusted)
- Return Value:
- Nothing
Examples
- Example 1:
- setTerrainHeight [ [ [X, Y, NewHeight], [X2, Y2, NewHeight2], ... ], adjustObjects];
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