x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Expand Node : generate and call an event

Hi there!

I'm currently struggling to achieve something with custom K2 nodes. I prefer not to explain why (it would be very long), but I would like to make a node that can expand like shown in the image below, when ExpandNode(...) is called at the expansion step of blueprint compilation.

The idea is to cut the execution flow and generate a custom event + a call to that event. I know it sound very stupid presented like that, but actually this is just an example I made to ask my question. If someone can answer me, I will use that answer for a completely different thing. Quickly, it's about an almost-pure node that would create an event and generate an object with a reference to this event to be fired later.

I know a bit the blueprint compilation process, but I'm still struggling to get my way with Delegates, FMemberReference(s) and UFunction(s)... Anyone has an idea on how to do it ?

alt text

I tried that, but it's not working at all. It's saying that a function called "DialogEvent_0" wasn't found, as a compilation error log.

 UK2Node_CustomEvent* EventNode = CompilerContext.SpawnIntermediateEventNode<UK2Node_CustomEvent>(this);
 EventNode->CustomFunctionName = "DialogEvent";
 EventNode->RenameCustomEventCloseToName();
 EventNode->AllocateDefaultPins();
 EventNode->GetPinAt(1)->MakeLinkTo(GetThenPin()->LinkedTo[0]);
 GetThenPin()->BreakAllPinLinks();
 
 UK2Node_CallFunction* FireEventNode = CompilerContext.SpawnIntermediateNode<UK2Node_CallFunction>(this);
 FireEventNode->SetFromFunction(EventNode->FindEventSignatureFunction());
 FireEventNode->AllocateDefaultPins();
 GetThenPin()->MakeLinkTo(FireEventNode->GetExecPin());


Product Version: UE 4.21
Tags:
ue4-node-expand.png (125.6 kB)
more ▼

asked Dec 05 '18 at 09:02 PM in C++ Programming

avatar image

CraftyWeazel
59 5 6 11

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I managed to do it and answered with an explanation in this other thread I made : https://answers.unrealengine.com/questions/855025/view.html

more ▼

answered Dec 13 '18 at 11:26 PM

avatar image

CraftyWeazel
59 5 6 11

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question