There had been some requests for custom brushes, being squares, random or dependent on terrain height / slope.
Well, that might be possible and come in the future.
![](https://d3qgdrtcrfbzr5.cloudfront.net/files_production/acc_2007/koLA?response-content-disposition=inline%3B filename%3DScreenshot%25202012-06-05%2520at%252010.55.38.png)
![](https://d3qgdrtcrfbzr5.cloudfront.net/files_production/acc_2007/vYDa?response-content-disposition=inline%3B filename%3DScreenshot%25202012-06-05%2520at%252010.55.19.png)
![](https://d3qgdrtcrfbzr5.cloudfront.net/files_production/acc_2007/mB7i?response-content-disposition=inline%3B filename%3DScreenshot%25202012-06-05%2520at%252010.54.36.png)
What is needed for this? LUA.
function brush_random (_, _, _, _, _, _)
return math.random()
end
function brush_square (_, _, _, _, pos_x, pos_y)
local radius = size_x
local inner_radius = 0.8
local outer_radius = 0.2
if pos_x > 0.2 and pos_y > 0.2 and
pos_x < 0.8 and pos_y < 0.8 then
return 1.0
end
return 0.0
end
function brush_circle ( center_x, center_y
, size_x, _
, pos_x, pos_y
)
local radius = size_x
local inner_radius = 0.8
local outer_radius = 0.2
local dist = distance ( center_x, center_y
, size_x, size_x
, pos_x, pos_y
)
if dist > radius then
return 0.0
end
if dist < inner_radius then
return 1.0
end
return (1.0 - (dist - inner_radius) / outer_radius)
end
It is now required to think of a good API for the brushes to be able to make height dependent ones and register them nicely with noggit with supplying parameters like hardness or the range for random brushes etc.