How to lock a single character's formation?

Hi! What I'm trying to do is have it so the player cannot change the formation of the main character, but can still change the formation of all the rest. Does anyone know how to do this? A plugin, perhaps?
yes, and because it requires a plugin or script this is the wrong place


I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.
Sorry, I did not know. I am actually kind of new here...
So, can anyone help me with this?
Try to browse at Yanfly's plugins, I think he has an actor lock script
Save the following as a new js file (call it whatever you want) in your js/plugins folder and add it to your plugin manager:

Code:
Game_Actor.prototype.isFormationChangeOk = function() {
  return !actor.actor().meta.lockFormation;
}

then put <lockFormation> in the note tag of any actor you want to lock into place.


If you try it and it doesn't work or you get an error message, please open the developer tools (F8) and post the console log.  I haven't tested this, but I'm hoping I've got the syntax correct.
Thanks! This helps a lot!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-lock-a-single-characters-formation.72134/