Movement Direction Lock

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

movementDirectionLock1

This plugin allows you to restrict player movement temporarily using events.

By default, they can move in all four, or eight, directions. By using certain plugin commands, you can “lock” certain directions if you didn’t want to allow them to move in those directions.

Download

Plugin: download here (right-click, save-as)

Installation

Download ths plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_MovementDirectionLock plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

Here are some direction names that you can use:

- UP
- DOWN
- LEFT
- RIGHT
- UPLEFT
- UPRIGHT
- DOWNLEFT
- DOWNRIGHT

To lock a movement direction, use the plugin command

lock_move_dir DIR1 DIR2 DIR3 ...

To unlock a movement direction, use the plugin command

unlock_move_dir DIR1 DIR2 DIR3

For convenience, you can lock multiple directions in one command.

So for example, if you wanted to prevent players from moving up or down, you can write

lock_move_dir UP DOWN

And afterwards, you can unlock those directions with

unlock_move_dir UP DOWN
Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

17 Responses

  1. Arthur says:

    Hi, i have one problem, if i use some one diagonal movement script, your script don’t work and i can move, I tried everything but it still did not work.

  2. nick says:

    Hello this is a really cool script and I thank you for it. Have one question though, the character sprites sit a few pixels above the tiles, how do I get them so they are positioned directly on the tile? Like in the screen shot on this page.

  3. Nev says:

    Hi, thanks for making this plugin. It’s just what I needed, but I’m having a small problem. I’ve tested and it doesn’t seem to restrict movement with mouse/touch? Maybe I’m doing something wrong. To be sure I did a parallel event that restricts all movement, and sure enough I can’t move in any direction with the keyboard but the character still is able to move wherever I click with the mouse.

    • Hime says:

      Yes, it does not restrict mouse input, which is a bug.
      However, if I implement logic to restrict mouse, it would also prevent things like move routes.

      I’m not sure if that would be expected.

  4. Fatalys93 says:

    This plugin works well only if you use also a plugin that allow diagonal movement.
    Otherwise, if you move in a diagonal route this happen:

    Also in new project 🙂

  5. Michael says:

    Hey Hime, thank you for this, it is exactly what I need. Or, at least, most of it. Would it be possible to add locking for the menu and dash inputs as well? Yes, it could be disabled using map settings, but what if you wanted to temporarily block input during specific events on the map?

  6. Kloe says:

    Oh,ok thank you! I guess that makes sence now that I think about it… If it was only button press then it would be harder to do things like the sideview overworld thing in some of your msg plugin screenshots!

  7. Kloe says:

    Is it possible to get this to work like the direction lock script for VX ACE where you could hold a button to lock it?

    • Hime says:

      This plugin was designed to activate when a command issued. If I changed it so that it activated on button press, it wouldn’t be as versatile. I would recommend looking for a plugin that executes commands when a button is pressed and released.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax