Chaos Project

RPG Maker => General Discussion => Topic started by: Vexus on June 08, 2014, 06:48:26 am

Title: This might be silly but..
Post by: Vexus on June 08, 2014, 06:48:26 am
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)
Title: Re: This might be silly but..
Post by: KK20 on June 09, 2014, 01:56:13 pm
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
Title: Re: This might be silly but..
Post by: Vexus on June 09, 2014, 04:34:26 pm
That does the trick.

Thanks :)