RMMZ How to change the Actor Command width using javascript ?

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
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 :p

Capture.JPG
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,739
Reaction score
2,094
First Language
EN
Primarily Uses
RMMZ
:kaohi: 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);
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
:kaohi: 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?
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Added some additional stuff but not sure what I am doing wrong ?

2Capture.JPG
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,739
Reaction score
2,094
First Language
EN
Primarily Uses
RMMZ
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! :kaopride: If it's not working for you, try turning off other plugins, save your project, and test again to see if that helps. :kaoslp:

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.
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
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?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,739
Reaction score
2,094
First Language
EN
Primarily Uses
RMMZ
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.
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
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.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,739
Reaction score
2,094
First Language
EN
Primarily Uses
RMMZ
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.
 

Attachments

  • actorCmdWidth.js
    322 bytes · Views: 4

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
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
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,647
Reaction score
8,480
First Language
German
Primarily Uses
RMMV
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.
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
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
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,739
Reaction score
2,094
First Language
EN
Primarily Uses
RMMZ
Oh, sorry! I misunderstood and was checking the wrong plugin parameter. :kaoblush: I see what you mean now. :kaoslp:

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.
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
Oh, sorry! I misunderstood and was checking the wrong plugin parameter. :kaoblush: I see what you mean now. :kaoslp:

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. :(
 

Jeremyr

Villager
Member
Joined
Jun 13, 2019
Messages
12
Reaction score
5
First Language
English
Primarily Uses
RMMV
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.
 

ighrpg

Veteran
Veteran
Joined
Apr 8, 2021
Messages
53
Reaction score
3
First Language
English
Primarily Uses
RMMZ
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.
 
Last edited:

Jeremyr

Villager
Member
Joined
Jun 13, 2019
Messages
12
Reaction score
5
First Language
English
Primarily Uses
RMMV
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.
 

Latest Threads

Latest Profile Posts

Will be focusing on map making today and adding locked chests :LZSsmile:Screenshot 2021-09-16 095316.png
It's hard to stay consistent for at least a week
new enemies for the game I'm working on...
Fricken hell! I dropped a bowl with mac and spam on my brothers floor, and was going to put leftover mac with whatever was still safe in there. It was only after I added the leftover mac that my brother told me he put floor noodles in there, now I wasted my planned dinner for tomorrow!
How to make a cool character 101: Create a messy plot, make the character said "all according to the plan", then somehow the problem is solved.

Forum statistics

Threads
115,104
Messages
1,087,241
Members
149,568
Latest member
Schwarzohr
Top