String Enums

String Enums are a data type that allow for easy validation, filtering and modding. Going forward we are going to slowly replace the most used/modded traditional Enums with new String Enums.

String Enums can easily be extended to a large number of entries while traditional enums are bound to 255 entries

Internally to the engine String Enums are structs that contain an Name type variable, always check your variable types if running into compatibility issues.

Refactored Enums

Deprecated Enum

Refactored String Enum

E_WeaponComboType

EWeaponComboType

Using String Enums

Add a new variable and assign it the appropriate String Enum type, these appear as structs with an E prefix

Currently new types can only be defined in code, we plan to extend this in the future to allow modders to declare their own String Enum types.

Compile the blueprint and locate the variable, notice it has a drop down menu.

The drop down list is populated by concatenating values from all String Enum Data Providers of the associated type. We will go through how to add new entries to this list later in this documentation.

To access the data either split or break the variable, this will return the associated Name value

Extending String Enums

In order to add new String Enum entries, you need to create a blueprint class of one of two types:

  • StringEnumFixedListDataprovider

  • StringEnumDataTableDataprovider

Fixed list provider

Fixed Lists Data Providers contain a static list of values, assign the Target Enum

Now, you can populate the Fixed List with values as in this example.

Data table provider

Create a new table with your entries.
Hint: You can use any table, and only row names will be used to extend your string enum.

Data Table Data Providers generate their values from an associated Data Table, we again need to assign the Target Enum type here to tell the engine which enums to add entries to.

Assign Table Ref , the tables Row Name will be used to generate values

Now you can assign values to the Data Table

Once all files are compiled and saved we can review our new string enums by check the variable we made previously.