Page 1 of 1

MessageSystem "Send Message" LUA function in Dialogue?

Posted: Wed May 04, 2022 11:01 am
by mroshaw
Hi again!

I was wondering if there's a way to send a message using the MessageSystem, directly within Dialog? I'd like to send a message if a particular dialogue node is reached during a conversation, as I have a listener Component waiting for such a message to enable and spawn various collectable prefabs.

Many thanks again for your help!

Re: MessageSystem "Send Message" LUA function in Dialogue?

Posted: Wed May 04, 2022 1:05 pm
by Tony Li
Hi,

Add a CommonLibraryLua component to your Dialogue Manager. This will make these Lua functions available:
  • SendMessageSystem("message", "parameter");
  • SendMessageSystemString("message", "parameter", "value");
  • SendMessageSystemInt("message", "parameter", (int)value);
You can use those Lua functions in a dialogue entry's Script field.

Re: MessageSystem "Send Message" LUA function in Dialogue?

Posted: Sat May 07, 2022 9:53 am
by mroshaw
Perfect, thank you again!

Re: MessageSystem "Send Message" LUA function in Dialogue?

Posted: Sat May 07, 2022 9:56 am
by Tony Li
Happy to help!