DataTables exported to JSON in editor (UDataTable::WriteTableAsJSON, accessible by right clicking a data table and picking export to json) that contain variables with spaces or other outlawed characters cannot be reloaded in engine(UDataTable::CreateTableFromJSONString) in a cooked game because the name information is missing in cooked builds . The attached image shows an example, "Type With Spaces" will not properly export and import, while TypeWithNoSpaces is fine.
The reporter identified a discrepancy (Editor vs Engine) when calling UUserDefinedStruct::GetAuthoredNameForField. The editor will return a friendly name (ie with spaces) while the a cooked build will return the actual FName. For most variable names this will be the same.
The core of this problem is that FMemberVariableNameHelper::Generate is using a very restrictive list of invalid characters via INVALID_OBJECTNAME_CHARACTERS, and will mangle any name that uses them in a way that can't easily be recovered from. This is more restrictive than blueprint variables which use UE_BLUEPRINT_INVALID_NAME_CHARACTERS that only outlaws "."
There's no easy repro right now for this because none of our games allow importing data in a cooked build. Here is a programmer repro:
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-96724 in the post.
3 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.25 |
Created | Aug 11, 2020 |
---|---|
Updated | Nov 27, 2023 |