In-game tools · function

setFieldCommand

Write one row's fields across the whole selection, as one entry.

Explained in In-game tools.

function setFieldCommand(world: InspectableWorld, entities: readonly number[], component: string, fields: readonly string[], values: readonly unknown[]): Command | null
import { setFieldCommand } from '@driftengine/tools';

Parameters

ParameterTypeDescription
worldInspectableWorld
entitiesreadonly number[]
componentstring
fieldsreadonly string[]
valuesreadonly unknown[]

In depth

One entry for the whole selection and for all three of a vector's components. Editing with ten entities selected is one act, and undo that took it back one entity at a time would make the person count. Each entity's own previous value is recorded, so undo does not flatten them onto whatever the first one held.