Chooser¶
14 tools. Back to the index.
add_chooser_column_to_table¶
Additive.
Append a column of column_type, its input left unbound, to a UChooserTable asset as one undo step, then compile and save the table; success is false, with save_error, when the save fails. Each call appends a new column, even of a type the table already has, except Randomize: a table holds at most one, so an existing Randomize column is returned with already_existed=true and nothing changes. The new column gets one cell, its DefaultRowValue, per row already in the table, so columns and rows stay in step whichever is added first. Besides the types listed under column_type it accepts OutputFloat, OutputBool, OutputName, OutputEnum, ObjectClass, Name, MultiEnum and Randomize.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
column_type |
string | yes | Column struct to append: "FloatRange", "Bool", "Enum", "Object", or "OutputObject". |
column_name |
string | yes | Label echoed back in the reply only; it is not stored on the column. |
Returns: { table_path: string, column_index: int, column_name: string, column_type: string, already_existed: bool, row_count?: int, saved?: bool, save_error?: string }
add_chooser_row¶
Additive.
Add one implicit row to a UChooserTable. Grows every column's RowValues by one (using each column's DefaultRowValue where available) and grows ResultsStructs by one, as one undo step, then compiles and saves the table; success is false, with save_error, when the save fails.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
Returns: { table_path: string, row_index: int, row_count: int, saved: bool, save_error?: string }
create_chooser_table¶
Additive.
Create (or load if it already exists) a UChooserTable asset under the given package path. A new table is compiled and saved. On an existing table only the result_type and output_object_class the call gives are applied, as one undo step, and the table is compiled and saved only when that changes it (saved false otherwise). success is false, with save_error, when the save fails. An unknown result_type, or an output_object_class that does not load as a UClass, is an error checked before the asset is created or loaded.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Asset short name (e.g. "MyChooser"); becomes the package short name. |
package_path |
string | no | Long package root (default "/Game/MCP"); full asset path = <package_path>/<name>. |
result_type |
string | no | EObjectChooserResultType: "Object" (default), "Class", or "NoPrimaryResult". |
output_object_class |
string | no | UClass path used as OutputObjectType (default UObject), loaded via LoadObject<UClass>; a path that does not load is an error. |
Returns: { asset_path: string, already_existed: bool, result_type: string, output_object_class: string|null, saved: bool, save_error?: string }
delete_chooser_table¶
Destructive, idempotent.
Destroy a UChooserTable asset at a /Game path (mirror of create_chooser_table). Typed-delete: it loads the asset and REFUSES to delete it if it is not a UChooserTable, so it cannot wipe the wrong asset the way the generic delete_asset can; that refusal, and a delete the engine does not carry out, make success false with deleted false. Idempotent on missing assets.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Full /Game/.../Chooser asset path. |
Returns: { table_path, deleted, already_existed, asset_class?, note? }
evaluate_chooser_table¶
Read-only.
Actually RUN a UChooserTable and get the SINGLE chosen result -- the way to test a chooser you just authored without opening the editor. Headless-safe: it is a pure runtime API, so it needs no PIE and no render. Pass context_object_path (any UObject in the editor world) to seed the evaluation context. A table with no columns, or one where no context property matches, falls through to the table's FallbackResult (reported as fallback_used); a table that matches nothing and has no fallback returns null. Use evaluate_chooser_table_multi when you want EVERY matching result instead of the first.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
context_object_path |
string | no | Optional UObject path used to seed the evaluation context. |
object_class |
string | no | Optional UClass path for the expected result type (default = /Script/Engine.Object). |
Returns: { table_path, evaluated, result_object_path, result_object_class, fallback_used, note? }
evaluate_chooser_table_multi¶
Read-only.
Actually RUN a UChooserTable and get EVERY matching result, not just the first: the multi-result mirror of evaluate_chooser_table, which is what you want when the chooser is meant to select a set. Headless-safe pure runtime API -- no PIE, no render. object_class defaults to /Script/CoreUObject.Object and is never null, since results are post-filtered with IsA; null entries the engine interleaves in its array are skipped, so result_count is the count of REAL results.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
context_object_path |
string | no | Optional UObject path used to seed the evaluation context. |
object_class |
string | no | Optional UClass path for the expected result type (default = /Script/CoreUObject.Object). |
Returns: { table_path, evaluated, result_count, results: [{ result_object_path, result_object_class }], fallback_used, column_count }
get_chooser_column_values¶
Read-only.
Read ONE COLUMN ACROSS ALL ROWS of a UChooserTable, plus that column's DefaultRowValue -- the column-wise counterpart of get_chooser_row_values (one row across all columns), with the same typed cell shapes. The per-column default is EDITOR-ONLY: outside an editor build it comes back null with a note, while the row values themselves always resolve. column_index out of range is an honest error. Read-only: no compile, no save.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
column_index |
number | yes | 0-based column index to read. |
Returns: { table_path, column_index, column_type, row_count, default: {<typed>}|null, row_values: [{<typed>}] }
get_chooser_row_values¶
Read-only.
Read ONE ROW ACROSS ALL COLUMNS of a UChooserTable, as typed cells -- the row-wise counterpart of get_chooser_column_values (one column across all rows) and finer-grained than inspect_chooser_table. Cell shapes by column type: FloatRange {min,max,b_no_min,b_no_max}; Bool {cell_value}; Enum {comparison,value}; Object {comparison,asset_path}; OutputObject {asset_path}. row_index out of range is an honest error. Read-only -- no compile, no save -- and it works headless, since row data is not editor-only.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
row_index |
number | yes | 0-based row index to read across all columns. |
Returns: { table_path, row_index, row_count, cells: [{ column_index, column_type, <typed fields> }] }
inspect_chooser_table¶
Read-only.
Read-only summary of a UChooserTable: ResultType, OutputObjectType, column count + per-column type names, ResultsStructs count, ContextData count, effective row count.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
Returns: { table_path: string, result_type: string, output_object_class: string|null, column_count: int, columns: [{index, type}], row_count: int, results_count: int, context_data_count: int }
list_chooser_tables¶
Read-only.
List every UChooserTable asset under a package path via the AssetRegistry.
| Parameter | Type | Required | Description |
|---|---|---|---|
package_path |
string | no | Optional path filter (default "/Game"). Pass "" to scan all. |
Returns: { package_path, total, tables:[{ asset_name, asset_path, asset_class, row_count, column_count }] }
remove_chooser_column¶
Destructive.
Remove a column from a UChooserTable by index (inverse of add_chooser_column_to_table). The column's per-row cells go with it -- a column owns its own RowValues, so nothing needs re-syncing across the other columns and the row COUNT is unchanged (use remove_chooser_row for that). The removal is one undo step; the table is then compiled and saved, and success is false, with save_error, when the save fails. A table with no columns is left as it is (note, saved false). Omit column_index (or pass -1) to remove the LAST column, matching remove_chooser_row's default.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
column_index |
number | no | Optional 0-based column index (default -1 = last column). |
Returns: { table_path, removed_column_index, previous_column_count, new_column_count, column_type, saved, save_error?, note? }
remove_chooser_row¶
Destructive.
Remove one implicit row from a UChooserTable (inverse of add_chooser_row). A chooser row is not a real object: this shrinks EVERY column's RowValues array by one -- at row_index if given, else the last row -- and shrinks ResultsStructs to match, as one undo step, then compiles and saves the table like add_chooser_row; success is false, with save_error, when the save fails. A table with no rows is left as it is (note, saved false). Use remove_chooser_column to drop a column instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
row_index |
number | no | Optional 0-based row index to remove (default: last row). |
Returns: { table_path, removed_row_index, previous_row_count, new_row_count, saved, save_error?, note? }
set_chooser_column_default¶
Destructive, idempotent.
Set the DefaultRowValue of one UChooserTable column, the cell value rows appended by add_chooser_row inherit; set it before adding rows. The fields that apply depend on the column type (see the params); others are ignored. A change is one undo step and is compiled and saved, and success is false, with save_error, when the save fails; a value the column already holds changes nothing (already_existed true, saved false).
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
column_index |
number | yes | 0-based column index to update. |
min |
number | no | FloatRange column: default lower bound of the row's float range. |
max |
number | no | FloatRange column: default upper bound of the row's float range. |
b_no_min |
boolean | no | FloatRange column: when true, disables the lower bound (row matches any value <= max). |
b_no_max |
boolean | no | FloatRange column: when true, disables the upper bound (row matches any value >= min). |
default_value |
any | no | Bool column: "MatchFalse", "MatchTrue" or "MatchAny"; OutputFloat: a number; OutputBool: a bool; OutputName: a name string; Randomize: a probability weight. Ignored by other column types. |
comparison |
string | no | Enum and Name columns: "MatchEqual", "MatchNotEqual", "MatchAny" or "Modulus"; ObjectClass column: "Equal", "NotEqual", "SubClassOf" (default), "NotSubClassOf" or "Any". Case-insensitive. |
value |
any | no | Enum and OutputEnum columns: enum ordinal (clamped to 0-255); Name column: the name string to compare; MultiEnum column: the bitmask as an integer. |
asset_path |
string | no | Object/OutputObject column: long package path of the UObject bound as the default row value. |
class_path |
string | no | ObjectClass column: path of the UClass to match (e.g. "/Script/Engine.Pawn" or "/Game/BP_Enemy.BP_Enemy_C"), used with comparison (default SubClassOf). |
Returns: { table_path, column_index, column_type, default_value?, asset_path?, comparison?, already_existed, saved, save_error? }
set_chooser_row_outcome¶
Destructive, idempotent.
Set the FAssetChooser outcome (UObject reference) for a specific row in a UChooserTable, as one undo step, then compile and save the table; success is false, with save_error, when the save fails. A row already bound to that asset is left as it is (already_existed true, saved false).
| Parameter | Type | Required | Description |
|---|---|---|---|
table_path |
string | yes | Long package path of an existing UChooserTable. |
row_index |
number | yes | 0-based row index to assign the outcome to (must be within the OutputObject column's RowValues range). |
asset_path |
string | yes | Long package path of the UObject to bind as the row's result via FAssetChooser (e.g. "/Game/MyAsset"). |
Returns: { table_path: string, row_index: int, asset_path: string, already_existed: bool, saved: bool, save_error?: string }