Terrafier/scripts/example.rhai
loki5512344 18613260a8 WASM plugins, scripting, i18n, GUI pan/zoom, cargo-dist CI/CD
- WASM plugin host (wasmtime 46, 17 host fns) + example noisemap plugin
- Rhai scripting engine (12 API fns, `terrafier run` cmd)
- i18n: en/ru translations, auto-detect, t! macro
- GUI: pan (click-drag) + zoom (scroll wheel) with viewport transform
- cargo-dist 0.31: MSI/pkg/shell installers, both binaries
- CI: .github/workflows/ci.yml + release.yml
- Security: wasmtime 30→46, bincode 1.3→2.0, quick-xml CVE docs
- Code review: SAFETY comments, unwrap→match cleanup
- Fixes: clippy approx_constant, needless_borrows, rustfmt
2026-07-04 11:14:47 +02:00

18 lines
528 B
Text

// Terrafier script example — creates a world with noise terrain
let world = new_world("scripted_world", 42);
// Generate noise terrain
generate_heightmap_noise(world, 12345, 16.0, 6, "overworld");
// Apply some operations
apply_smooth(world, 2, 5.0, "overworld");
apply_erode(world, 1, 4.0, "overworld");
// Generate layers (caves, rivers, biomes, etc.)
generate_layers(world, "overworld");
// Save the world
save_world(world, "scripted_world.tfw");
print(info(world));
print("Done! World saved to scripted_world.tfw");