Page 1 of 1

Set Sim Status from PlayMaker

Posted: Sat Aug 20, 2022 12:42 pm
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.

Re: Set Sim Status from PlayMaker

Posted: Sat Aug 20, 2022 1:19 pm
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;