MZ How to change the Actor Command width using javascript ?

Hello,

How would I change the Actor Command width using javascript ?
I have a image of the section I am trying to edit.
I would like to make it slimmer 😛

Capture.JPG
👋 With a plugin.

I think something like this would be sufficient:
JavaScript:
/*: 
 * @target MZ
 * @plugindesc Changes the actor command window width.
 */

(alias => {
  Scene_Battle.prototype.actorCommandWindowRect = function() {
    const rect = alias.apply(this, arguments);
    rect.width = 192;  // <- your width here
    return rect;
  };
})(Scene_Battle.prototype.actorCommandWindowRect);
👋 With a plugin.

I think something like this would be sufficient:
JavaScript:
/*:
 * @target MZ
 * @plugindesc Changes the actor command window width.
 */

(alias => {
  Scene_Battle.prototype.actorCommandWindowRect = function() {
    const rect = alias.apply(this, arguments);
    rect.width = 192;  // <- your width here
    return rect;
  };
})(Scene_Battle.prototype.actorCommandWindowRect);


Thanks for this, So I am new to RPG maker and coding a bit but :
I create a js file using MS Code.
1Capture.JPG


Then saved it to the js plugin folder.
Also I want to mention I am using VisuStella Battle Core just in case that matters.

I changed the value to 50 but I dont see any change.
is there anything else I am missing here?
Added some additional stuff but not sure what I am doing wrong ?

2Capture.JPG
You imported it through the Plugin Manager, right? You should also save your project to apply Plugin Manager changes before testing. (Battle test does not force a save.)

It seems to work OK for me without plugins! 😤 If it's not working for you, try turning off other plugins, save your project, and test again to see if that helps. 😴

You might discover that you want to adjust the party command window too. Same idea, just make another block of code where actorCommand is replaced by partyCommand. Other properties like x, y, and height should also be able to be altered like this.
You are def right it seems to work without using visuStella Battle Core. I am kind atied to using the Battle core.
How would I approach editing the code if a different plugin seems to be overriding the default?
I just tested with that plugin loaded after VisuStella Battle Core 1.01 (no other plugins active) and it seemed OK for me. Maybe one of the Battle Core updates since then changed something about the actor command window?

If you're sure it's a conflict with a VisuStella plugin then I suggest you contact VisuStella.
I just tested with that plugin loaded after VisuStella Battle Core 1.01 (no other plugins active) and it seemed OK for me. Maybe one of the Battle Core updates since then changed something about the actor command window?

If you're sure it's a conflict with a VisuStella plugin then I suggest you contact VisuStella.

Actually its when the battle Layout Style is changed to "portrait" in the battle core option thus changing the default to something more custom.
I just tested like this:
  • Download the latest version of the VisuStella MZ Sample Game Project,
  • Add the attached plugin to the end of the Plugin Manager list,
  • Save the project to apply changes,
  • Database -> Troops -> Battle Test.
The window width is clearly altered for me, and the sample project seems to have Portrait Layout Style enabled by default, so I don't know what's happening for you.

Maybe press F8 during play to see if there are any errors (red text) being logged.
I just tested like this:
  • Download the latest version of the VisuStella MZ Sample Game Project,
  • Add the attached plugin to the end of the Plugin Manager list,
  • Save the project to apply changes,
  • Database -> Troops -> Battle Test.
The window width is clearly altered for me, and the sample project seems to have Portrait Layout Style enabled by default, so I don't know what's happening for you.

Maybe press F8 during play to see if there are any errors (red text) being logged.


Thx for the update,
So I just checked the Sample project. I have uploaded a couple of images just to help you see what I am seeing.

The first image is the portrait layout, this mode has to be enabled, then see the sec image for the location.

Capture.JPG


1Capture.JPG



So this box here is too big and I am trying to reduce the size or just have control over the width and height. I notice that the width seems to be tied to the selection of the actor space if that helps pinpoint this.

Capture.JPG
what is your plugin order, and what other plugins do you have installed?
what name did you give the tiny plugin?

if you give us a screenshot of your plugin manager it would help answer the questions.
what is your plugin order, and what other plugins do you have installed?
what name did you give the tiny plugin?

if you give us a screenshot of your plugin manager it would help answer the questions.
Hi, here is the list of plug ins I am using : slimActorCommand is the tiny
1628180976930.png

1628180924639.png

Added: actorCMDWidth ( this one was provided, it has the same code )
1628181296795.png
Oh, sorry! I misunderstood and was checking the wrong plugin parameter. 😊 I see what you mean now. 😴

I assume VisuStella's plugin skips the existing rectangle generation method. It might offer customisation through another plugin parameter? If not, I think you'll have to contact VisuStella for support.
Oh, sorry! I misunderstood and was checking the wrong plugin parameter. 😊 I see what you mean now. 😴

I assume VisuStella's plugin skips the existing rectangle generation method. It might offer customisation through another plugin parameter? If not, I think you'll have to contact VisuStella for support.

hey! Thx for checking. Ive been to the VS Stella discord, I havnt seen any response from the Stella Devs. A couple of folks looked around for me but still no Actual dev response, so I am not sure if they do "how to do" - support questions. It seems they only want you to send in detailed bug reports.

I am just hoping I can figure this part out. 🙁
Go into your VisuMz BattleCore plugin, then find "this[_0x17e467(0x465)](_0x1dcf6f,_0x41450c,_0xf7ee41,_0x4d4c9c)", in the brackets seem to be (x,y,width,height), so putting - 100 after, _0xf7ee41 should do what you need, _0x4d4c9c for height and so on. Just take note on what you are changing incase of future updates etc.
Go into your VisuMz BattleCore plugin, then find "this[_0x17e467(0x465)](_0x1dcf6f,_0x41450c,_0xf7ee41,_0x4d4c9c)", in the brackets seem to be (x,y,width,height), so putting - 100 after, _0xf7ee41 should do what you need, _0x4d4c9c for height and so on. Just take note on what you are changing incase of future updates etc.
Thanks! I will look for that and try to change this.
Edit:
Tried to find this (latest VS update) using ctrl F in Visual Studio Code but its not there. (looks encrypted). I will just use a different HUD solution. But thank you so much for looking into this.

Mod Feel free to close this thread.
Thanks! I will look for that and try to change this.
Edit:
Tried to find this (latest VS update) using ctrl F in Visual Studio Code but its not there. (looks encrypted). I will just use a different HUD solution. But thank you so much for looking into this.

Mod Feel free to close this thread.
Search for it without the "", this[_0x17e467(0x465)](_0x1dcf6f,_0x41450c,_0xf7ee41,_0x4d4c9c)

Yeah they have all been obfuscated or whatever, making them near impossible to read, but from trail and error, it seems like it is all still there, just visually different, which why instead of x it is _0x17e467.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-the-actor-command-width-using-javascript.139255/