Help - Search - Members - Calendar
Full Version: Change enemy battler graphic
RPG RPG Revolution Forums > Scripting > Script Development and Support
Tsukihime
Is there a script to change the enemy battler graphic?
I tried enemy transform, but that requires more than just a new graphic. I just want to change the graphic.

It's a fixed battle so I know enemy's index in $game_troop.enemies
Night_Runner
By default you cannot change the enemy graphics by itself, even with scripts.

One of our talented eventers can correct me if there's a way to event this, but I know how to script it easily smile.gif

Step 1

You have two options here, either make a new script
CODE
class Game_Enemy
  attr_accessor :battler_name
end

or you can paste the code
CODE
  attr_accessor :battler_name

In Game_Enemy, like so:

( Just below the class Game_Enemy line )
I've also added the comments above the code.

Oh well, choose wisely, you can do both if you really want....


That set up the script editor to give us access to the battler graphic.

Step 2

The final step, go to the Troops tab of the database, make a condition for the graphic to change, and insert the code:
CODE
$game_troop.enemies[0].battler_name =
"055-Snake01"

Like so:

( Just a Script command ).
Where 1 means the 2nd enemy ( I believe you're familiar with how coding starts counting with 0? ), and 055-Snake01 is the name of the new graphic


And that did it for me smile.gif
Tsukihime
That's interesting, I didn't think battler_name would have anything to do with the actual graphic.
Night_Runner
battler_name is the name of the battler's graphic. Just don't think about it too much happy.gif

I'll just be moving this over to Script Support then.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.