MZ Is there any script code or plugin to change all party members graphic?

Rpg maker MZ.
there is an event command to change an actor's sprites, and its javascript equivalent is listed in the pinned topic of the script equivalents for event commands.

but you have to look for that topic, I don't have it ready at the moment.
Ugh, I hate this kind of thread...
Not even an effort to ask for a help.

If that's how you gonna ask:
Event Command > Tab 3 > Change Actor Images
1630190852922.png


I hope this is not what you are looking for.
I mean all the same time
I mean all the same time

Ah, then it's YES, THERE IS.
That should answer your question written in the title.


EDIT: I feel like scum when I do that.
I will pretend you have your own reason for asking for help like that (like you are hurt or in the middle of a car chase or something).

I would like to know the reason why'd you need it to be in code or why it has to be at the same time.
If not, then I will assume you are writing your own custom plugin.

The equivalent code of that event can be found in rpg_object.js
1630192217733.png


And since you are not being specific, again, I will assume you only need the character sprite graphics. It's in line 10323, which can be downed interpreted as this:

Code:
$gameActors.actor(ID).setCharacterImage(FILENAME, INDEX);
$gamePlayer.refresh();

Then since you want it to be all members at the same time, yet not be specified if you need them all to all change to the same filename/index or not, again, I assume it's yes from your wording.
Then you need to put them in loop iteration.

Code:
for (var i=1; i<9; i++) $gameActors.actor(i).setCharacterImage(FILENAME, INDEX);
$gamePlayer.refresh();
Hope you know how "for" loop work.
If not, change 1 to starting actor ID and 9 to maximum (not included) actor ID.

The code is equivalent to rowed up the event command I mentioned above:
1630195212774.png


I don't know why you need it that way.
It's a secret you want to keep to yourself.
Maybe you are working in CIA and we don't need to know.

I feel like a detective now...
a dumb one if all my assumptions turned out wrong
I mean all the same time
Technically speaking, nothing in the game can happen at the same time, all instructions are processed in order.

If you use the event button that was shown above and do it for each party member in a row, it will look simultaneous to you on the screen.
Hello again!
It is not necessary Plugins or Scripts to solve everything, the game script should be mostly done by Event Commands.

See the example:
Code:
◆Text:None, Window, Bottom
:    :It's Morphin Time!
◆Change Actor Images:Harold, Actor1_Morphed(0), Actor1_Morphed(0), Actor1_1_Morphed
◆Change Actor Images:Therese, Actor1_Morphed(7), Actor1_Morphed(7), Actor1_8_Morphed
◆Change Actor Images:Marsha, Actor3_Morphed(7), Actor1_Morphed(3), Actor3_8_Morphed
◆Change Actor Images:Lucius, Actor2_Morphed(6), Actor1_Morphed(4), Actor2_7_Morphed
◆Text:None, Window, Bottom
:    :We're awesome!

Could you explain why you need a single command for this?
Hello again!
It is not necessary Plugins or Scripts to solve everything, the game script should be mostly done by Event Commands.

See the example:
Code:
◆Text:None, Window, Bottom
:    :It's Morphin Time!
◆Change Actor Images:Harold, Actor1_Morphed(0), Actor1_Morphed(0), Actor1_1_Morphed
◆Change Actor Images:Therese, Actor1_Morphed(7), Actor1_Morphed(7), Actor1_8_Morphed
◆Change Actor Images:Marsha, Actor3_Morphed(7), Actor1_Morphed(3), Actor3_8_Morphed
◆Change Actor Images:Lucius, Actor2_Morphed(6), Actor1_Morphed(4), Actor2_7_Morphed
◆Text:None, Window, Bottom
:    :We're awesome!

Could you explain why you need a single command for this?
I want to change all party members graphic to one.
exemple: All party members graphics to Actor1 graphic.
If is one by one will be tired.
My game is online, and everytime when you call menu and back, your sprites changes, so i want to all party member change.
Hi!
I believe you can try:

JavaScript:
for(const member of $gameParty.members()){
    member.setCharacterImage("filename", index);
}

Replace the filename with the file you want to use, without the extension, and inside quotes.
Replace the index with a number.
Hi!
I believe you can try:

JavaScript:
for(const member of $gameParty.members()){
    member.setCharacterImage("filename", index);
}

Replace the filename with the file you want to use, without the extension, and inside quotes.
Replace the index with a number.
1630203424019.png
I put this, but nothing happens
try remove the " around the filename. dont think thats supposed to stay
View attachment 199870I put this, but nothing happens
My bad,you need to refresh the game player for it to work:

JavaScript:
for(const member of $gameParty.members()){
    member.setCharacterImage("filename", index);
}
$gamePlayer.refresh()

try remove the " around the filename. dont think thats supposed to stay
The "" quotes must stay since the argument is a string.
I still don't understand if this is definitive or just in the visual moment.

Temporary change method, try this:
JavaScript:
$gamePlayer._characterName="Actor1";
$gamePlayer._characterIndex=0;
for(f=0;f<$gamePlayer._followers._data.length;f++){
    $gamePlayer._followers.follower(f)._characterName="Actor1";
    $gamePlayer._followers.follower(f)._characterIndex=0;
}

Definitive change method:
JavaScript:
for(p=0;p<$gameParty._actors.length;p++){
    $gameActors._data[$gameParty._actors[p]]._characterName="Actor3";
    $gameActors._data[$gameParty._actors[p]]._characterIndex=3;
}
$gamePlayer.refresh()

Edited:
The setCharacter function is part of the RMMZ Core, so it is not necessary to write as much as I wrote, so the best option is presented by @Eliaquim
My bad,you need to refresh the game player for it to work:

JavaScript:
for(const member of $gameParty.members()){
    member.setCharacterImage("filename", index);
}
$gamePlayer.refresh()


The "" quotes must stay since the argument is a string.
Worked!! thank u so much!!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-any-script-code-or-plugin-to-change-all-party-members-graphic.139970/