Rostraspik

Villager
Member
Joined
Sep 30, 2023
Messages
5
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
Hello everyone.
I am trying to create a skill for my character that when used will change the enemy sprite during battle.
I want the enemy to maintain its stats, states, skills, etc.
How can I go about this?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
By default the sprite is pulled from the enemy's database entry. To change it without affecting other copies of the enemy, you'll need to use a plugin.

You could try this plugin - it was written for MV, but at a quick glance I didn't see anything that looked incompatible with MZ. You don't even need to use the health threshold stuff, just the added script call.
 

Rostraspik

Villager
Member
Joined
Sep 30, 2023
Messages
5
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
By default the sprite is pulled from the enemy's database entry. To change it without affecting other copies of the enemy, you'll need to use a plugin.

You could try this plugin - it was written for MV, but at a quick glance I didn't see anything that looked incompatible with MZ. You don't even need to use the health threshold stuff, just the added script call.
Thank you for the suggestion!
My idea is to change the enemy sprite when its affected by a specific status (Turned).1696156360056.png
The problem I am having now is that rpg maker always gives me this error "Game_Battler.setBattleImage is not a function"
1696156324449.png
Does anyone know what might be causing this?
 

werzaque

Canned Dinosaur
Regular
Joined
May 30, 2023
Messages
440
Reaction score
264
First Language
EN/JP/NL
Primarily Uses
RMMZ
What other plugins are you using?
 

Rostraspik

Villager
Member
Joined
Sep 30, 2023
Messages
5
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
Thank you for the suggestion!
My idea is to change the enemy sprite when its affected by a specific status (Turned).View attachment 278617
The problem I am having now is that rpg maker always gives me this error "Game_Battler.setBattleImage is not a function"
View attachment 278616
Does anyone know what might be causing this?
I am no longer getting the error but the enemy sprite doesnt change.
1696184567945.png
I checked the Js code and the function was defined as Game_Battler.prototype.setBattlerImage.
I also added some show text in order to debug during the battle and it shows both of them. Not sure why the sprite isnt changing.
Maybe is not compatible with MZ??? I am not sure...
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,705
Reaction score
11,289
First Language
English
Primarily Uses
RMMV
Does anyone know what might be causing this?
You're calling the code incorrectly. You wouldn't type Game_Battler, you need to reference the actual enemy.

So, according to your troop event, you're looking at enemy #1. Thus, your script call would be
Code:
$gameTroop.members()[0].setBattlerImage("Zombie")
(looking at the examples in the first post of the other thread, the PNG extension is automatically added)
 

Rostraspik

Villager
Member
Joined
Sep 30, 2023
Messages
5
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMZ
This worked the way I wanted, thank you very much!
 

Latest Posts

Latest Profile Posts

Help, I can't stop! :kaohi:

alice_ornament.png
I'm happy to join this community.
about this argument. I expressed myself badly, I did it on my own, my English was mixed with Google Translate. And I believe chatGPT didn't even exist in 2016
I have to take sleeping pills :rtear:
Now that the forum is running smoothly, I can run around and react to posts the millisecond they're posted.
patrick-star-spongebob.gif

Forum statistics

Threads
136,812
Messages
1,270,316
Members
180,574
Latest member
PastorGary
Top