I want to put the name of the battler image in a var for later use is this possible?
How do you check the actors Battler Image in JS?
Javascript/Plugin Support$gameActors.actor(2).battlerName()
returns the name of the image used for the battler for actor 2
returns the name of the image used for the battler for actor 2
Thanks.... Now.... um.... is there a way to add a string to the value of a variable.
or something like that...
Is that possible?
OK... I have this Zombie state I've been modifying through Yanfly's BuffandStatesCore plugin. Here's what I have:
<Category: Group Defeat>
<Custom Apply Effect>
target.setBattlerImage(name);
target.refresh()
</Custom Apply Effect>
<Custom React Effect>
// Check if the action is a recovery skill.
if (this.isHpRecover()) {
// If it is, let's convert the value into damage!
value = Math.abs(value * 0.6);
}
</Custom React Effect>
<Element Absorb: 9, 11>
In order for this do what I really want it to do I need to figure out a few things first...
How to get the Battler name of an actor.CHECK
- How to add a string [_Zombie, for example] to make the new battler look like a zombie later.
- How to erase said string later when the effect if removed/death so the actor can look normal again.
- finally, I need to figure how to determine if the target is an ally[actor] or an Enemy.
I've got a lot I want to do.... And I'm not even sure if it's all doable using just the Lunatic Mode from the Plugin. But I would like to try since the effect would be pretty cool in the long run.
If you eval $gameVariables.setValue(x, $gameActors.actor(2).battlerName()) the variable will hold a string with the name of the battler's graphic in it.
if you then eval $gameVariables.setValue(x, $gameVariables.value(x) + '_Zombie') it should add _Zombie to the end of the string saved in that variable.
It's only a matter of figuring out how to actually change the battler by name after that.
if you then eval $gameVariables.setValue(x, $gameVariables.value(x) + '_Zombie') it should add _Zombie to the end of the string saved in that variable.
It's only a matter of figuring out how to actually change the battler by name after that.
You can use target.setBattlerImage(name) to change the battler image of the target of the State.... I've tested it out without a problem.... but I needed the change to make the state more intuitive to who is getting the state applied.
Now I just need to figure how to make it so that the state knows if the target is an actor or enemy... Any ideas on that?
Uhhm... this.actorId() will give you it's actor ID if it is an actor. If it's an enemy, it'll be undefined.
You could try an if statement to check if it's undefined before setting the value... Maybe. I really know almost nothing here and am just grasping at straws XD
You could try an if statement to check if it's undefined before setting the value... Maybe. I really know almost nothing here and am just grasping at straws XD
Would something like: "target.isActor()" work?
Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-check-the-actors-battler-image-in-js.61834/