# CoreRedirects is not updating Blueprint variables (and decoupling C++ from Blueprints)

**URL:** <https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299>\
**Category:** Programming & Scripting\
**Tags:** UE-5, unreal-engine, CPP, Blueprint, question\
**Created:** [September 29, 2023, 7:35am UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299 "2023-09-29T07:35:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiberian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tiberian](https://forums.unrealengine.com/u/tiberian)\
**Post date:** [September 29, 2023, 7:35am UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/1 "2023-09-29T07:35:44Z")

</div>

UE 5.2 on Windows

## Problem Statement

I can’t get my [CoreRedirects](https://docs.unrealengine.com/5.3/en-US/core-redirects-in-unreal-engine/) 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:

```ini
[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:

```ini
; 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

1. Am I misunderstanding how CoreRedirects works? Does it only provide symlinks to the new Enums or will it update the actual references?
2. 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.
3. b. I got the “/Game/” path from the “Show References” window in UE, but where is this “Game” folder?
4. 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)?
5. Is there a log output somewhere from CoreRedirects so I can see what it does/doesn’t do and/or errors or warnings?

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [September 29, 2023, 7:53am UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/2 "2023-09-29T07:53:35Z")

</div>

`/Script/ProjectName` is a virtual package that contains all C++ declarations of your project. Since it’s virtual it has nothing to do with files on disk.

In your case I’m guessing it should look like

```auto
/Script/MyGamePrototype.E_TileType
/Script/MyGamePrototype.S_TileInfo

```

`/Game/` is a virtual path that points to your project’s Content folder.  
`/Engine/` is a virtual path that points to Engine’s Content folder.

---

<div class="post-metadata">

**Author:** ![tiberian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tiberian](https://forums.unrealengine.com/u/tiberian)\
**Post date:** [September 29, 2023, 8:43pm UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/3 "2023-09-29T20:43:06Z")

</div>

Thank you for that! That helps my understanding significantly.

## Update

While reviewing the “CoreRedirects” docs just now, I noticed the mention of `BaseEngine.ini`.

In that file, I found a way to show log output for CoreRedirects:

> ; The -DebugCoreRedirects command line parameter can be used to diagnose issues when adding new redirects

## Debugging process

I’m going to leave my method here for posterity:

1. I’m using VSCode. I found a post on stackoverflow that says you can add command line arguments via `.vscode/launch.json`

2. In the list of configurations, I found the entry for `"name": "Launch MyGamePrototypeEditor (Development)"` (which I recognized from [setting up VSCode with these instructions](https://docs.unrealengine.com/5.2/en-US/setting-up-visual-studio-code-for-unreal-engine/)).

3. Under `args` I added the parameter, and I also added a custom LOG file name ([documented here](https://docs.unrealengine.com/4.26/en-US/ProductionPipelines/CommandLineArguments/) – 4.26 but it still worked), which looks like this:

```auto

"args": [
  "C:\\{path_to_project}\\MyGamePrototype.uproject",
  "-DebugCoreRedirects",
  "LOG=MyLog.txt"
],

```

1. I launched Unreal using VSCode “Run → Start Debugging”. After it finished loading my project, I simply closed it.

2. I used a file system search to find the MyLog.txt file in my project directory, at `C:\\{path_to_project}\\Saved\\Logs\\MyLog.txt`

## Results! …sort of

Okay, with that out of the way, I found this in the log file…

> LogCoreRedirects: Error: ReadRedirectsFromIni(Engine) failed to parse ValueChanges for redirect (OldName=“/Game/E\_TileType\_Old”,NewName=“/Script/MyGamePrototype.E\_TileType”,ValueChanges=((“None”,“Normal”,“Obstacle”),(“None”,“Normal”,“Obstacle”)))!

So I revisited the docs again and discovered what I missed (bold added)…

> ValueChanges
> 
> List of **String pairs**
> 
> The **first string in the pair is the old enumerated value, and the second string is the new value**. If both values are in the same class, the old value must no longer exist in code.

I had written my ValueChanges thinking it was (fromA, fromB, fromC),(toA, toB, toC) which is **wrong**.

The correct way is (fromA, toA),(fromB, toB),(fromC, toC).

My new redirect looks like this:

```auto

[CoreRedirects]

+EnumRedirects=(OldName="E_TileType_Old",NewName="/Script/MyGamePrototype.E_TileType",ValueChanges=(("None","None"),("Normal","Normal"),("Obstacle","Obstacle")))

```

Now, this _works_… but broke my blueprints ☹

The references to Enum “E\_TileType\_Old” have been replaced by the type “Byte” with no inputs on the pins.

So I’m still missing something. I’m going to walk back the changes in version control and try again.

---

<div class="post-metadata">

**Author:** ![tiberian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tiberian](https://forums.unrealengine.com/u/tiberian)\
**Post date:** [September 30, 2023, 9:50pm UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/4 "2023-09-30T21:50:55Z")

</div>

As an experiment, I tried giving the NewName something that is obviously wrong `DoesNotExist2902903` and the result is the same as when I give it my declared Enum.

> LogCoreRedirects: Verbose: RedirectNameAndValues(/Game/Blueprints/Core/Grid/GridUtils/E\_TileType\_Old.E\_TileType\_Old) replaced by /Script/MyGamePrototype.DoesNotExist2902903

And everything in the Editor is replaced with an empty byte.

I’ve also tried declaring my Enum in a different way (raw enum, vs enum class). It shows up in the Blueprint Editor for nodes, but unfortunately, I’ve not found any way to ask the Engine _where_ it finds the declaration, so I cannot see if I’m using the correct one for my Redirect and the logs are not helpful there. The closest I’ve gotten here is the `module list` console command, but that only tells me that `MyGamePrototype` exists as a module, not what is in it.

And I’ve had no success with the StructRedirects either. The logs show:

> LogCoreRedirects: ValidateRedirect(Type 4) can’t validate destination Struct for redirect from /Game/S\_TileInfo to /Script/MyGamePrototype/S\_TileInfo with unloaded package

…but it shows this for several built-in Unreal redirects as well.

…and with dot-delimiter `NewName="/Script/MyGamePrototype.S_TileInfo"` I get no log output for the Struct and no changes in the Editor.

At this point, I can only assume the feature is broken. If an Unreal tester finds this thread, perhaps they can validate on their end. Frustratingly, my only option is to do this manually 😬

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [October 3, 2023, 9:39am UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/5 "2023-10-03T09:39:50Z")

</div>

Epic does plenty of struct redirects from BP to C++ in their default ini, so it should work…

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/4/d4418e05b11663284b7f72e63e359359439df543.png)

```cpp
+StructRedirects=(OldName="S_TileInfo",NewName="/Script/MyGamePrototype.S_TileInfo")

```

How are you sure that it doesn’t work, what changes are you expecting ?

---

<div class="post-metadata">

**Author:** ![tiberian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tiberian](https://forums.unrealengine.com/u/tiberian)\
**Post date:** [November 4, 2023, 2:56am UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/6 "2023-11-04T02:56:57Z")

</div>

I was expecting that the feature would automatically update my Blueprints, such that any reference to the old enum `E_TileType_Old` (declared in Blueprints) would be changed to the new enum `E_TileType` (declared in C++), whilst remapping the values (or at the very least create something like a “symlink” to the new data type).

Instead, the closest I got was that it would replace the old enum with an empty Byte node.

I tried many different ways and could never get it to do that, so I gave up on it and went through the tedious process of doing this manually.

🤔 One thought I had just now is that perhaps I missed something to do with “namespaces”. I haven’t declared a namespace for any of my modules and maybe that is needed for the feature to work. There is only one mention of this in the docs:

`PropertyRedirects`

> The name of the new property. This name can be fully period-delimited like `OldName`, or it can be just the variable name if it exists in the same namespace as `OldName`.

And it doesn’t mention whether Blueprints would have a namespace or what that would be. The only mention is:

`ClassRedirects`

> Specifies a change to the underlying class of the UCLASS. This is generally used to change a Blueprint class to a native class (`/Script/CoreUObject.Class`).

---

<div class="post-metadata">

**Author:** ![raptorred67](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/raptorred67/32/1024495_2.png) [@raptorred67](https://forums.unrealengine.com/u/raptorred67)\
**Post date:** [February 3, 2025, 11:22pm UTC](https://forums.unrealengine.com/t/coreredirects-is-not-updating-blueprint-variables-and-decoupling-c-from-blueprints/1316299/7 "2025-02-03T23:22:55Z")

</div>

Hi there @tiberian  
Did you ever find a resolution to this? I am having a [nearly identical issue](https://forums.unrealengine.com/t/broken-references-to-structs-and-enums/2312684/1) and using the `-DebugCoreRedirects` command-line argument gives me the same kind of feedback:  
`"LogCoreRedirects: ValidateRedirect(Type 4) can't validate destination Struct for redirect from /Game/Sponza/Blueprints/Flicker/ColorVarStruct to /Game/Blueprints/Flicker/ColorVarStruct with unloaded package"`  
For some reason it is not finding the **destination** struct which is bizarre because it’s sitting at that very path. If anything I was thinking it couldn’t find the source struct to replace.  
Thanks!
