Looping Animations on Map

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
Looping Animations

2015.10.21

by Shaz

Introduction

This plugin allows you to loop animations on map events.

It also allows you to tell an animation (either looping animation, from this plugin, or a normal animation from the Show Animation event command) to play behind the character sprite instead of in front

How to use

Add to your plugins folder (file name does not really matter, but I call mine LoopAnim.js).  There are no plugin parameters to configure.

Use the plugin command LoopAnim start event animid to start a looping animation on an event.

Use the plugin command LoopAnimation stop event to stop an animation from looping on an event.

Use the plugin command SetAnimLoc event location to make an animation play behind or in front of an event

animid is the animation id from the Animations tab.  Do not enter leading zeros.

event can be a number (no leading zeros) for a specific map event, 0 for the event that has the plugin command, -1 for the player.  You can also use $gameVariables.value(x) to tell it to retrieve the event id from variable x (change x to the variable id).

location can be any of below/behind/above/front.

Plugin

Download from pastebin

Credit

- Shaz

Terms

- free for use in commercial games

Revisions

2015.10.30 - added ability to make animations play behind the character instead of in front
 
Last edited by a moderator:

MikeMakes

Veteran
Veteran
Joined
Sep 30, 2015
Messages
164
Reaction score
41
First Language
English
Primarily Uses
Thank you for this.

Is it possible to make the Battle Animation appear below the Actor and other events instead of it being on top?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
I will have a look at that - I had assumed the animations would play on the event according to where the Animations tab says to play them (you have a sprite when creating an animation and can say whether it plays near the head or feet or wherever).
 

MikeMakes

Veteran
Veteran
Joined
Sep 30, 2015
Messages
164
Reaction score
41
First Language
English
Primarily Uses
I will have a look at that - I had assumed the animations would play on the event according to where the Animations tab says to play them (you have a sprite when creating an animation and can say whether it plays near the head or feet or wherever).
Oh, I meant the Battle Animation playing behind the Actor Sprite on the map, Z-axis positioning wise. So the Actor could be walking on top of the battle animation.

I'm not sure if in RPG Maker that battle animations have always been played over the event's sprite.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
I have updated this plugin to allow you to make an animation play BELOW/BEHIND the character on the map.  This can be used either for the looping animation OR for a regular Show Animation command.

To use, add a Call Plugin command as follows:

SetAnimLoc event locationwhere event is the event id (0 for "this event", -1 for player, or 3 for EV003, etc), and location is one of behind/below/above/front.  Animations play above/in front of the character by default.

This plugin call should be used before the LoopAnim plugin call if you are using them together.  However you can issue the SetAnimLoc plugin call after starting the looping animation, and it will change its z-index when the next iteration begins.
 

MintDrop

Villager
Member
Joined
Nov 24, 2014
Messages
5
Reaction score
1
Primarily Uses
Hm. I thought it could be achieved by just setting a loop with the animation command inside, but this could very well have a different effect x3
I may try it out if I think of a use for it. Nice job anyway~
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
A loop with animation inside would require you to get your timing just right so you could start it again when it finished, without a break between.  It would also require more processing, so could affect your game's performance.  Still - give it a go if you want to - I'm a big fan of not using scripts/plugins when you don't have to :)
 

MikeMakes

Veteran
Veteran
Joined
Sep 30, 2015
Messages
164
Reaction score
41
First Language
English
Primarily Uses
Thank you so much, Shaz, for the ability to set the animation below the player! I'm also really surprised at the lack of lags for even playing multiple animations.

It really helps me to save the time and memory resource from remaking a sprite of the battle animation with many frames of animations with transparency as an event to be animated below the character.

What's the difference between the location of BELOW and BEHIND? I've tested both and didn't notice any difference. Is it for convenience because some people would incline to type BEHIND and vice versa?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
They both do the same thing.  I just included both options in case people got confused :)
 

Danito

Villager
Member
Joined
Dec 20, 2015
Messages
31
Reaction score
2
First Language
English
I get a syntax error, no Idea why  EDIT: LOL I just had it in the scripts part lolololo sorry

 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
Those errors don't appear to have anything to do with this plugin.
 

Danito

Villager
Member
Joined
Dec 20, 2015
Messages
31
Reaction score
2
First Language
English
I know, But I meant they only came when it was Running the script event calls(even though they were meant to be plugin commands, hense how It was fixed and just a dumb mistake XD)
 

Porcelain

Veteran
Veteran
Joined
Oct 12, 2015
Messages
38
Reaction score
2
First Language
English
Primarily Uses
First of all, I want to say that I love this plugin because it fixes the bug in default MV where entering the menu makes animations disappear.

One question, though. Is there a way to have animations play beneath the tileset, but above the parallax layer? I want to have a rain effect outside a window.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
Can you show me a screenshot of your map, zoomed in as large as possible, so I can see where you plan to show it? I'm imagining you have a patch of grass or some tree trunks on the lower layer (A tiles) with a window from a B-E tile above it?
 

Porcelain

Veteran
Veteran
Joined
Oct 12, 2015
Messages
38
Reaction score
2
First Language
English
Primarily Uses


Green and Blue with clouds: Parallax (bottom layer)

Dark gray: Wall with transparent window (A tiles)

Light gray: Floor (A tiles)

Yellow lines: Rain animation

Red square: Character

I don't have a screen because this is only a concept right now, but I know how to execute it because of Galenmereth's Bind Picture to Map, which has all the layers you would need for this, but doesn't allow drawing animations.
 
Last edited by a moderator:

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
I'm glad to see you remade your looping animation script for MV!

I've used the Ace version and loved it! I hope to try this out later.
 

Porcelain

Veteran
Veteran
Joined
Oct 12, 2015
Messages
38
Reaction score
2
First Language
English
Primarily Uses
Can you show me a screenshot of your map, zoomed in as large as possible, so I can see where you plan to show it? I'm imagining you have a patch of grass or some tree trunks on the lower layer (A tiles) with a window from a B-E tile above it?


I don't mean to bother you, but was my image not detailed enough? I'm willing to provide a more detailed mockup if so.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
I'm really sorry - I didn't get notification that you had replied.


I'm testing something out, and it's partially working - animations AFTER the first loop will play behind the map and in front of the parallax.  But it needs some tweaking to play in between.


Usually if I want to do something like this (seeing rain through a window), I would create a character sprite for it with the different frames, and either turn on stepping animation or set the autonomous move route to 'turn down, turn left, turn right, turn up' and repeat.  Something like that will work if you only need 3 or 4 frames of animation.  That would save you having to wait for a mod to this plugin.
 

Porcelain

Veteran
Veteran
Joined
Oct 12, 2015
Messages
38
Reaction score
2
First Language
English
Primarily Uses
I'm really sorry - I didn't get notification that you had replied.


I'm testing something out, and it's partially working - animations AFTER the first loop will play behind the map and in front of the parallax.  But it needs some tweaking to play in between.


Usually if I want to do something like this (seeing rain through a window), I would create a character sprite for it with the different frames, and either turn on stepping animation or set the autonomous move route to 'turn down, turn left, turn right, turn up' and repeat.  Something like that will work if you only need 3 or 4 frames of animation.  That would save you having to wait for a mod to this plugin.


Don't worry about it. Thanks for taking the time to look into this. I'll wait as long as it takes, and if I get to the part I want to use this for before that, then I'll just make an animated tile for it or use the step animation method.


Not sure if this helps, but this plugin:





allows you to play animations behind the map and above the parallax. The only problem is that it doesn't fix the default MV bug where all animations disappear when you enter and exit the menu.
 
Last edited by a moderator:

Angel.K1tty

Artist with a side of Elegance
Veteran
Joined
Oct 28, 2017
Messages
60
Reaction score
83
First Language
English
Primarily Uses
RMMV
Is there a version of this for VX Ace? I'm having a problem in my VX Ace game where the animation moves with the camera.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Playtesting for Battle Castle is done, demo time for me was roughly 6 hours and 20 minutes. I'm going to pass it on to a few friends first, and after getting some feedback will be posting an official topic.
There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?

Forum statistics

Threads
97,909
Messages
947,778
Members
129,148
Latest member
lemminace
Top