-
Notifications
You must be signed in to change notification settings - Fork 103
Lua_SyncedControl
The original height map represents the correct levels that the map should have if the map has sustained no damage and used by the restore terrain command to determine what the correct level should be.
Note that this does not affect the current height map. You will need to call LevelHeightMap to change the map's current terrain levels.
Adds the given height (which can be negative) the original height map in the specified area.
Change the original height map to a specific value in the specified area.
Restore an area of the original height map to the levels as first read from the map file.
Spring.SetOriginalHeightMapFunc( lua_function [, arg1 [, arg2 [, ... ]]] ) -> nil | number absTotalOriginalHeightMapAmountChanged
Use a custom function to change the original height map. These custom functions have to use special function to apply the changes to the original height map: AddOriginalHeightMap and SetOriginalHeightMap (see the following functions)
Example code:
Spring.SetOriginalHeightMapFunc(function()
for z=0,Game.mapSizeZ, Game.squareSize do
for x=0,Game.mapSizeX, Game.squareSize do
Spring.SetOriginalHeightMap( x, z, 200 + 20 * math.cos((x + z) / 90) )
end
end
end)
Can only be called in SetHeightMapFunc()