siege_castle
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2siege_castle — procedural castle layouts for Trebuchet Castle Siege. `M.plan(layout, opts)` returns a pure description of a castle: a list of block placements plus the garrison posts that ride on them. Nothing here touches the world — the game component spawns from the plan, which keeps the geometry testable on its own: local Castle = require("siege_castle") local plan = Castle.plan("curtain") #plan.blocks -- how many stones the siege has to shift plan.posts.archers -- where the wall archers stand Castles face +Z. The trebuchet stands out along +Z, so the front curtain and the gatehouse are the faces the player can actually reach, and the layouts are open-backed: every block placed is a block that can be hit, so integrity always measures reachable work.
push(plan: Plan, b: Block) → number
| arg | type | description |
|---|---|---|
| plan | Plan | |
| b | Block |
newPlan(name: string) → Plan
| arg | type | description |
|---|---|---|
| name | string |
widen(plan: Plan, x: number, z: number) → void
| arg | type | description |
|---|---|---|
| plan | Plan | |
| x | number | |
| z | number |
wallRun(plan: Plan, x1: number, z1: number, x2: number, z2: number, courses: number, opts: WallOpts) → void
A straight wall run from (x1,z1) to (x2,z2), `courses` stones tall. Successive courses use a different block count so the vertical seams offset course to course, the way a running bond does — which is also what makes a hit shear a ragged hole instead of a clean column.
| arg | type | description |
|---|---|---|
| plan | Plan | |
| x1 | number | |
| z1 | number | |
| x2 | number | |
| z2 | number | |
| courses | number | |
| opts | WallOpts |
roundTower(plan: Plan, cx: number, cz: number, radius: number, courses: number, opts: TowerOpts) → void
A drum tower: rings of tapered blocks, each ring rotated half a step against the one below so the joints interlock.
| arg | type | description |
|---|---|---|
| plan | Plan | |
| cx | number | |
| cz | number | |
| radius | number | |
| courses | number | |
| opts | TowerOpts |
keep(plan: Plan, cx: number, cz: number, w: number, d: number, opts: KeepOpts) → void
The keep: a hollow square tower with a battlemented crown and, for the levels that have a Lord, a balcony on the face the player can see.
| arg | type | description |
|---|---|---|
| plan | Plan | |
| cx | number | |
| cz | number | |
| w | number | |
| d | number | |
| opts | KeepOpts |
gatehouse(plan: Plan, cx: number, cz: number, opts: GateOpts) → void
A gatehouse: two piers, a lintel over the gateway, solid courses above, and a timber gate leaf that swings open when the garrison sorties.
| arg | type | description |
|---|---|---|
| plan | Plan | |
| cx | number | |
| cz | number | |
| opts | GateOpts |
motte(plan: Plan) → void
Level 1 — an earth motte with a dry-stone screen and a timber keep.
| arg | type | description |
|---|---|---|
| plan | Plan |
curtain(plan: Plan) → void
Level 2 — a masonry curtain with a barred gatehouse and a stone keep.
| arg | type | description |
|---|---|---|
| plan | Plan |
twin(plan: Plan) → void
Level 3 — twin drum towers flanking the gate, each with a ballista.
| arg | type | description |
|---|---|---|
| plan | Plan |
concentric(plan: Plan) → void
Level 4 — an outer curtain, an inner bailey wall, and a tall keep.
| arg | type | description |
|---|---|---|
| plan | Plan |
fortress(plan: Plan) → void
Level 5 — the fortress: four drum towers, a double gatehouse, the Lord.
| arg | type | description |
|---|---|---|
| plan | Plan |
layouts( ) →
The layout names available to `plan`.
examples
require("siege_castle").layouts()plan(layout: string) → Plan
Build a castle plan: block placements, garrison posts, and bounds.
| arg | type | description |
|---|---|---|
| layout | string | One of `layouts()`. |
examples
local plan = require("siege_castle").plan("twin")unit( ) →
The masonry unit the layouts are built from, for callers that need to match it.
examples
local u = require("siege_castle").unit()Block = {Post = { x: number, y: number, z: number, part: string, support: number }Plan = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.