Script call to get filename of Actor's images?

Hello!

I'm looking for a way to store the filename of the actor 1's current face/character/sv images (set in the database), into variable(s), and then compare if it's equal to 'example.png'

I'm hoping it can be done without any external plugins.

(I know it's a strange bit of info to require, it's part of a tutorial in a non-deployed project.)

Thanks!
These are what you need:

Code:
$gameActors.actor(id).faceName() // Return the face name
Ex. "Actor1"
$gameActors.actor(id).characterName() // Return the spritesheet name
Ex. "SF_People2"
$gameActors.actor(id).battlerName() //Return the SV Battler spritesheet name
Ex."SF_Actor1_3"

You can store in a variable using the event tab command for storing a value in a variable, inside the script box inserting directly one the script calls up there, or you can use the script call this way:


Code:
$gameVariables.setValue(varId, $gameActors.actor(id).faceName())

Ex. $gameVariables.setValue(1, $gameActors.actor(2).faceName())

And then, for comparing the values using conditional branch:

Code:
$gameVariables.value(varId) === 'Actor1'

Ex. $gameVariables.value(1) === 'Actor1'
Hmm I'm not to great at reading scripts but I believe this may be the call you are looking for just not sure if you can customize it.

Game_Actor.prototype.initImages = function() {
var actor = this.actor();
this._characterName = actor.characterName;
this._characterIndex = actor.characterIndex;
this._faceName = actor.faceName;
this._faceIndex = actor.faceIndex;
this._battlerName = actor.battlerName;
};

@Gamefall Team nice beat me to the punch and showed how to customize it. Good work.
@Gamefall Team Thank you very much, that's perfect! 😍
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/script-call-to-get-filename-of-actors-images.91449/