4.7.2 Hot reload not work and Recompile button lose

[Engine version 4.7.2]

problem 1:
I have a cusom UObject c++ class,
add a FVector class member variable and compile in vs2013(by F7),
this variable doesn’t appeared in inherited variable list of the blueprint child class.
close and reopen the bp class doesn’t work too.

and then,
click the RECOMPILE tool button(between BUILD button and Play button) take a recompile in editor, the variable i add in c++ header appeared.
but, the blueprint class get compile error: Error This blueprint(self) is not a HOTERELOADED_MyUclassName_0, theirfore ‘Target’ must have a connection.
RESTART editor will solve this problem, the blueprint class successfully compiled and the variable appeared.

problem 2:
sometimes the RECOMPILE tool button disappeared! I forgot how to reduce this, sorry~~~

Hey ,

Just to make sure I can accurately reproduce your error (working on Problem 1), can you give me the code from your custom UObject class?

More detailed steps on how you set up your blueprint child class would help too - I don’t want to make assumptions that would mess up your repro steps.

/*
Hi Jonathan,
I am very pleasure to help you to make UE4 get more stronger, more better.
here is my code with the hot reload problem, the property FVector moveTargetPos on LINE 81 get the problem.
I have checked second time before I post the question on answerhub: add another member variable and compile in vs2013 and it doesn’t appear.

here are some possible reason I think:
1, I like separate member variable to multi section, does it matter?
2, The UGameLogic class has a blueprint child class BP_GameLogic is hosted to GEngine->Singleton. add variable to this class is means change BP_GameLogic’s parent class.
3, I am using VSOL(visual studio online)'s git source control service(like github), does it confuse ue4 editor and can not found files has been changed?
4, I am using Visual Studio 2013 community version, installed a windows azure sdk.
*/

~CODE IN ATTACHMENTS~link text

another question: Do you know how to make a new line?
line1 end with enter
line2 end with br

line3 end with hr



line4 end with hr tool button


line5

i got it. only hr label is works, either type or toolbar button


i will take a good format later.


^ ^

pre/code test
line 1
line 2
line 3

Hey -

If you create a new blueprint based on the same actor are you still unable to see the FVector variable in the inherited list? I created a class based on Object and then created a blueprint based on the new class. After creating the blueprint I added a UPROPERTY() macro and FVector variable to the code and did a hot reload (right click on the project name as select Build). Is this the same workflow that you used?

In response to your second question, it would be best to start a separate post so that the two issues don’t get confused in the same thread. Creating a new post will also make it easier to search for if someone else is having the same problem. Please be sure to include as much information to describe the problem as possible.

Cheers

Hi ,
Thanks for your response, and sorry for the late reply. ^ ^
I have tested times and times, i found that if the RECOMPILE toolbar button disappeared the hot reload is not worked any more too.(So, these two problems may be just one problem.)

my test process:
1, create a new c++ third person template project.
2, build and run editor, the RECOMPILE button is lying on Play button's left.
3, add a class member variable on AProjectCharacter( ProjectCharacter.h, line 28 behind float BaseLookUpRate variable)
    	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Camera)
		FVector moveTargetPos;
  then press F7 to compile project.
  after compiled, switch to editor. open the ThirdPersonCharacter blueprint class(data only class), you will find "Move Target Pos" variable in Camera category.Close the blueprint class window to prevent other hide problem with hot reload.
4,  switch to vs2013, repeat step 3 to add a moveTargetPos2.
5, repeat step 3 to add moveTargetPos3.
6, repeat step 3 to remove moveTargetPos3.
7. repeat step 3 to remove moveTargetPos2.
8. repeat step 3 to add move3.  then... you found RECOMPILE button disappeared and move3 is not found.

i have tested 2 hours for this, it seems the key is hot reload times,  it has nothing to do with variable names and variable count.
sometimes hot-load failed on 5th reload, sometimes on 4th, or maybe on 10th. add 10 variable one time is OK.


Cheers.

Hye -

Using F7 doesn’t preform a recompile of the code for me. Are you compiling and running the game in debug mode through VS? If you use the compile button in the edtior or right click on the project name in the solution explorer to build the project do you still lose the compile button?

Hi ,

    I am using 4.7.2 pre-compiled version that installed by the launcher.
    
    The workflow that compile in visual studio and switch to editor to check auto hot-reload result is works well at most time for me, 
    works well in both Development Editor  and  DebugGame Editor solution.
    
    The problem is hot reload can not work well always, it may failed on 5th reload, and can not work any more.

    Build output log seems cannot put it here, I will try to comment later.

    Cheers.

==========Development Editor output============
1>------ Build started: Project: Alpha, Configuration: Development_Editor x64 ------
2>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>Project not selected to build for this solution configuration
1> Compiling game modules for hot reload

    =========DebugGame Editor output=========
    1>------ Build started: Project: Alpha, Configuration: DebugGame_Editor x64 ------
    2>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
    2>Project not selected to build for this solution configuration 
    1>  Compiling game modules for hot reload
    1>  Parsing headers for AlphaEditor
    1>  Reflection code generated for AlphaEditor
     ...delete something to limit words...
    1>  [4/4] Link UE4Editor-Alpha-4473-Win64-DebugGame.dll
    1>     Creating library F:\UE4_levels\Alpha\Intermediate\Build\Win64\AlphaEditor\DebugGame\UE4Editor-Alpha-4473-Win64-DebugGame.lib and object F:\UE4_levels\Alpha\Intermediate\Build\Win64\AlphaEditor\DebugGame\UE4Editor-Alpha-4473-Win64-DebugGame.exp
    1>  -------- End Detailed Actions Stats -----------------------------------------------------------
    1>  Cumulative action seconds (4 processors): 0.00 building projects, 0.95 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.58 linking, 0.00 other
    1>  UBT execution time: 11.49 seconds
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========

Hey -

Sorry for the delayed response. I am still investigating this issue however finding steps to reproduce this has been difficult. As a work around, if the compile button disappears/stops functioning you should be able to close and reopen the project. Doing so should bring the Compile button back.

Cheers

Hi ~~

That’s OK!

This is not a terrible problem, i restart editor to solve it each time. Don’t worry about this ^ ^

Have a nice weekend!

Cheers,
.

I have the same problem. No reload code after compile code for hor reload. Reopening engine every time is not cool work.

I found the bug source:

@ UnrealEngine\Engine\Source\Runtime\Core\Private\Modules\ModuleManager.cpp
@ FModuleManager::MakeUniqueModuleFilename

Replace
*Module->OriginalFilename.Right( Module->OriginalFilename.Len() - SuffixPos ) );
to
TEXT( “.dll” ) );

This code will definitely work for PC, I am not sure if hot reload supported for other platforms.
The reason of issue is that this code will generate name of module as …/…/MyGameName_1234_5678.dll
But to source compiler only MyGameName 1234 part will be provided and compiler will succesfully produce
…/…/MyGameName_1234.dll

Still exists in 4.17

Hey -

Do you have any reproduction steps or a sample project showing the behavior? I am able to create a code project and add/update code with the editor open. Please elaborate on exactly what you’re doing and the result.

Hi ,

The c++ project has to be recompiled several times (with changes) to catch the bug effect. Please check out my comment above for more details.

Hey ,

I already solved the mystery. This doesn’t seem to be documented anywhere on Epic documentation, sites or anything, but it looks like putting your macros defining delegates (Event dispatchers like MULTICAST_DELEGATE…) INSIDE your class declaration will cause the Hot Reload to fail and produce “missing functions” in that class.

Moving the declaration macros up, out of the class scope fixed the issue. Would be nice if it was mentioned somewhere.

Hey ,

I already solved the mystery. This doesn’t seem to be documented anywhere on Epic documentation, sites or anything, but it looks like putting your macros defining delegates (Event dispatchers like MULTICAST_DELEGATE…) INSIDE your class declaration will cause the Hot Reload to fail and produce “missing functions” in that class.

Moving the declaration macros up, out of the class scope fixed the issue. Would be nice if it was mentioned somewhere.