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.

Few things to do with the actor.

Okay what i am looking for is three things.

1. Have a universal sprite with a variable to say 1-10 depending on what the variable is there would be 10 different sprites.

2. I am using sephys in battle switch and summon script and i would like it so only one character appears in battle at a time.

3. I am also using sephys party/class switching script and wanted that for when the party reaches over 6 actors it automaticlly sends them to reserve.

Thanks anyone who can do this i will do what ever i can to repay them. Thanks

-Bigbg459
 
1. Have a universal sprite with a variable to say 1-10 depending on what the variable is there would be 10 different sprites.
Here's is this first one
Code:
class Game_Actor
  BIGBG459_SPRITES = [COLOR=Red]{
       1 => [<sprite>, <sprite>,....],
       2 => [<sprite>, <sprite>,....],
       ....
       }[/COLOR]
  attr_accessor :sprites
  attr_reader   :current_sprite
  alias bibbg459_game_actor_init initialize
  def initialize(actor_id)
    bibbg459_game_actor_init(actor_id)
    @sprites = BIGBG459_SPRITES[actor_id]
    @sprites = [@character_name] unless @sprites.is_a?(Array)
    @current_sprite = -1
  end
  def current_sprite=(sprite_id)
    @current_sprite = sprite_id
    @character_name = @sprites[@current_sprite]
    $game_player.refresh
    $game_map.need_refresh = true
  end
end
you have to fill that red hash with your sprites names
You have 2 ways to change the sprite. The first is by actor database index (1 = first) and the second by the position in the party (0 = first):
Code:
$game_actors[actor_id].current_sprite = sprite_id
$game_party.actors[actor_pos].current_sprite = sprite_id
 

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