-
Notifications
You must be signed in to change notification settings - Fork 312
Description
I am hoping i can get a small amount of help, I am trying to add communication between actors and graph with structs. I have already added a function that will send structs to actors in a "notifyActorWithStruct" node, and now i have almost succeeded in adding a notifygraphwithstruct node.
The node has received the struct from the actor, but i cannot get it to output to the pin so that the next node can read the value of the Struct. I have been wrestling with this problem all day, and i will admit i am no expert in C++.
Currently i have this attempt, in my onNotifyFromActorWithStruct
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Flow", DisplayName="ReceivedStruct", meta = (SourceForOutputFlowPin = "ReceivedStruct"))
FFlowDataPinOutputProperty_InstancedStruct ReceivedStruct;
Which seems to create the correct output pin, i have also tried methods with FFlowPin and adding it to the outputpins array in the constructor, but this seems more succinct.
and in the .cpp i have
void UFlowNode_OnNotifyFromActorWithStruct::OnNotifyFromComponentWithStruct(UFlowComponent* Component, const FGameplayTag& Tag, const FInstancedStruct& NotifyValue)
{
if (Component->IdentityTags.HasAnyExact(IdentityTags) && (!NotifyTags.IsValid() || NotifyTags.HasTagExact(Tag)))
{
ReceivedStruct.Value = NotifyValue;
TriggerOutput(TEXT("ReceivedStruct"));
OnEventReceived();
}
}
This receives the correct Struct as NotifyValue, as i can see it when breaking the code in VS, but i cant for the life of me figure out how it is supposed to ensure that the pin provides the struct to the downstream node. As far as copilot is concerned i am doing it correctly, but nothing is passed.
Thank you for this plugin, and hope its not too much to ask for assistance, i am hoping there is something pretty obvious that i am doing wrong. The intended workflow here is that an NPC spots the player, sends a struct of the players location to the graph, which then based on narrative state decides what events to send towards the players location.