This might be silly but..

Started by Vexus, June 08, 2014, 06:48:26 am

Previous topic - Next topic

Vexus

June 08, 2014, 06:48:26 am Last Edit: June 08, 2014, 06:49:28 am by Vexus
Been so long since I touched rmxp and I'm visiting one of my old unfinished projects (Somnium).

Anyway I'm fooling around the animations and noticed that the casting animation shows over the character which in a side view battle system looks kinda odd. Now I don't want every skill to show under the player but I want those specific casting animations to show under the user/enemy instead of over them.

Is it a hard thing to do? I can't for the life of me find how to do it.

(Apparently the battle system code is too long for a single post if need it I'll split it in two)
Current Project/s:

KK20

If you go into the help file and search for RPG::Sprite, you will see in the animation method description, animations are played at a z-level of 2000. The code is also provided for you below it.

Here's something pretty simple:

# Animation IDs that play at a lower z-level
LOW_Z_ANIMATIONS = [1, 2, 3]

module RPG
  class Sprite < ::Sprite

  alias get_animation_z_level_value animation
  def animation(animation, hit)
    @anim_z_level = (LOW_Z_ANIMATIONS.include?(animation.id) ? -100 : 2000)  #<===== Change -100 to your liking.
    get_animation_z_level_value(animation, hit)
  end

  alias change_z_level_animations animation_set_sprites
  def animation_set_sprites(sprites, cell_data, position)
    change_z_level_animations(sprites, cell_data, position)
    sprites.each{|s| s.z = @anim_z_level }
  end

  end
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Vexus

Current Project/s: