Resizing, Repositioning Weapon Animation Sheet

Good evening all.

My SV battlers are 128 x 128 (2x the normal size ), therefore the default weapon animation sheets don't work for me needs. As such I went ahead and upscaled the whole sheet x2 as well to maintain the aspect ratio (since my SV aspect ratio hasn't changed).

What I'm struggling with is adapting the engine to recognize the updated size easily.

I've already had a look at the following post



But would be awesome if there was an easier one size fits all solution since its a straight up 2x upscale.
Well, here's a plugin version of what they mention in that thread (untested):
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Reposition/resize weapon sprites.
 * @url https://forums.rpgmakerweb.com/posts/595840/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (() => {
'use strict';

  /** Width of weapon sprite. Default 96 px. */
  const WIDTH  = 96;

  /** Height of weapon sprite. Default 64 px. */
  const HEIGHT = 64;

  /** Horizontal offset relative to main sprite. Default -16 px. */
  const OFFSET_X = -16;

  /** Vertical offset relative to main sprite. Default 0 px. */
  const OFFSET_Y = 0;

  // Override - use custom size frame for weapon sprite.
  Sprite_Weapon.prototype.updateFrame = function() {
    if (this._weaponImageId > 0) {
      const index = (this._weaponImageId - 1) % 12;
      const sx = (Math.floor(index / 6) * 3 + this._pattern) * WIDTH;
      const sy = Math.floor(index % 6) * HEIGHT;
      this.setFrame(sx, sy, WIDTH, HEIGHT);
    } else {
      this.setFrame(0, 0, 0, 0);
    }
  };

  // Patch - apply custom weapon sprite offsets.
  void (alias => {
    Sprite_Weapon.prototype.initMembers = function() {
      alias.apply(this, arguments);
      this.x = OFFSET_X;
      this.y = OFFSET_Y;
    };
  })(Sprite_Weapon.prototype.initMembers);

})();
For a 2x upscale of battler and weapon, since they have the same anchor (0.5, 1), I think you'd just need to double all relevant numbers? I.e. width = 192, height = 128, x-offset = -32, y-offset = 0.
Ever the magician @caethyril ! Thank you
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!
Reopened at OP’s request. The thing bleeped a blorp.
The thing did indeed bleep a blurp.

The offset doesn't seem to be doing anything @caethyril . I set it to -32 as should work, and even went as high as 100 but nothing changed for the x or y offset. Thoughts?



Worst case scenario i can manually adjust the weapon sheet slightly left. But want to avoid as this script could be a solution for someone else in the future as well
Just tested with OFFSET_X = -60 and it seems to work for me.

Are you using any other plugins? If so, try turning off those plugins, save your project to apply Plugin Manager changes, then test.
You know dang well I'm using tons of other plugins lol. I'll go line by line. I'm pretty certain its likely a Battle Core issue since that can change things like anchor manually. But well see
(I help out a lot of people, I don't even try to remember everyone's project specs. 😛)

Hopefully it'll be a simple solution. Good luck! 👋
Could we possibly add in the anchor portion? I feel like that needs to be adjustable since battle core might be making it wonky
Did have luck but i just moved the images over a bit manually to solve. Likely just conflicts with my plethora of plugins xD
Closed as solved

Original thread: https://forums.rpgmakerweb.com/threads/resizing-repositioning-weapon-animation-sheet.159779/