Can I make an NPC have dialogue for only certain party member(s)?

Context: I have an old man NPC who's throwing bottles at a tiefling in a bar because the old man believes the tiefling is a devil. I also have the tiefling as a recruitable character. So can I make it to where if the tiefling is in my party the old man will jump to a dialogue specifically for the tiefling? And possibly a different dialogue depending on if the tiefling is the party leader or not?

(example if tiefling is not party leader maybe the old man says something like: "What are you doing travelling along with a devil?" or if the tiefling is first in the party then the old man can address the tiefling specifically.)

I hope that makes sense, also this is my first post here so tell me if I did anything wrong! Thanks!:LZSsmile:
Let's assume the tiefling is actor 5 in your database.

Code:
Control Variables [Leader ID] = Game Data > Party Member #1 (Actor ID)
Conditional Branch: Actor [Tiefling] is in the party
  Conditional Branch: Variable [Leader ID] = 5 (or whatever the tiefling's actor id is, without leading zeros)
    Text: talk TO the tiefling
  Else
    Text: tiefling is in the party but not the leader
  End
Else
  Text: tiefling is not in the party
End
I'm sorry, I'm very new to this but I tried to do what you typed and this is what I came up with but in play testing the npc doesn't say anything regardless of whether or not the tiefling (Kyran) is in the party let alone leading the party.:LZSsad: Sorry if I'm being dense or missed something.
I'm sorry, I'm very new to this but I tried to do what you typed and this is what I came up with but in play testing the npc doesn't say anything regardless of whether or not the tiefling (Kyran) is in the party let alone leading the party.:LZSsad: Sorry if I'm being dense or missed something.
Well for one you didn't do it like Shaz described. You made 2 separate branches instead of a nested one.

The way you set it up says If Tiefling is in party, give dialogue one and if tiefling is leading the party also give dialogue two. It's also not accounting for when tiefling is not in the party.

If it doesn't give you any dialogue whatsoever, you might wanna check if your event has the right trigger. (Did you put it below player perhaps? Or maybe you need it on autorun, but it's not? Who knows, the screenshot doesn't include the full event window.)

1683779114650.png

Here, I redid what Shaz showed you in the event window. Maybe that makes it easier to understand.
You can give this a try since you are using MZ also. I check the Actor box and choose an Actor I wish to use.
Spoiler: Example
example.PNG
Well for one you didn't do it like Shaz described. You made 2 separate branches instead of a nested one.

The way you set it up says If Tiefling is in party, give dialogue one and if tiefling is leading the party also give dialogue two. It's also not accounting for when tiefling is not in the party.

If it doesn't give you any dialogue whatsoever, you might wanna check if your event has the right trigger. (Did you put it below player perhaps? Or maybe you need it on autorun, but it's not? Who knows, the screenshot doesn't include the full event window.)

View attachment 261555
Here, I redid what Shaz showed you in the event window. Maybe that makes it easier to understand.
I very much appreciate the screenshot. I must apologize again for my newness to this all. When I play test with my attached photo I get the dialogue as if Kyran isn't in the party regardless of whether he's in the party, leading the party or not in the party at all (although that is the correct response for him not being in the party.)
You can give this a try since you are using MZ also. I check the Actor box and choose an Actor I wish to use.
Spoiler: Example

I appreciate the response but I'm afraid I'm not quite sure what I'm looking at 🙁
I appreciate the response but I'm afraid I'm not quite sure what I'm looking at 🙁
So I tried ticking the box and hovered over it see what it says "appears when specified actor is in the party" but the event doesn't show up even when he is in the party and I double/triple checked to make sure Kyran is slotted as 0002 in actors but it seems like for some reason the game is not recognizing the Kyran is actor 0002 and in the party.
I tried to replicate a new event, and it looks like it worked for me when I made it a New Page on the second page, with the Actor checked option, but not the first page, if it was an Auto Run event.

Try to have the event with the character standing whether it says nothing or just its standard event text, then the next page have the Actor box have the Actor you want to be the variable for the event.
I tried to replicate a new event, and it looks like it worked for me when I made it a New Page on the second page, with the Actor checked option, but not the first page, if it was an Auto Run event.

Try to have the event with the character standing whether it says nothing or just its standard event text, then the next page have the Actor box have the Actor you want to be the variable for the event.
Hmm, so if I understand correctly this is what I did: I made 2 pages, first, page 1 has a dialogue that says leave me alone and then page 2 has the actor switch ticked plus a different dialogue but even when Kyran is in the party/leading the party (either way) it just triggers the first page.
I don't know why it doesn't seem to work, maybe try a different actor and see if it will work with them?
I'm sorry it doesn't seem to work for you. I really don't understand what else would need to be done :/ I made a new map and even made new actors to try a new event and it worked. Unless it's a plugin helping it work for me? Oh boy, I hope that isn't the case. :LZSblush:

*Edit*
Made a new game with no plugins out of paranoia lol and it wasn't a plugin issue. I really wish I knew why that isn't working for you 🙁 If that code is still in there with that checked, that could be it?
I don't know why it doesn't seem to work, maybe try a different actor and see if it will work with them?
I'm sorry it doesn't seem to work for you. I really don't understand what else would need to be done :/ I made a new map and even made new actors to try a new event and it worked. Unless it's a plugin helping it work for me? Oh boy, I hope that isn't the case. :LZSblush:
Again I super appreciate all the help you've given, I'll try out different actors and maybe try a new project as well in case I messed something up along the way with actors or anything.
Double-post notice: @Floopie_Floop

Yeah, what you did was not what I typed at all.

What you've got in post #6 should work. Is that the only tab in your event, and what are the conditions?

When you do a screenshot, please show the entire event window, not just the event commands. There could be a number of reasons why it didn't work properly, and we need to see the rest of the event (tabs, trigger, conditions) to be sure there's not something else going wrong.

At this stage, please don't try it with multiple tabs. Having 3 people suggest different strategies and you trying all of them just confuses things.

Also please show us a screenshot of your Actors tab, play the game and talk to the guy, then go to the menu and show us a screenshot of that so we can see your party lineup. And a screenshot of your plugins so we can see if you have any that might be interfering.
Sorry about the double post, thank you for the rules link. Here are some screenshots.
Double-post notice: @Floopie_Floop

Yeah, what you did was not what I typed at all.

What you've got in post #6 should work. Is that the only tab in your event, and what are the conditions?

When you do a screenshot, please show the entire event window, not just the event commands. There could be a number of reasons why it didn't work properly, and we need to see the rest of the event (tabs, trigger, conditions) to be sure there's not something else going wrong.

At this stage, please don't try it with multiple tabs. Having 3 people suggest different strategies and you trying all of them just confuses things.

Also please show us a screenshot of your Actors tab, play the game and talk to the guy, then go to the menu and show us a screenshot of that so we can see your party lineup. And a screenshot of your plugins so we can see if you have any that might be interfering.
You have two actors named Kyran. Are you sure it's Actor 2 you have in the party, and not Actor 13?

If you're not sure, right after setting the variable to the leader's actor id, add a Text command and put \v[3] in the text. Then save and play, and it'll show you the actor id of the party leader. You could also just run the event then hit F9 to bring up the debug window, and go through and find the variables and see what's in variable 3.
instead of checking for ID through the dialogue, just put another page on the old man's event that triggers with that character.
if all he does is say his line, lead with the condition for it.
if not, put the check above it all, deal with the condition, and then go off to play that NPC's standard routine.
the standard routine would happen independent of the condition.... so it should validate separately.
I am so sorry to everyone that helped me, the issue was exactly as Shaz said
You have two actors named Kyran. Are you sure it's Actor 2 you have in the party, and not Actor 13?

it was using actor 13...:LZSsad: Like I said I'm still very new and I totally missed that I had two of the same actor.
But again, huge thank you to everyone for their help and patience!

Original thread: https://forums.rpgmakerweb.com/threads/can-i-make-an-npc-have-dialogue-for-only-certain-party-member-s.157421/