Addon ID

  • salmanshh_advdrunkenwalkers

Info

Statistics

  • Download count8 total downloads
  • Latest download count 8 downloads of latest version
  • Average download count2 downloads per day average

Owners

A list of all Actions, Conditions and Expressions supported in this addon.

Grid

  • Actions

    {my} clear grid to {0}

    Fill every cell with the given value without touching walkers, marks or the random stream. Does not fire On Cell Carved.

    {my} create grid {0} x {1}

    Only needed for a size other than the Grid Width and Grid Height properties - the grid those describe already exists when the layout starts. Allocates a fresh grid filled with the Empty Value, clamped to Max Grid Size. Pass a negative for either dimension to fall back to that property. Destroys any previous grid, walkers and marks.

    {my} draw cells valued {0} to {1} as tile {2}

    Set one tile in the tilemap for every cell holding the value, without writing the loop yourself. Cells map straight onto tile coordinates, so cell (4, 2) sets tile (4, 2). Call it once per value to paint layered terrain, and pass tile -1 to erase instead.

    {my} set cell ({0}, {1}) to {2}

    Write one cell directly, useful for pre-placing anchors before walkers run. Does not fire On Cell Carved.

    {my} set grid origin to ({0}, {1}) with cell size {2}

    Reposition the grid in layout space for the coordinate expressions. Pass 0 for the cell size to keep the current value.

  • Conditions

    Cell ({0}, {1}) is {2}

    True if the cell holds exactly the given value. Out-of-bounds cells match nothing.

    ({0}, {1}) is inside the grid

    True if the coordinates fall within the current grid.

  • Expressions

    AsText

    The grid as text, one character per cell and one line per row. Character N of Characters stands for value N, so ".#" shows empty cells as dots and value 1 as #; values with no character show as ?. Set a Text object to this to see the whole map at a glance.

    CellToLayoutX

    Layout X of the cell's centre, from Origin X and Cell Size.

    CellToLayoutY

    Layout Y of the cell's centre, from Origin Y and Cell Size.

    CellValue

    Value at the cell. Returns the Empty Value for out-of-bounds queries.

    CountCells

    Total cells currently holding the value. Pairs with GetCellXByIndex and GetCellYByIndex to iterate results.

    GetCellXByIndex

    X of the index-th cell holding the value, 0-based in a stable left-to-right, top-to-bottom order. Returns -1 when out of range.

    GetCellYByIndex

    Y of the index-th cell holding the value, 0-based in a stable left-to-right, top-to-bottom order. Returns -1 when out of range.

    GridHeight

    Current grid height in cells.

    GridWidth

    Current grid width in cells.

    LayoutToX

    Cell X containing the layout X coordinate. May fall outside the grid.

    LayoutToY

    Cell Y containing the layout Y coordinate. May fall outside the grid.

    NeighbourCount

    How many of the 8 neighbours hold the given value, handy for autotiling and custom placement rules. Off-grid neighbours never match.

Marks

  • Actions

    {my} clear marks tagged {0}

    Remove all marks with the tag. An empty string removes every mark.

    {my} drop {1} marks along walker {0} every {2} steps, chance {3}, min spacing {4}

    Place tagged marks along a walker's recorded path: a candidate every N steps, kept with the given 0-1 chance, discarded when it lands within min spacing cells of a same-tag mark. Fires On Mark Placed per mark.

    {my} scatter {1} {0} marks on cells valued {2}, placement {3}, min spacing {4}

    Deterministically scatter up to count tagged marks onto cells holding the value. Interior requires all 8 neighbours to match (open areas), edge requires at least one that does not (against walls). Fires On Mark Placed per mark.

  • Conditions

    Cell ({0}, {1}) has a {2} mark

    True if a mark with the tag sits on that cell. An empty tag matches any mark.

    On {0} mark placed

    Fires once per mark from Drop Marks Along Walk and Scatter Marks. Use MarkX, MarkY and MarkTag inside. An empty filter matches all tags.

  • Expressions

    CountMarks

    Marks with the tag. An empty tag counts every mark. Pairs with GetMarkXByIndex and GetMarkYByIndex to iterate results.

    GetMarkXByIndex

    X of the index-th mark with the tag, 0-based in placement order. Returns -1 when out of range.

    GetMarkYByIndex

    Y of the index-th mark with the tag, 0-based in placement order. Returns -1 when out of range.

    MarkTag

    Tag of the mark just placed, inside On Mark Placed.

    MarkX

    X of the mark just placed, inside On Mark Placed.

    MarkY

    Y of the mark just placed, inside On Mark Placed.

Post-Processing

  • Actions

    {my} dilate cells valued {0} by {1} iterations

    Expand every region of the given value outward by one cell per iteration, widening corridors into chambers. Any cell with an 8-way neighbour holding the value is converted. Fires On Cell Carved for each newly converted cell.

    {my} outline cells valued {0} with {1}

    Write the outline value into every Empty Value cell adjacent 8-way to a cell holding the value - the classic put walls around the floor pass. Fires On Cell Carved for each written cell.

Randomness

  • Actions

    {my} inject random value {0}

    Queue one 0-1 value for injected mode, for example AdvancedRandom.Random. A queue underrun during generation falls back to the internal PRNG and warns in debug mode.

    {my} set random source to {0}

    Switch where random values come from. In injected mode generation consumes the queue filled by Inject Random, which routes every decision through another plugin's stream.

    {my} set seed to {0}

    Reset the internal PRNG with this seed. Call it before generation: the same seed with the same action order reproduces identical output. Pass AdvancedRandom.Seed here to share one master seed with the Advanced Random plugin.

  • Expressions

    CurrentSeed

    The seed the PRNG was last set with.

Walkers

  • Actions

    {my} add walker {0} at ({1}, {2}), {3} steps, {4} directions, max turn {5}, tag {6}, carving {7}

    Register a walker with the given core settings, including the value it carves. Remaining fields use the Walker Definition defaults. Walkers run in registration order.

    {my} add {1} walker {0} at ({2}, {3}), tag {4}, carving {5}

    Register a walker from a named shape preset instead of raw numbers: Cave is the classic jittery carver, Corridors digs right-angled passages, River meanders in a wide ribbon, Ore Vein burrows downward, Lightning strikes down in a short jagged line, and Blob hollows out one round chamber. Presets only choose the movement settings - tune the result afterwards with the Set Walker actions, or use Add Walker for full control.

    {my} define walker from {0}

    Register a walker from a full Walker Definition JSON string, for example {"id":"cave","startX":32,"startY":32,"steps":400,"directions":8,"maxTurn":180,"startAngle":0,"turnChance":1,"carveValue":1,"brushSize":1,"tag":""}. Replaces any existing walker with the same id.

    {my} remove walker {0}

    Unregister the walker. Cells it already carved are unaffected.

    {my} run all walkers

    Execute every registered walker to the end of its step budget, in registration order, firing On Cell Carved per newly carved cell and On Walker Finished per walker, then On Generation Complete.

    {my} run walker {0}

    Execute one walker to completion, firing its carve and finish triggers. Does not fire On Generation Complete.

    {my} run walkers tagged {0}

    Execute every registered walker carrying the tag, in registration order, then fire On Walkers By Tag Complete. Lets you stage generation in passes. An empty tag runs only untagged walkers.

    {my} set walker {0} brush size to {1}

    Set the square brush a walker stamps each step: 1 carves a single cell, 3 a 3x3 block. The square brush never rotates; for a corridor that turns with the walker use Set Walker Dig Size instead, which overrides this while set.

    {my} set walker {0} carve value to {1}

    Change the integer a walker writes into the cells it visits. It applies from the walker's next step, so cells it has already carved keep their old value. Set it before running the walker to pick that walker's terrain, or change it mid-run from On Walker Stepped to lay down two values along one path.

    {my} set walker {0} dig size to {1} wide by {2} deep

    Make a walker dig out a rectangle that turns with it instead of a fixed square. Width is measured across the direction it faces, so it is the corridor width, and is always centred. Depth is measured along that direction and is signed: a positive digs forward from the walker's own cell, a negative digs behind it, and either way its own cell is included, so 1 and -1 both mean just that cell. A walker facing right digs a corridor width cells tall, and the same walker facing down digs one width cells wide. Pass 0 for a dimension to fall back to the walker's brush size for that axis, and 0 for both to restore the plain square brush.

    {my} set walker {0} direction weights to {1}

    Bias which way a walker turns. Weights are relative, comma separated, one per direction in direction order: entry 0 is the walker's start angle and the rest follow it clockwise. A weight of 0 rules a direction out, and any entry you leave off counts as 1. Missing directions still apply, so "3,1,1" on an 8 direction walker weights the first three and leaves the other five at 1. Leave the string empty to go back to equal weights.

    {my} set walker {0} start angle to {1}

    Set the angle a walker's direction set is anchored at, in degrees: 0 is right and 90 is down, matching Construct's angle system. The walker's evenly spaced headings rotate with it, and so do its direction weights, since weight entry 0 always weighs the start angle. A walker that has not started faces the new start angle; one mid-walk snaps to the nearest of its new headings.

    {my} set walker {0} steps to {1}

    Set a walker's step budget. The value becomes its remaining steps, and a finished walker given steps is un-finished, so you can top a walker up and run it again to extend its path.

    {my} set walker {0} turn chance to {1}

    Set the probability per step, 0 to 1, that a walker considers turning at all. Low values give long straight runs between turns; 1 lets it reconsider its heading every step.

    {my} step walker {0} by {1}

    Advance one walker by up to N steps, the animated-generation path. Fires On Walker Stepped per step and On Walker Finished when the budget is exhausted.

  • Conditions

    Walker {0} is registered

    True if a walker with the id is currently registered.

    On cell carved

    Fires once per cell whose value changes during walker runs, dilation or outlining. Use CarvedX, CarvedY, CarvedValue and WalkerID inside. On big grids prefer iterating results after generation over per-cell spawning here.

    On generation complete

    Fires after Run All Walkers finishes every walker. The idiomatic place to run mark passes and paint your tilemap via the Count and Index expressions.

    On walker {0} finished

    Fires when a walker exhausts its step budget or runs out of legal moves. WalkerX and WalkerY give its final cell, useful for chaining the next walker onto this one's endpoint. An empty filter matches all walkers.

    On walkers tagged {0} complete

    Fires after a Run Walkers By Tag call finishes its whole batch. The batch tag is readable via WalkerTag inside. An empty filter matches any batch.

    On walker {0} stepped

    Fires after each step of Step Walker only, batch runs skip it for speed. WalkerX, WalkerY, WalkerAngle and WalkerStepsLeft are valid inside. An empty filter matches all walkers.

  • Expressions

    CarvedValue

    Value just written into the cell, inside On Cell Carved.

    CarvedX

    X of the cell just written, inside On Cell Carved.

    CarvedY

    Y of the cell just written, inside On Cell Carved.

    WalkerAngle

    Current heading of the triggering walker in degrees, 0 = right and 90 = down. Reads 0 outside walker triggers.

    WalkerID

    ID of the triggering walker, inside walker triggers and On Cell Carved. Empty for post-processing passes and outside triggers.

    WalkerStepsLeft

    Remaining step budget of the triggering walker. Reads 0 outside walker triggers.

    WalkerTag

    Tag of the triggering walker, inside walker triggers and On Cell Carved, or the batch tag inside On Walkers By Tag Complete.

    WalkerX

    Current X of the triggering walker. Reads 0 outside walker triggers.

    WalkerY

    Current Y of the triggering walker. Reads 0 outside walker triggers.