public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

MV Hime's Lock Facing Direction Fix?

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: MV Hime's Lock Facing Direction Fix?
  • Original author: SepiaOulomenohn
  • Original date: May 15, 2025
  • Source thread: https://forums.rpgmakerweb.com/threads/himes-lock-facing-direction-fix.177690/
  • Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Javascript/Plugin Support

Summary

Heya, all y'all. Part of my game involves a custom plugin that creates a field of view. Events that are outside of this field of view fade out until they're invisible, while events that are inside fade in until fully opaque. Because of this, it's very useful QoL-wise to have a plugin such as Hime_LockFacingDirection.js The important code for this plugin is very simple: JavaScript:

Archived First Post

Heya, all y'all.

Part of my game involves a custom plugin that creates a field of view. Events that are outside of this field of view fade out until they're invisible, while events that are inside fade in until fully opaque. Because of this, it's very useful QoL-wise to have a plugin such as Hime_LockFacingDirection.js

The important code for this plugin is very simple:

JavaScript:
(function ($) {

  $.params = PluginManager.parameters("HIME_LockFacingDirection");
  $.button = $.params["Lock Button"].toLowerCase().trim();
 
  var TH_GameCharacterBase_isDirectionFixed = Game_CharacterBase.prototype.isDirectionFixed;

  Game_CharacterBase.prototype.isDirectionFixed = function() {
    return TH_GameCharacterBase_isDirectionFixed.call(this) || this.isdirectionFixButtonPressed();
  };
 
  Game_CharacterBase.prototype.isdirectionFixButtonPressed = function() {
    return Input.isPressed($.button);
  };
})(TH.LockFaceDirection);

However, it's pretty clear that when you hold the button in question (default 'control'), not only does the player character fix its direction, but every single other event does as well. I've come up with a messy fix for this already just today by adding a conditional to isDirectionFixed which compares the coordinates to the player character's own:
JavaScript:
  Game_CharacterBase.prototype.isDirectionFixed = function() {
    return TH_GameCharacterBase_isDirectionFixed.call(this) || this.isdirectionFixButtonPressed();
  };
becomes:
JavaScript:
  Game_CharacterBase.prototype.isDirectionFixed = function() {
    let character = $gamePlayer || ''
    if (character != '' && this._realX == character._realX && this._realY == character._realY ){
      return TH_GameCharacterBase_isDirectionFixed.call(this) || this.isdirectionFixButtonPressed();  
    } else {
      return TH_GameCharacterBase_isDirectionFixed.call(this)
    } 
  };

This seems to work fine, and I also have an alternative that compares spritenames instead via the _characterName properties if I encounter any major bugs with this.


But I still feel like I should ask: Is there a better (or cleaner) way to do this? The fix in general, that is, not just my solution.

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#js-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar