Set Sim Status from PlayMaker

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Set Sim Status from PlayMaker

Post by Abelius »

Howdy,

I'd like to make a PlayMaker action that is capable of doing something like...:

Conversation[3].Dialog[22].SimStatus = "WasDisplayed"

...which works in DS as a script.

However, I'm having difficulties translating that to C#.

I have two "candidates"...:

Lua.Run() method
DialogueLua class

...but in the first one I don't have the slightest idea of what to write. And in the second I don't see anything promising apart from "SetStatus", that doesn't seem to be related to Sim Status.

I could use some help here, hehe.

Thanks.
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Set Sim Status from PlayMaker

Post by Tony Li »

Hi,

Use the DialogueLua class.

To set a dialogue entry's SimStatus, use DialogueLua.MarkDialogueEntryUntouched(), Offered(), or Displayed():

Code: Select all

var dialogueEntry = DialogueManager.masterDatabase.GetDialogueEntry(3, 22);
DialogueLua.MarkDialogueEntryDisplayed(dialogueEntry);
Alternatively, you could use Lua.Run() instead:

Code: Select all

Lua.Run("Conversation[3].Dialog[22].SimStatus = 'WasDisplayed'");
To get a dialogue entry's SimStatus, use DialogueLua.GetSimStatus(): (you can use IDs or DialogueEntry)

Code: Select all

string simStatus = DialogueLua.GetSimStatus(3, 22);
Or use Lua:

Code: Select all

string simStatus = Lua.Run("return Conversation[3].Dialog[22].SimStatus").asString;
Post Reply