MessageSystem "Send Message" LUA function in Dialogue?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

MessageSystem "Send Message" LUA function in Dialogue?

Post 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!
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

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

Post by mroshaw »

Perfect, thank you again!
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Happy to help!
Post Reply