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.

Ccoa's side view battle script. Adding Animations

Dko

Member

Simple question. Can some one explain how this script works to do the battle animations for characters and monsters? I want to change the script so there is two new animations. One for a strong attack and one for a weak. I understood a little but not all of it looking thru her code. (as is my problem with a lot of other peoples code)
 

Dko

Member

I figured it out and here's how if anyone wants to know. :D
first you go into CONSTANTS and add to the list at the top the names of any character poses you want but number them bellow Victory. Victory has to be the highest number. Like this:

$BATTLEOPEN = 10
$ITEM = 11
$ATTACK_HIGH = 12 #Ive added these two
$ATTACK_WEAK = 13
$VICTORY = 14 # See how Victory is 14 now instead of 12?

Then you have to change CBS Scene_Battler at the define make_sprite_sheet. Here you will add a couple strings to allow RPG maker Xp to know what file name your new animations use.


Code:
def make_sprite_sheet
    if @battler == nil
      @spritesheet = Bitmap.new(1, 1)
      return
    end
    if @battler.is_a?(Game_Actor)
      @game_actor = true
      weapon = $data_weapons[@battler.weapon_id]
      if weapon != nil 
        begin
          RPG::Cache.battler(@battler.battler_name + "_attack_" + weapon.name.sub(" ", "_"), @battler.battler_hue)
          @pose_names = ["_ready", "_guard", "_hit", "_miss", "_skill_default", 
                     "_attack_" + weapon.name.sub(" ", "_"), "_lowhp", 
                     "_moveto", "_movefrom", "_dead", "_battle_open", "_item",
                     "_attack_high", "_attack_weak"] # added these
        rescue
          @pose_names = ["_ready", "_guard", "_hit", "_miss", "_skill_default", 
                       "_attack_default", "_lowhp", "_moveto", "_movefrom", 
                       "_dead", "_battle_open", "_item",
                        "_attack_high", "_attack_weak"]  # added these here too
        end
      else
        @pose_names = ["_ready", "_guard", "_hit", "_miss", "_skill_default", 
                       "_attack_default", "_lowhp", "_moveto", "_movefrom", 
                       "_dead", "_battle_open", "_item",
                      "_attack_high", "_attack_weak"] # added these here too
      end
So in my example <name>_attack_high.png will have your high atk animation for <name>
Then you can just use @active_battler.set_pose($ATTACK_HIGH, false) where you need to and volia! Your new animation should work.

you may lock topic if you wish :3
 

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