I had made a series of Quake spells (and a couple others) and realized that RMXP always plays the animation on top of the target. With the effect of the ground splitting, it needed to be underneath the target instead of on the target's face, so I whipped up this script real quick to remedy that!
Features (Which double as instructions ;D )
When defining the animation, you can go by...
The animation's ID
The animation's name
The animation's file name
When defining the patterns that are displayed below their target, you can do
Ground[key] = true / Ground[key] = [-1] to designate all frames
Ground[key] = [pattern, ...] to list specific frames
Screenshots
I would post them but its just an animation playing under a battler instead of on top of, use your imagination!
class RPG::Sprite
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :fixz_animation_set_sprites, :animation_set_sprites
#-----------------------------------------------------------------------------
# * Animation Set Ground?
#-----------------------------------------------------------------------------
def animation_set_ground?
# Get ground setting and animation object
g, a = RPG::Animation::Ground, @_animation
# Check for animation id, name or filename
return g[a.id] if g.has_key?(a.id)
return g[a.name] if g.has_key?(a.name)
return g[a.animation_name] if g.has_key?(a.animation_name)
# Return false if no results found
nil
end
#-----------------------------------------------------------------------------
# * Animation Set Sprites
#-----------------------------------------------------------------------------
def animation_set_sprites(sprites, cell_data, position)
# The usual...
fixz_animation_set_sprites(sprites, cell_data, position)
# Get ground animation frame data
ground = self.animation_set_ground?
# End method if no ground data available
return unless ground
# For frames 1 through 16
for i in 0..15
# Get sprite and pattern
sprite, pattern = sprites[i], cell_data[i, 0]
# Skip if sprite is nil or no pattern is called
next if sprite == nil || [nil, -1].include?(pattern)
# Skip unless ground animation true
next unless ground == true || ground.include?(-1) || ground.include?(pattern)
# Set sprite's z below the target
sprite.z = 0
end
end
end
Compatibility
This is compatible with or without the SDK. I do not expect this to work in makers VX or VX Ace, this script was designed for XP.
Author's Notes
I left some example test settings in there, just to show you what different ways you can define ground animations. Also, the priority which ground data is looked up goes 1.) ID, 2.) name, 3.) filename. If you don't understand the script, feel free to ask, and if you find any bugs, feel free to share! Thank you and enjoy! Terms & Conditions
Free to use in commercial and non-commercial games, remember to credit who ya got it from ;D
I had to look at the thread a second time to understand how this works but after that it was easy to understand =D What I like about this is that it works not only in Battle but on the map as well. ^^ It is a script that is very specific and probably not many people will have use for it but it defiately is handy and a good idea none the less.
I remember seeing something similar once, where it was claled flatening animations I belive, but I think there were some troubles with that. I can't find any bugs with this, so I'd say well done =D