clearedForest.package
- .metadata129 B
- ClearedForest.component
- README.md2.1 KB
- package.yaml665 B
README.md
clearedForest
A forestKit forest with the spots you name kept clear of trees. ClearedForest is forestKit's Forest component with one more setting, keepClear: a list of circles ("x,z,r; x,z,r", metres from the forest's centre) where no tree, shrub or undergrowth grows. Use it for a spawn point, a building, or a course that runs through the canopy so trunks stay out of the way and a follow camera never ends up inside the leaves.
Everything else is forestKit as published: the component builds through forestKit.ForestBuilder.build, which already takes keepClear; it parks and adopts its forest across play/edit the same way, and every field is synced so every player builds the same forest.
First example
-- in scenes/main.scene/build.luau, inside content()
local forest = entity.spawn("Forest")
forest.component.add("clearedForest.ClearedForest", {
size = 120, density = "normal", seed = 7, stream = true, forestType = "beechForest",
keepClear = "0,0,10; 20,15,6", -- the spawn, and a hut 25 m away
})
entity.spawn("ForestAtmosphere").component.add("forestKit.atmosphere.ForestAtmosphere", {})
Save: the forest builds with a 10 m open circle round the spawn and a 6 m one at (20, 15).
Settings
All of forestKit's Forest settings (size, density, seed, stream, path, clearings, forestType, season, look, quality) plus:
| setting | |
|---|---|
keepClear | "x,z,r; x,z,r": circles kept empty, in metres from the forest's centre. Malformed entries are skipped. Changing it rebuilds the forest. |
component:forest() returns the built forest, as forestKit's does.
Why a separate part
forestKit's Forest component cannot pass keepClear to its builder. The same setting was proposed to forestKit's own world (pull request #2 on Beechwood Brook). Once forestKit's Forest takes keepClear, use that and drop this part.
Known limits
- A forest left parked when its component is destroyed during a scene rebuild can keep drawing until the next forest build (forestKit's park timer is cancelled with the component; the fix is in the same pull request).