Well this snippet just adds 2 methods to make sure you can easily change your character / battler graphics and get them back at will via script call. Of course you still can do this by setting up some map event...
[rgss]class Game_Actor
attr_accessor

ld_graphic
alias kyon_gma_init initialize
def initialize(actor_id)
@old_graphic = []
kyon_gma_init(actor_id)
end
def change_graphic(index, graphic, value=0)
actor = $game_actors[index+1] # Get actor
if FileTest.exists?('Data/Actors.rxdata')
@old_graphic[index] = [ @character_name, @battler_name, value ]
else
@old_graphic[index] = [ @character_name, @battler_name, @face_index ]
end
if actor != nil # Change graphic
# XP - Pass Character Graphic, Hue, Battler Graphic, Hue values
# VX -Pass Character Graphic, Index, Face Graphic, Index values
graphic = $data_actors[graphic].character_name
actor.set_graphic(graphic, value, graphic, value)
end
# Refresh player
$game_player.refresh
# Continue
return true
end
def get_old_graphic(index)
actor = $game_actors[index+1]
if actor != nil
# XP - Pass Character Graphic, Hue, Battler Graphic, Hue values
# VX -Pass Character Graphic, Index, Face Graphic, Index values
actor.set_graphic(@old_graphic[index][0], @old_graphic[index][2],
@old_graphic[index][1], @old_graphic[index][2])
end
$game_player.refresh
return true
end
end
[/rgss]
Script Call:
$game_party.actors[0].change_graphic(0,2)
It'd transform Aluxes into a second Basil. To revert the change just call it like this...
$game_party.actors[0].get_old_graphic(0)
For VX use $game_party.members[0] instead.
The change_graphic method is a variant of the Interpreter command_322 one or more precisely it's a revised version. It doesn't just allow you to change the graphic, but it also lets you store the previous graphics names in an array temporarily.
The get_old_graphic method lets you reset the graphics at any time if deemed necessary.
BTW, it will work on both, XP and VX.
Never edit this line:
actor = $game_actors[index+1]
Or it won't work properly because the $game_actors index starts at 1 not 0 (it gets the info from $data_actors which also starts at 1).