Change IsPlayer using Sequencer

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
davegagne
Posts: 17
Joined: Mon Nov 22, 2021 10:26 pm

Change IsPlayer using Sequencer

Post by davegagne »

Hi there !

I was wondering if there was any easy way to change the IsPlayer bool using a sequencer. I've got certain NPCs that I'd like to get on the left side (Player side) of the dialogues for certain conversation. Do I have to create a custom script or can that be done built-in with a sequencer command?

At the moment, I'm trying this, but it doesn't work (really not sure SetVariable is the right thing to use here):

SetVariable(NonPlayer.isPlayer, true);

Thanks !

Dave
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change IsPlayer using Sequencer

Post by Tony Li »

Hi,

It sounds like what you really want to do is make an NPC appear in the (left-hand) subtitle panel that's usually used for PCs. If this is the case, you don't have to change the IsPlayer bool. Just tell the NPC to use that panel. If you inspect your dialogue UI's Standard Dialogue UI component, you'll see that the subtitle panels are numbered 0, 1, 2, etc.

To tell a character to use a panel for a single dialogue entry node, include a [panel=#] markup tag in the dialogue text. For example, assuming the left-hand panel is panel #1:
  • Dialogue Text: "I'm on the left side. [panel=1]"
To tell a character to use a panel from now on, use the SetPanel() sequencer command:
  • Dialogue Text: "I, Bob, am on the left side now and will stay on the left side."
  • Sequence: {{default}}; SetPanel(Bob, 1)
davegagne
Posts: 17
Joined: Mon Nov 22, 2021 10:26 pm

Re: Change IsPlayer using Sequencer

Post by davegagne »

Thanks Tony,

I'll try that ASAP and reach back.

Thanks for the prompt answer !

Dave
davegagne
Posts: 17
Joined: Mon Nov 22, 2021 10:26 pm

Re: Change IsPlayer using Sequencer

Post by davegagne »

Hi Tony,

Happy to report this achieves exactly what I wanted to do. Thanks again for your help !

Dave
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change IsPlayer using Sequencer

Post by Tony Li »

Glad I could help! :-)
Post Reply