Party Formation Order Specific Condition

Sorry if this has been asked and answered before, but I couldn't find anything with the search. Maybe I wasn't using the right phrasing.

Just starting tinkering with RPG Maker VX Ace, already made a mini-game, so I have the very basics down I think, but I'm still pretty much a n00b. Still am confused at how scripting works and such. Anyway, I'm wondering if there is a way to change NPC dialogue depending on the formation of the party. For example, let's say I have Actors Pete (1), Mary (2), and Jim (3).

Now, let's say I want to have it so Mary has to speak to an NPC for him to say something specific, vs. talking to Pete or Jim, where he'll say something else.

I know you can technically do so by simply setting the condition "Mary exists in the party" to trigger a different bit of dialogue generally, but what if I want the dialogue to only trigger if Mary is specifically in the front of the line?

Similarly, what if I want doors to only open if Jim is in the front of the line?

I can't seem to find something specific for this, unless I'm just overlooking it.

Thanks in advance. 🙂
Control Variables > Game Data > Party Member #1's Actor ID
Control Variables > Game Data > Party Member #1's Actor ID
Took a little testing, but I think I got it figured out. Thanks! 🙂
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/party-formation-order-specific-condition.30978/