Struct change and Data table

I have a question about Data tables made from Structs.
When i make a data table from a blueprint struct (struct made within unreal), i can later change that struct and data table is immediately updated.
Data tables made from C++ structs don’t seem to be able to do this. They become HOTRELOADED and don’t seem to be usable after this.

So i would like to ask, is it possible to modify c++ struct so that a data table made from this struct doesn’t become unusable?
Is it possible to use a data table made from a blueprint struct in c++ code?

4-26 user here. In my experience Datatables properly update properties defined in their c++ structs after restarting the editor. I never use the hot-reload feature as I’ve been told it is experimental / causes corruption. So just close the editor, wait a few seconds, recompile in VS and restart the editor.

There’s no reason why you’d want to define a USTRUCT in a UAsset file as it will just complicate things later on if you want to port code from BP to C++.

The only trouble I’ve experienced with datatables is that they do not automatically respond to renaming a c++ struct, but that can be solved with a redirector.

USTRUCT(BlueprintType)
struct FS_Appointment : public FTableRowBase  {
	GENERATED_BODY()

	UPROPERTY(BlueprintReadWrite, EditAnywhere)
		FDateTime DateTime;

	UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (Tooltip = "Duration in hours"))
		float Duration;

	// Initialize
	FS_Appointment() {
		DateTime = FDateTime(FDateTime::UtcNow().GetYear(), 1, 1, 12);
		Duration = 1.0f;
	}
	FS_Appointment(FDateTime InDateTime, float InDuration, FGuid InEcoZoneID, E_EcoAppointmentRecurrance InAppointmentRecurrance, int InPriority) {
		DateTime = InDateTime;
		Duration = InDuration;
	}

	// Operators
	bool operator==(const FS_Appointment& Other) const {
		return (
			DateTime == Other.DateTime
			&& Duration == Other.Duration
		);
	}
};

Thanks, i’m really new to unreal so i didn’t realize you can compile the source directly in vs, i always used the compile button in unreal editor

Using Hot Reload is the problem - don’t do it. If you’re making changes to a USTRUCT() layouts, you need to close and rebuild inside visual studio.

5.0 might improve this with Live Coding + Reinstancing, but I’ve not tried it, and it’s still massively risky.