Skip to main content

Select

This view allows the player to select one or multiple options from an array of pre-approved selections.

JSON Format

{
"type": "select",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"stat": ...,
"meta_stat": ...,
"options": ...,
"allowed_options": ...,
"resource_options": ...,
"max_selection_amount": ...,
"options_display_stat": ...,
"multi_select": ...,
"style": ...
}

Fields

FieldTypeRequiredDescription
idStringA unique identifier for the view. You can use it to reference view values in stat formulas by doing $view.view_id (where view_id is the id that was assigned to this view by you in the system definition)
typeRPGViewTypeThe type of this view. Note that these are all in camelCase.
margin_leftdoubleOptional. How much margin to add to the left of this view.
margin_rightdoubleOptional. How much margin to add to the right of this view.
margin_topdoubleOptional. How much margin to add to the top of this view.
margin_bottomdoubleOptional. How much margin to add to the bottom of this view.
is_visibleStatFormulaComponentOptional. A formula to specify if the view should be visible or not. Must return a bool.
validation_messageStatFormulaComponentOptional. If this view is an input, you can define this formula to return a message when the input value is invalid. If the input is valid, you should return null. Otherwise, make the formula return the string that should be shown to the user.
statStringEither this property or meta_stat has to be provided. The path to the stat that this view pulls its selected value from (and updates the selected value on). This path can use the syntax for paths defined in the GetStat stat formula. The stat has to be of the string type.
meta_statStatFormulaComponentEither this property or stat has to be provided. A formula for the path to the stat that this view pulls its selected value from (and updates the selected value on). Only use this property if the actual stat id will change in runtime. Otherwise, use the stat property, as this one will have performance implications for your system.
optionsStringEither this property or resource_options should be provided. The id of the enumerated type containing the options that should be available for the player to choose from. Alternatively, it could be the id of a core resource in the app (don't forget to also provide options_display_stat if so). This will cause all the resource instances of that particular resource to be displayed as options.
allowed_optionsStatFormulaComponentOptional. Defaults to all options. A stat formula for a list of string id's, corresponding to the options from the given enumerated type that you want to be displayed for the user as eligible options.
resource_optionsStatFormulaComponentEither this property or resource_options should be provided. A formula returning the resource instances that the player can choose from.
max_selection_amountStatFormulaComponentOptional. Defaults to nothing (ie: unlimited). Only works when multi_select is true. A formula computing to an integer representing the maximum amount of options that the player can select.
options_display_statStringOptional. Defaults to the display_name of the resource (or "name" if display_name is undefined for the given resource). Needs to be set if a resource id is given as the value for options.
multi_selectboolOptional. Defaults to false. Whether or not this view should allow multiple selections or not.
styleSelectRPGViewStyleOptional. Defaults to dropdown. The style of the view.