Disable NPC Lock

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Shaz, Sep 3, 2013.

  1. Shaz

    Shaz Veteran Veteran

    Messages:
    37,711
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    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.
     
    Last edited by a moderator: Dec 6, 2015
    #1
  2. Quigon

    Quigon electric boogaloo Veteran

    Messages:
    1,982
    Likes Received:
    951
    Location:
    Oklahoma
    First Language:
    English
    Primarily Uses:
    N/A
    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!
     
    #2
    Shaz likes this.
  3. callmedan

    callmedan Friendly Stranger Veteran

    Messages:
    562
    Likes Received:
    875
    Location:
    i'm behind you . . .
    First Language:
    Vietnamese
    Primarily Uses:
    RMXP
    Nice! Btw, I want to let you know this script also works in XP :kaoswt:

    I add these below class Game_Event and it worked
    Code:
    attr_accessor :clear_page_settings
    attr_accessor :setup_page_settings
    attr_accessor :lock
     
    Last edited: May 13, 2017
    #3
    Shaz likes this.
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,711
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Nice! Very surprising, as XP's methods are usually so massive!
     
    #4
    callmedan likes this.
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,711
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    @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.
     
    #5
  6. callmedan

    callmedan Friendly Stranger Veteran

    Messages:
    562
    Likes Received:
    875
    Location:
    i'm behind you . . .
    First Language:
    Vietnamese
    Primarily Uses:
    RMXP
    @Shaz Thank you so much! But it doesn't work. :( Does the script include only a class?
     
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,711
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    did you put it above Main? Does the game crash or do you get a message?
     
    #7
  8. callmedan

    callmedan Friendly Stranger Veteran

    Messages:
    562
    Likes Received:
    875
    Location:
    i'm behind you . . .
    First Language:
    Vietnamese
    Primarily Uses:
    RMXP
    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.
     
    Last edited: May 20, 2017
    #8
  9. callmedan

    callmedan Friendly Stranger Veteran

    Messages:
    562
    Likes Received:
    875
    Location:
    i'm behind you . . .
    First Language:
    Vietnamese
    Primarily Uses:
    RMXP
    The command code should be 108 instead of 104 then it would work. Thank you so much! :)
     
    #9
    Shaz likes this.
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,711
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Good hunting! I was so sure that RM kept the same codes all the way through :(
     
    #10
    callmedan likes this.

Share This Page