UE 5.2 on Windows
Problem Statement
I can’t get my CoreRedirects to change the references to my Enums and Structs in my Blueprints.
Root problem
The root problem is that I’m trying to convert a Blueprint class (“Pathfinding.cpp”) to C++, but it depends on existing code written in Blueprints (BaseGrid). I quickly discovered that I can’t access the variables/methods/Enums I’ve declared in my other Blueprints from C++. And I want to do this in a minimally invasive way so I don’t have to rewrite all of my existing Blueprints.
First I tried to create an C++ Interface for BaseGrid, but that did not allow me to declare variables. Then I tried to create an Abstract parent class, but I realized I would need to convert all of BaseGrid’s variables in C++. So now I am trying to decouple Pathfinding from BaseGrid by just passing in specific variables that it needs. Some of those variables are Enums and Structs, so in order to make those available to both the C++ code and the Blueprints I am trying to convert them to C++ as well. And that lead me to Core Redirects.
Current attempts
I have 3 Enums and a Struct to convert. I have the new ones declared in a TileDataTypes.h
file. I have tried both leaving the Enum names as-is and renaming. I have also tried giving a single Enum its own file.
At the bottom of Config/DefaultEngine.ini
file I have added a section like this:
[CoreRedirects]
+EnumRedirects=(OldName="E_TileType_Old",NewName="E_TileType",ValueChanges=(("None","Normal","Obstacle"),("None","Normal","Obstacle")))
+StructRedirects=(OldName="S_TileInfo",NewName="/Source/MyGamePrototype/Core/DataTypes/TileDataTypes.S_TileInfo")
Variant attempts:
; with file system path
+EnumRedirects=(OldName="E_TileType",NewName="/Source/MyGamePrototype/Core/DataTypes/E_TileType",ValueChanges=(("None","Normal","Obstacle"),("None","Normal","Obstacle")))
; with Module prefix
+EnumRedirects=(OldName="E_TileType_Old",NewName="/Source/MyGamePrototype/Core/DataTypes/TileDataTypes.E_TileType",ValueChanges=(("None","Normal","Obstacle"),("None","Normal","Obstacle")))
; with Script directory
+EnumRedirects=(OldName="E_TileType_Old",NewName="/Script/MyGamePrototype/Core/DataTypes/TileDataTypes.E_TileType",ValueChanges=(("None","Normal","Obstacle"),("None","Normal","Obstacle")))
; without subdirs (docs show it like this)
+EnumRedirects=(OldName="E_TileType_Old",NewName="/Script/TileDataTypes.E_TileType",ValueChanges=(("None","Normal","Obstacle"),("None","Normal","Obstacle")))
; with reference path on OldName
+EnumRedirects=(OldName="/Game/Blueprints/Core/Grid/GridUtils/E_TileType_Old",NewName="/Script/TileDataTypes.E_TileType",ValueChanges=(("None","Normal","Obstacle"),("None","Normal","Obstacle")))
I then compile and open UE and do a “Fix Up Redirectors” on the folder structure.
As far as I can tell, none of these have changed anything in my Blueprints, and when I try to delete the old Blueprint Enums, UE complains that there are still classes referring to them.
Questions
- Am I misunderstanding how CoreRedirects works? Does it only provide symlinks to the new Enums or will it update the actual references?
- a. What is the mysterious “Script” folder the documentation examples show? I only have a “Source” folder. It’s not very clear whether I should include my directory path based on these examples. I only found this from other forum posts.
- b. I got the “/Game/” path from the “Show References” window in UE, but where is this “Game” folder?
- If I ignore UE’s warnings and delete the old file anyway, will it corrupt my Blueprints (i.e. they won’t open for me to make the changes manually)?
- Is there a log output somewhere from CoreRedirects so I can see what it does/doesn’t do and/or errors or warnings?