Hi,
we are currently using C++ to generate cutscenes in Sequencer to handle some dialogs. What we want to do is generate a sequence containing an event for each dialog line that should be played so that the UI can update depending on it at the right moment.
We want to populate each event payloads with the content of the corresponding dialog line. The problem is, every time I start the sequence, the payload’s parameters are set to none. Here is my event after I compile and start the project :
and here it is after I press play, simulate or anything like that :
Here is the code I use to create the event and its payload, did I miss anything ?
// create the payload and its parameters
FEventPayload Payload;
Payload.EventName = "SEQ_DisplayLine";
FMovieSceneEventParameters Params;
UDialogEventParams* EventParams = NewObject<UDialogEventParams>(this);
EventParams->bBoobool = false;
EventParams->Parameters.CharacterName = FText::FromString("Name");
EventParams->Parameters.DialogLine = FText::FromString("A well written sentence");
EventParams->PrepareCppStructOps();
Params.Reassign(EventParams);
Payload.Parameters = Params;
// create the event
EventData.AddKey(0, Payload);
And here are the structures I use for the payload’s parameters :
USTRUCT(BlueprintType)
struct FDialogEventParamsStruct
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadOnly, Category = "Dialog")
FText CharacterName = FText();
UPROPERTY(BlueprintReadOnly, Category = "Dialog")
FText DialogLine = FText();
};
UCLASS(BlueprintType)
class UDialogEventParams : public UScriptStruct
{
GENERATED_BODY()
public:
UPROPERTY()
FDialogEventParamsStruct Parameters;
UPROPERTY()
bool bBoobool = true;
};
If anyone knows what’s missing, I’m open to any solution =)
Thanks in advance!