Quest and Party Question

I have a quest that the player can do and at a certain point they get to choose who answers a question from the party members on the quest. How would I make it to where who they choose is put as the leader for the answer without removing party members and readding them back?
might require a script call, but you can put the ID of the party member into a variable and then use that ID to find the character to put them as the party leader.
I found this:

$game_party.swap_order(0, $game_variables[1] )

0 is for Party Member 1, the Leader Position.
The Variable is to Store the Id of the chosen Party Member (0, 1, 2 or 3 for Member 1, 2, 3 or 4).
I found this:

$game_party.swap_order(0, $game_variables[1] )

0 is for Party Member 1, the Leader Position.
The Variable is to Store the Id of the chosen Party Member (0, 1, 2 or 3 for Member 1, 2, 3 or 4).
I read this, but I am still a bit confused as to what I am supposed to do.
@slickdeath97 then tell us what part of the tutorial you do not understand.

and one suggestion:
Reading (or watching) a tutorial is always a waste of time for everyone.
Because to understand a tutorial you have to work through it.
So make a new project and enter everything the tutorial tells you to do, to test exactly what it does
That means no try to adapt it to your own game on the fly, you need to get it working as the tutorial describes first.

that usually helps people in understanding tutorials.
@slickdeath97 then tell us what part of the tutorial you do not understand.
With the variable and the party members id, how do I store the party members id into the variable. I know about the leader and how to tell who the leader is, but how does the variables with the members ids work?
Here is a Solution, but it only works if 4 People are in the Party or a constant known number of Members else the Game will Crash XD. The Code would need Editing to make it work for a varying number of Party Members.
If its always 2 or 3 or 4 like in the Example code than this works as it is.
Example:
swapparty016545.png

I hope this helps.
Had to look at the Scriptcall list myself to build this XD.
Very helpful Scriptline Collection.
Here is a Solution, but it only works if 4 People are in the Party or a constant known number of Members else the Game will Crash XD. The Code would need Editing to make it work for a varying number of Party Members.
If its always 2 or 3 or 4 like in the Example code than this works as it is.
Example:
View attachment 223164
I hope this helps.
Had to look at the Scriptcall list myself to build this XD.
Very helpful Scriptline Collection.
Okay but what if I have more than four people in the party?
what if I have more than four people in the party?
the number of actors in the party doesn't matter as long as it is a fixed number.
but if the party size varies, then the game will crash if those commands are used with a number that has no actor.
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor Swap For Conversation  ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║   Swap actor positions              ║    14 Apr 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to change actors to make a specific actor first   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Set the variable below for this script                 ║
# ║                                                          ║
# ║   Use script call to swap actors                         ║
# ║      swap_actor_convo(X)                                 ║
# ║        X = actor id to be at the front of the party      ║
# ║   Then use swap_actor_convo($game_variables[X])          ║
# ║        X = the variable number used below                ║
# ║     to change the actor back to original position        ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝

module R2_Swap_Actor_Conversation
  Variable = 1
end
class Game_Interpreter
  def swap_actor_convo(aid)
    swap = 0
    for i in 0..$game_party.members.size - 1
      swap = i if $game_party.members[i].id == aid
    end
    return if swap == 0
    $game_variables[R2_Swap_Actor_Conversation::Variable] = $game_party.members[0].id
    $game_party.swap_order(0, swap)
  end
end
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor Swap For Conversation  ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║   Swap actor positions              ║    14 Apr 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to change actors to make a specific actor first   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Set the variable below for this script                 ║
# ║                                                          ║
# ║   Use script call to swap actors                         ║
# ║      swap_actor_convo(X)                                 ║
# ║        X = actor id to be at the front of the party      ║
# ║   Then use swap_actor_convo($game_variables[X])          ║
# ║        X = the variable number used below                ║
# ║     to change the actor back to original position        ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝

module R2_Swap_Actor_Conversation
  Variable = 1
end
class Game_Interpreter
  def swap_actor_convo(aid)
    for i in 0..$game_party.members.size - 1
      swap = i if $game_party.members[i].id == aid
    end
    return if swap == 0
    $game_variables[R2_Swap_Actor_Conversation::Variable] = $game_party.members[0].id
    $game_party.swap_order(0, swap)
  end
end
I tried it and it didn't change the actors in the party.
1649985623899.png

1649985652416.png

1649985694012.png

What did I do wrong? I set it to an empty variable spot as well.
The amount of Actors does not Matter but the amount of Member slots occupied, you know the amount which is fighting in Battle and visible in Menu. The 4 Heroes you want to choose from.

Because my Code example had 4 choices, but if its only 1 or 2 or 3 than what happens if the Player selects the fourth choice. It should not be there in the first Place. And in that case even the Game crashes.
So its ok to have 100 Hero Actors, but we need to know if its always 4 or 6 or 8 or random 1 to 4 depending on the Player.

Because if i Edit my Code to fit random 1 to 4 Party Members, than the Code grows in Size and will be less easy to read and to understand. Maybe if Player has always 4 People in Party, than i dont have to even worry about this "case", i just mentioned it because iam not happy when people run into errors like that because of prototype code which does not include every possible case and outcome.
And this Info was not present in here. So i asked about it. To know if something needs Editing or not.
Or maybe you understand simple example, and than continue yourself, than ask again if something does not work.
What did I do wrong? I set it to an empty variable spot as well.
Not you. You have yanfly party manager script.
Also the actors did change for me. Using your demo just not the sprites.
*also updated the other script to make sure there are no problems if the actor entered in the script call is not in the party.
Add this below Yanfly Party Manager.
Ruby:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# SYF [Soulpour Yanfly Fix] - Party System Swap Fix
# Author: Soulpour777
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Swap Order Fix – If you want to use the script call $game_party.swap_order(n,n)
class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # Alias Listings
  #--------------------------------------------------------------------------
  alias :syf_yanfly_party_swap :swap_order
 
  #--------------------------------------------------------------------------
  # Swap Order
  #--------------------------------------------------------------------------
  def swap_order(index1, index2)
    id1, id2 = @actors[index1], @actors[index2]
    pos1 = @battle_members_array.index(id1)
    pos2 = @battle_members_array.index(id2)
    @battle_members_array[pos1] = id2 if pos1
    @battle_members_array[pos2] = id1 if pos2
    syf_yanfly_party_swap(index1, index2)
  end
 
end
Not you. You have yanfly party manager script.
Also the actors did change for me. Using your demo just not the sprites.

Add this below Yanfly Party Manager.
Ruby:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# SYF [Soulpour Yanfly Fix] - Party System Swap Fix
# Author: Soulpour777
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Swap Order Fix – If you want to use the script call $game_party.swap_order(n,n)
class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # Alias Listings
  #--------------------------------------------------------------------------
  alias :syf_yanfly_party_swap :swap_order
 
  #--------------------------------------------------------------------------
  # Swap Order
  #--------------------------------------------------------------------------
  def swap_order(index1, index2)
    id1, id2 = @actors[index1], @actors[index2]
    pos1 = @battle_members_array.index(id1)
    pos2 = @battle_members_array.index(id2)
    @battle_members_array[pos1] = id2 if pos1
    @battle_members_array[pos2] = id1 if pos2
    syf_yanfly_party_swap(index1, index2)
  end
 
end
It worked. Thanks for the help.
It worked.
Didn't catch you in time I assume. I updated the first script to fix a possible issue. Just copy it over again.
Didn't catch you in time I assume. I updated the first script to fix a possible issue. Just copy it over again.
Fix didn't do anything. Everything works so far though.

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/quest-and-party-question.146731/