NPC's Move While Text is Displayed?

Discussion in 'RGSSx Script Support' started by MasterLagger, Jan 24, 2014.

Thread Status:
Not open for further replies.
    Tags:
  1. MasterLagger

    MasterLagger Odder than Odd Veteran

    Messages:
    58
    Likes Received:
    5
    First Language:
    English
    I've noticed that when a text box is displayed in-game that the NPC's that wander around still move about. This isn't a big problem at the moment, but it could be later on when I start adding enemy NPC's. Say for example, you open a treasure chest and a 'You got...blahblahblah' text box pops up. An enemy NPC will still approach the player while the message is present and attack the player.

    I may be missing something obvious, but how would I stop NPC's from moving while the Text Box is displayed?
     
    Last edited by a moderator: Jan 24, 2014
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,794
    Likes Received:
    11,502
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Moving this to RGSSx Script Support as it will require a very simple mod to a script. If nobody gives you that mod by the time I get home this afternoon, I'll come back and provide it.
     
    #2
  3. MasterLagger

    MasterLagger Odder than Odd Veteran

    Messages:
    58
    Likes Received:
    5
    First Language:
    English
    What kind of script mod? I tried searching the forum without any luck finding the edited script you mentioned.
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,794
    Likes Received:
    11,502
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I did not mention any existing script. I said it would require a very simple script mod, which I would give to you if nobody else had done it by the time I got back.

    Create a new slot in Materials, and paste the following script in. It can go right at the bottom of your custom scripts.

    This will stop any events that have AUTONOMOUS MOVEMENT - so random, approach, or a custom move route. It will NOT stop events where you have issued a Set Move Route command - since sometimes you want text shown as part of a cutscene and you WANT your NPCs to move a particular way while text is still showing.

    Code:
    class Game_Event < Game_Character  alias shaz_wait_for_message_game_event_update_self_movement update_self_movement  def update_self_movement    return if $game_message.busy? || $game_message.visible    shaz_wait_for_message_game_event_update_self_movement  endend
     
    #4
  5. MasterLagger

    MasterLagger Odder than Odd Veteran

    Messages:
    58
    Likes Received:
    5
    First Language:
    English
    It works perfectly! Thank you.

    BTW, I find it kinda funny you could stick your username in the script.
     
    #5
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,794
    Likes Received:
    11,502
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    All scripters do that - the more you use scripts, the more you'll see scripters adding their names. I put my username and a short script description when I alias a method.


    It means you could get half a dozen scripters who alias the same script, and will never have alias names clashing (when they do, it causes "stack too deep" errors).


    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.
     
    Last edited by a moderator: Jan 25, 2014
    #6
Thread Status:
Not open for further replies.

Share This Page