[Snippet Required] Locking Party Leader

Yanfly's script has the feature to lock the party leader so that they cannot be changed in the formation/party menu:


https://yanflychannel.wordpress.com/rmvxa/core-scripts/party-system/


However, this script has various other features which cause incompatibilities with others.


Therefore, I would like for a snippet from this script that simply brings up a message that prevents the main actor from being changed / swapped around from within the formation menu.


Scripts I would quite like for this to be compatible with are:


Neonblack CP Battle Engine (I'm not allowing the party member to switch out in battle either so don't worry about that)


https://cphouseset.wordpress.com/scripts/cp_battleview_2/


Blackmorning's base script, simple equip menu, icon menu and column menu.


http://forums.rpgmakerweb.com/index.php?/topic/24109-blackmorning-scripts/


That's all I have that have anything to do with party members.


Thanks!
I didn't test it with the scripts you linked, but almost everything is alias'd, so I don't see there being an issue.

Code:
class Window_MenuStatus < Window_Selectable  attr_accessor :formation  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  alias lock_main_menustatus_initialize initialize  def initialize(x, y)    lock_main_menustatus_initialize(x, y)    @formation = false  end  #--------------------------------------------------------------------------  # * Get Activation State of Selection Item  #--------------------------------------------------------------------------  def current_item_enabled?    return !(self.index == 0 and @formation == true)  endendclass Scene_Menu < Scene_MenuBase  #--------------------------------------------------------------------------  # * [Formation] Command  #--------------------------------------------------------------------------  alias lock_main_command_formation command_formation  def command_formation    lock_main_command_formation    @status_window.formation = true  end  #--------------------------------------------------------------------------  # * Formation [Cancel]  #--------------------------------------------------------------------------  alias lock_main_on_formation_cancel on_formation_cancel  def on_formation_cancel    @status_window.formation = !(@status_window.pending_index == -1)    lock_main_on_formation_cancel  endend
I was working under the assumption you always want just the first character locked in place (via formation, anyway). Let me know if that is not the case.
I didn't test it with the scripts you linked, but almost everything is alias'd, so I don't see there being an issue.


I was working under the assumption you always want just the first character locked in place (via formation, anyway). Let me know if that is not the case.
That works brilliantly. Would it be possible to have a message of some sort pop up, and/or for a selected SE (buzzer in this case) to play, as right now it lacks visual feedback for the player?
A buzzer should be playing already? Unless you don't have a sound effect set for the default "buzzer".


I can see about adding a message if you want, but it won't be tonight.
A buzzer should be playing already? Unless you don't have a sound effect set for the default "buzzer".I can see about adding a message if you want, but it won't be tonight.
Whoops! I had the sound off! Though, a message would still be good for the deaf/sound off players. Thanks!
Bump for message box? 🙂
Bump for message box? 🙂
Bump heard and processed!

Code:
class Window_MenuStatus < Window_Selectable    attr_accessor :formation  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  alias lock_main_menustatus_initialize initialize  def initialize(x, y)    lock_main_menustatus_initialize(x, y)    @formation = false  end  #--------------------------------------------------------------------------  # * Get Activation State of Selection Item  #--------------------------------------------------------------------------  def current_item_enabled?    return !(self.index == 0 and @formation == true)  endendclass Scene_Menu < Scene_MenuBase    MESSAGE = "Can't complete this action!"  #--------------------------------------------------------------------------  # * [Formation] Command  #--------------------------------------------------------------------------  alias lock_main_command_formation command_formation  def command_formation    lock_main_command_formation    @status_window.formation = true  end  #--------------------------------------------------------------------------  # * Create Popup Window  #--------------------------------------------------------------------------  def create_popup_window    center_x = (Graphics.width - 320) / 2    center_y = (Graphics.height - 48) / 2.5    @popup_window = Window_Selectable.new(center_x, center_y, 320, 48)    @popup_window.openness = 0    @popup_window.draw_text(@popup_window.contents.rect, MESSAGE, 1)    @popup_window.set_handler(:ok,     method(:on_popup_confirm))    @popup_window.set_handler(:cancel, method(:on_popup_confirm))    @status_window.deactivate ; @popup_window.open.activate  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  alias nathan_frost_lock_main_on_formation_update update  def update    nathan_frost_lock_main_on_formation_update    if @status_window.formation && @status_window.index == 0 && Input.trigger?(:C)      create_popup_window    end  end  #--------------------------------------------------------------------------  # * On Popup Confirm  #--------------------------------------------------------------------------  def on_popup_confirm    @popup_window.deactivate.close    @status_window.activate  end  #--------------------------------------------------------------------------  # * Formation [Cancel]  #--------------------------------------------------------------------------  alias lock_main_on_formation_cancel on_formation_cancel  def on_formation_cancel    @status_window.formation = !(@status_window.pending_index == -1)    lock_main_on_formation_cancel  endend

Original thread: https://forums.rpgmakerweb.com/threads/snippet-required-locking-party-leader.35855/