Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to change player's graphic with script?

I want to change player's graphic using script. I am trying:
Code:
$game_actors[1].set_graphic("ABC", $game_actors[1].character_hue, $game_actors[1].battler_name.to_s,$game_actors[1].battler_hue)

This code doesn's work and get error:
SyntaxError occurred while running scripts

Help me, please!
 

khmp

Sponsor

If that's an exact copy of your script then your problem lies with the battler_name and battler_hue. There isn't a method for reaching them without adding additional script code. So just add the following snippet above Main in the script listings:
Code:
#==============================================================================

# ** Game_Actor

#------------------------------------------------------------------------------

#  This class handles the actor. It's used within the Game_Actors class

#  ($game_actors) and refers to the Game_Party class ($game_party).

#==============================================================================

 

class Game_Actor < Game_Battler

  #--------------------------------------------------------------------------

  # * Public Instance Variables

  #--------------------------------------------------------------------------

  attr_reader   :battler_name

  attr_reader   :battler_hue

end
Then your script call would be:
Code:
$game_actors[1].set_graphic("ABC", $game_actors[1].character_hue, $game_actors[1].battler_name,$game_actors[1].battler_hue)

$game_player.refresh

Good luck with it tinh_mgv! :thumb:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top