Taos API Reference
    Preparing search index...

    Variable actionConst

    action: {
        set: (
            attr: ParticleAttribute,
            value: Numlike,
            mode?: SetAttributeMode,
        ) => Action;
        setVar: (name: string, value: Numlike) => Action;
        if_: (cond: Expr, then: Action[], else_?: Action[]) => Action;
        patchDeposit: (field: number, coord: Expr, amount: Numlike) => Action;
        scratchSet: (slot: Numlike, value: Numlike) => Action;
        loop: (index: string, count: Numlike, body: Action[]) => Action;
    } = ...

    Constructor helpers for Action nodes. Use action.set(attr, value) for the common overwrite case; pass a third arg for add/multiply/etc. modes.

    Type Declaration

    • set: (attr: ParticleAttribute, value: Numlike, mode?: SetAttributeMode) => Action
    • setVar: (name: string, value: Numlike) => Action
    • if_: (cond: Expr, then: Action[], else_?: Action[]) => Action
    • patchDeposit: (field: number, coord: Expr, amount: Numlike) => Action
    • scratchSet: (slot: Numlike, value: Numlike) => Action

      Write value into this agent's scratch slot slot (needs config.scratch).

    • loop: (index: string, count: Numlike, body: Action[]) => Action

      Bounded for loop: run body count times with the counter exposed as the f32 local variable index (read it via expr.variable(index)).