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.

Animation Positions

I've been searching the script, but I can't find the section where battle animations are positioned.  I have a side view battle system, and when the enemy uses a skill, if the skill animation is on Screen, it will look like the enemy's attacking the stats instead of the characters, if that makes any sense...How do I fix it so the enemy's skill looks like the player's?
 

khmp

Sponsor

If this is regarding Minkoff's Sideview Battlers I'll ask that you read the PDF readme that accompanies it. I've never used the system so my help regarding the system is very limited. But I'm willing to read it if you do and help you then.
 
It's exactly like the standard RMXP system, only the sprites have been repositioned and changed, but there's no character movement.  I might have misunderstood the question though...are there other side view systems?
 

khmp

Sponsor

Paradogs, Minkoff's, Charlie Lee's CTB, Formar's Sideview battle system. There are other hybrids to those systems. And some brave people try to make their own. I'm at a loss because I don't know where you are.
 
I used my own.  When It comes to scripting, I'm not a noob, but It's still hard to locate certain things.

As for the system, it's 100% like the standard, but the sprites are now on the side, instead of the front.  It's still turn based, and the battlers are not in motion.

Either way, I just want to know where I go to reposition skill animations.
 

khmp

Sponsor

Oh cool. Gratz on trying something new. I think in order to help you with this further though we'll need to take a peek at your Scripts.rxdata file. If you don't mind could you upload it? I'm kind of confused as to how you moved the battlers and the skills don't recognize the move. Wherever the battlers are the skills should follow.
 
Ok, seriously, I've been repeating myself here...It's not about the player using it.  It's about the enemy using it.  When the enemy uses a skill with a screen set animation, it plays much lower on the screen than the center.  There is nothing wrong when the player uses it.
 
I should have used "All Target."  Since, when the enemy attacks, the players are the enemies (targets).

anyways, here's how the "Screen" position setting for a battle animation works....

If the player is attacking, and the enemies are the target.  The animation is displayed relative to the center of the battle screen  (320, 160).
If the Enemy is attacking, and "All actors" are the target, the animation is adjusted to appear over the actors instead of the enemies. Centered at (320, 320)

Unfortunately, there does not seem to be any way to control the position of an animation played using the "Screen" setting.  You may be SOL.

Be Well
 
There doesn't seem to be any way?  How can that be possible?  I thought by altering the script, anything could be accomplished :(...I really need to do something about this.  I mean, attacking the stats is cute and everything, but it just looks awkward...

By the way, even if you said all target, I would've still thought you were referring to the player, since you said it SHOULD play in the center of the screen.
 
Because the code that plays the animation is buried in the RPG::Sprite class

I just tested it with the battler positions on the right of the battle background (like a sideview system).

I set the animation position to 'middle', and it looks fine. Even with "All Targets" skills.
It plays in the top part of the screen, but centered a little to the right.

You could create an empty sprite near the center of the actors, and force the animation to display on that sprite.  (but you'd still have to set the animation to Top, Middle, or Bottom)
The only other thing I can think of is to re-write the animation method of RPG::Sprite

[ EDIT ]

Ok, I was wrong.  Paste this above main, and it will force all "Screen" positioned animations to the top part of the screen.

Code:
module RPG
  class Sprite
    def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites[i]
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end
        sprite.visible = true
        sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
        if position == 3
#          if self.viewport != nil
#            sprite.x = self.viewport.rect.width / 2
#            sprite.y = self.viewport.rect.height - 160
#          else
            sprite.x = 320
            sprite.y = 160
#          end
        else
          sprite.x = self.x - self.ox + self.src_rect.width / 2
          sprite.y = self.y - self.oy + self.src_rect.height / 2
          sprite.y -= self.src_rect.height / 4 if position == 0
          sprite.y += self.src_rect.height / 4 if position == 2
        end
        sprite.x += cell_data[i, 1]
        sprite.y += cell_data[i, 2]
        sprite.z = 2000
        sprite.ox = 96
        sprite.oy = 96
        sprite.zoom_x = cell_data[i, 3] / 100.0
        sprite.zoom_y = cell_data[i, 3] / 100.0
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
        sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
        sprite.blend_type = cell_data[i, 7]
      end
    end
  end
end
 
You should have seen me sitting here talking to myself.
I think I finally talked myself into looking up the RPG::Sprite class, and Viola!  There it was.

Sitting here scratching my chin....  I wonder if that will mess up any animations played on the map?

Think, think, think.....

Only if you try to play a 'screen' animation on the map.  If that's the case, replace the commented section with:
Code:
          if self.viewport != nil
            sprite.x = 320
            sprite.y = 160
          else
            sprite.x = 320
            sprite.y = 240
          end
 

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