Thanks, yeah the trouble is functions don’t allow Latent nodes or Events. Which an RPG conversation/dialogue kind of needs.
So I had to go with a macro library.
What I have now is a bit ugly, and involves a poll every frame in a macro. Would appreciate anyone’s ideas for improvement.
That said, it looks like it will be fairly easy to jump around in the conversation, by allowing the macros to finish without activating their Output execs if the conversation has jumped elsewhere.
If anyone’s interested:
This is a class blueprint for an actor that keeps track of the current node and displays it to the user. For each type of node it will have 3 functions:
(string speaker, string text)
Sets the current node to be a simple line. Displays it to the user.
)
Outputs a boolean indicating whether the current node has been finished (i.e. the user has pressed space).
SimpleLine_End
Clears the current node, ready for the next node.
BPML_Conversations
This is a macro library with a macro for each type of conversation node.
SimpleLine( engine, string speaker, string text)
This macro calls on the engine, then loops forever (with a tiny delay each time) until SimpleLine_PollEnd indicates that the node is ready to finish. It then calls SimpleLine_End and activates it’s output exec.
BP_Conversation_Blah
The actual conversation can now use the SimpleLine macro and a variable to edit the conversation in a slightly clumsy but acceptable format.