Script call to get filename of Actor's images?

Status
Not open for further replies.

Rhino

~Inactive~
Veteran
Joined
Feb 28, 2017
Messages
482
Reaction score
789
First Language
English
Primarily Uses
RMMV
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!
 

Gamefall Team

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
348
Reaction score
473
First Language
Italian
Primarily Uses
RMMZ
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'
 

Leon Kennedy

Restaff Novice
Restaff
Joined
Aug 14, 2016
Messages
613
Reaction score
470
First Language
english
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

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.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top