[Solved]Change CharacterImage via script?

Shurutsue

Veteran
Veteran
Joined
Feb 11, 2016
Messages
15
Reaction score
5
First Language
German
Primarily Uses
Hi, i am trying to change the Character-Image of an Actor with a script call, which i think should look like this:
 


$gameActors.actor(1).setCharacterImage('People1', 2);




so, in this example, it should change the Character Image of Actor 1 to the second one in "People1.png", atleast i think so.


My problem with this is, that it doesn't change anything and does not give me an error message or similar in the console...


have been missing "$gamePlayer.refresh()"

By the way, it does not help to change 'People1' to 'People1.png', tried it too.



For anyone trying to help:
Thanks in advance :3
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Code:
// Change Actor Images
Game_Interpreter.prototype.command322 = function() {
    var actor = $gameActors.actor(this._params[0]);
    if (actor) {
        actor.setCharacterImage(this._params[1], this._params[2]);
        actor.setFaceImage(this._params[3], this._params[4]);
        actor.setBattlerImage(this._params[5]);
    }
    $gamePlayer.refresh();
    return true;
};


It may just be that you need the $gamePlayer.refresh() call in order to update the image on the map, if that's what you mean.  Without it, it might update the image when you go to a menu and return to the map, transfer to a different map (or maybe somewhere else on the same map), or start and end a battle, but otherwise, it won't be an immediate change.


Though why are you using a script call to do it?  There's a Change Actor Images event command under System Settings on tab 3.
 
Last edited by a moderator:

Shurutsue

Veteran
Veteran
Joined
Feb 11, 2016
Messages
15
Reaction score
5
First Language
German
Primarily Uses
Thank you very much! that is what I've been missing!


and as to "why" i want to use a script call for it is, that i want "customizeable" party members depending on choices the player does


i think it will be easier to do that with the possibility to change with the actor id instead of making an event for every actor-id possible to have it.


as an simple example:


21 Actors


1 Actor is the player himself


20 are customizeable (class) and when "hiring" one, the actor you hire then changes to the wanted class (and changes to the expected image)


Again thank you very much! :3
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top