so ive already tried making a variable for it. i made a variable that checks for the actor id of the party leader, and im pretty sure it used to work, but it no longer works and will display the same piece of text no matter who the party leader is. is there another method i could use or a way to fix this? 😅
changing dialogue based on the party leader
RPG Maker MV SupportI don't know what you tried, but a simple approach is to:
- Store the ID of the leader in a variable:
- Control Variables -> Game Data -> Party -> Member #1.
- Then do different things depending on the value of that variable:
- Conditional Branch -> Variable
◆Control Variables:#0001 Check = Actor ID of the party member #1
◆If:Check = 1
◆Text:None, Window, Bottom
: :\N[1], you're just in time!
◆
:Else
◆Text:None, Window, Bottom
: :I'm waiting for \N[1].
◆
:EndYou should be able to do something like
If: Script: $gameParty.leader() ==1
Do stuff
No need to store the leader id in a variable
If: Script: $gameParty.leader() ==1
Do stuff
No need to store the leader id in a variable
You could use one of these in Conditional Branch -> Script:
var a = $gameParty.leader(); a && a.actorId() === 1- check actor ID.$gameParty.leader() === $gameActors.actor(1)- checkGame_Actorinstance.
- Reduces the risk of getting things wrong (as here),
- Provides a persistent value for later reference (e.g. multi-case checks), and
- Avoids an unnecessary
eval.
thank you! this fixed the problem 😂
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/changing-dialogue-based-on-the-party-leader.166402/