Disable NPC Lock

Disable NPC Lock v1.0
Shaz
​
Introduction
This script allows an NPC event to continue on its move route when you interact with it. It will not stop and turn to face you, then continue only when the event is finished. Use this when you want an NPC that will keep going about his/her business while talking to you.

How to Use
Paste into a new slot in Materials, below other scripts.
Add <nolock> as a comment on the event page.


Script
Download Here

FAQ


Credit and Thanks
- Shaz

Author's Notes
Okay to use in commercial games. Credit Shaz.
Oooh this is handy, finally cooks can stop worrying about their meals being burnt when you barge into their kitchens and talk to them xD cheers!
Nice! Btw, I want to let you know this script also works in XP 😅

Spoiler
I add these below class Game_Event and it worked
Code:
attr_accessor :clear_page_settings
attr_accessor :setup_page_settings
attr_accessor :lock
Nice! Very surprising, as XP's methods are usually so massive!
@callmedan yeah, XP's methods are a bit different. Try this in a new slot:

Code:
class Game_Event < Game_Character
  def lock
    return if @list && @list.size > 1 && @list.select{|cmd| (cmd.code == 104 || cmd.code == 408) && cmd.parameters[0] =+ /<nolock>/i}.size > 0
    super
  end
end

Now, the object.select method is used all over in Ace, but I can't find it anywhere in XP. This might mean it was introduced in a later version of Ruby, and if that's the case it'll give you an error. If that happens just come back and we'll find an alternative.
@Shaz Thank you so much! But it doesn't work. 🙁 Does the script include only a class?
did you put it above Main? Does the game crash or do you get a message?
Yes, I did. The game doesn't crash and I don't get any message. The script just doesn't work. The NPCs still turn toward player to talk.
The command code should be 108 instead of 104 then it would work. Thank you so much! 🙂
Good hunting! I was so sure that RM kept the same codes all the way through 🙁

Original thread: https://forums.rpgmakerweb.com/threads/disable-npc-lock.17721/