← All namespaces

chooser

Project & assets Core

Author Chooser Table assets: columns, rows, cell predicates, and per-row results.

What it’s for

A Chooser Table is Unreal’s data-driven lookup asset: given some context, it walks its rows top to bottom and returns the first row whose cell predicates all pass. This namespace lets your assistant build that asset end to end — create the UChooserTable, add the columns that define the predicates, add rows, fill in each cell, set the object or class each row returns, and compile the graph so the table is ready to evaluate.

Reach for it when you want to author or edit a chooser as content rather than write branching logic by hand. Columns come in a few kinds — bool, float, enum, object, and randomize — and each row supplies one cell per column plus a result, so the table encodes a small decision matrix you can read and diff.

This is authoring only. It writes the asset: it does not run the chooser or hand you the picked result at runtime. To read back the compiled state of a chooser you built, dump the asset or query it with property.get against the asset path.

Examples

Create a chooser table

Start a fresh UChooserTable that returns an object, ready for columns and rows.

You: Make a new chooser table at /Game/AI/CH_Reaction that returns an object.

  call("chooser.create", {path:"/Game/AI/CH_Reaction", resultType:"object", save:true})
    → {ok:true, path:"/Game/AI/CH_Reaction"}

Done. Created CH_Reaction as an object-result chooser.

Add columns, a row, and its cells

Give the table an enum predicate and a float predicate, then author one row that matches on both.

You: Add a State enum column and a Distance float column, then a row for Alert within 500.

  call("chooser.add_column", {path:"/Game/AI/CH_Reaction", kind:"enum",
        enumType:"/Game/AI/E_AIState.E_AIState", propertyBinding:"State"})
    → {ok:true, column:0}
  call("chooser.add_column", {path:"/Game/AI/CH_Reaction", kind:"float",
        propertyBinding:"Distance"})
    → {ok:true, column:1}
  call("chooser.add_row", {path:"/Game/AI/CH_Reaction"})
    → {ok:true, row:0}
  call("chooser.set_cell", {path:"/Game/AI/CH_Reaction", row:0, column:0, value:"Alert"})
    → {ok:true}
  call("chooser.set_cell", {path:"/Game/AI/CH_Reaction", row:0, column:1,
        value:{min:0, max:500}})
    → {ok:true}

Done. Row 0 matches State=Alert and Distance in [0, 500].

Set a row result and compile

Point the row at the asset it should return, then compile the table so it is ready to evaluate.

You: Have that row return BP_AlertBehavior and compile the chooser.

  call("chooser.set_result", {path:"/Game/AI/CH_Reaction", row:0,
        resultKind:"asset", value:"/Game/AI/BP_AlertBehavior"})
    → {ok:true}
  call("chooser.compile", {path:"/Game/AI/CH_Reaction", save:true})
    → {ok:true, errors:0, warnings:0}

Done. CH_Reaction compiled clean and row 0 returns BP_AlertBehavior.

← Back to all namespaces