Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Change enemy battler graphic
Tsukihime
post Oct 24 2011, 06:56 PM
Post #1


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




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

This post has been edited by Tsukihime: Oct 24 2011, 06:57 PM


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Oct 26 2011, 02:18 AM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed




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


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Tsukihime
post Oct 26 2011, 10:34 AM
Post #3


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




That's interesting, I didn't think battler_name would have anything to do with the actual graphic.


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Oct 26 2011, 06:28 PM
Post #4


Level 50
Group Icon

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed




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.


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 06:22 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker