Animation Variance v0.4.1 (2020-04-22)

Animation Variance v0.4.1
Author: dingk
RMMV version 1.6.2
Updated April 22, 2020
​
Introduction
Tired of looking at the same animation every time you attack? Or trying to make a multi-hit skill but don't want to spend so much time fiddling with the animations editor? This plugin allows you to make slight variations to your animations, so it looks different every time a skill is executed. You can set the rotation and position to be different every time right in the skills editor using notetags. In addition, you can also make animations move with respect to the target's position.

Plugin is still in development, but I would like some feedback. Thanks.
Spoiler: Video Demonstration


Download
Itch.io Link
-or-
Right-click > Save As...

How to Use
  1. Download plugin in the link above.
  2. Place in your /RPG Maker MV/[YourGameTitle]/js/plugins/ folder.
  3. Open the Plugin Manager, and create a new entry at the bottom of the list
  4. Under the Name dropdown, find dingk_AnimationVariance.js near the bottom of the list.
  5. Customize the plugin parameters to the right and click OK.
  6. Click OK to exit the Plugin Manager, and save your project.
If you are updating, refresh the plugin in the Plugin Manager by opening the plugin in the list and clicking OK.

Plugin Parameters
Animation Move Rate
- The frame rate at which the animation moves. Animations run at 15 FPS by default. The higher the FPS, the smoother the animation moves. This doesn't affect how fast an animation moves.
  • Default - Same as default animation frame rate. If you used another plugin to change animation frame rate, this option will sync up animation and movement frames.
  • The other options allow animation to move independently of the animation frames. 60 FPS is the smoothest.
Global Animation Variance
  • You can set animation variance globally. Any time the animation is used, they will follow the variance/move settings defined here.
  • Notetags and scripts will override anything you set here.
  • Read the Notetags section below to fully understand the mechanics.

Notetags
Enter these notetags under the Note box.

Item and Skill Notetags:
Code:
<Action Animation Variance>
rotation: a to b
position X: a to b
position Y: a to b
</Action Animation Variance>
Make the assigned skill animation vary with rotation and position. Each property is optional.
Rotation - randomize the rotation from a to b in degrees.
Position X - randomize the horizontal position from a to b in pixels
Position Y - randomize the vertical position from a to b in pixels

Code:
<Animation a Variance>
...
</Animation a Variance>
For skills that change or use multiple animations like in normal attacks and Yanfly's action sequences. If you use different animations in your action sequences, use this notetag, setting a to be the animation ID. Same setup as above.

Code:
<Action Animation Move[: frames]>
rotation: a to b
position X: a to b
position Y: a to b
screen X: a to b
screen Y: a to b
</Action Animation Move>
Make the assigned skill animation move with respect to the target's position. You can optionally set frames number of animation frames that the animation will move. Otherwise, it will move for the entire animation. This value is tied to your Animation Move Rate. Say if your animation move rate is 60 FPS, but your animations are 15 FPS. If you want to move an animation for 3 of its frames, you have to set frames to be 12.
Rotation - Rotate from a to b in degrees.
Position X / Position Y - Move from point a to b in pixels, relative to the target's position.
Screen X / Screen Y - Move from point a to b in pixels anywhere on the screen. Accepts Javascript code. Available variables are a which is the user, and b which is the target. For example, you can grab their positions, using variables a.x, a.y, etc.
Example:
Code:
<Action Animation Move>
position X: 0 to -200
</Action Animation Move>

Code:
<Animation b Move[: a]>
...
</Animation b Move>
For skills that change or use multiple animations like in normal attacks and Yanfly's action sequences. If you use different animations in your action sequences, use this notetag, setting b to be the animation ID. Same setup as above.

Advanced Notetags
In the above notetags, you can define custom formulas for the movement path of the animation. The format is:
Code:
<Action Animation Move>
property: formula from a to b
</Action Animation Move>
The animation will move using the formula, moving from a to b. Use the variable n to denote the current animation frame.
Example:
Code:
<Action Animation Move>
position X: Math.pow(n, 3) from 0 to 100
</Action Animation Move>
This animation will move from slow to fast with this exponential function.
Note: Do not use complex functions that have bounds like sine or logarithmic functions. For this, refer to the following.

Code:
<Action Animation Move>
position X: advancedFormula
</Action Animation Move>
If you don't want to be constrained to some bound or want to use functions like sine, use this notetag (which is just the above notetag without "from a to b"). Again, use n to denote the current animation frame in your formula.

Map Event Scripts
Spoiler: Map Event Animation Examples
WeeklySpicyEft-small.gif
EnchantingRawDotterel-small.gif
Several scripts are available to customize animation variance for map event animations.
Place these before you execute Show Animation...

Code:
SetAnimationVariance(id, {
  rotation: [0, 0], positionX: [0, 0], positionY: [0, 0]
});
Sets the customized variance for an animation. Replace id with the animation ID. Replace 0's with another number.
You don't need to include every property if you aren't using it, but if you do, separate each property with commas.

Code:
SetAnimationMove(id, {
  rotation: [0, 0], positionX: [0, 0], positionY: [0, 0],
  screenX: [0, 0], screenY: [0, 0],
  formulaR: 'n', formulaX: 'n', formulaY: 'n',
  formulaSX: 'n', formulaSY: 'n'
}, frames);
Sets the customized movement for an animation. Replace id with the animation ID. Replace 0's with another number or formula.
As with the notetags, you can set a custom movement path using an arithmetic formula with variable n. Each represent rotation, positions X, Y, screen positions X, and Y respectively. You must surround each formula with a pair of quotation marks or apostrophes or you will get an error.
[Optional] Replace frames with the desired number of frames to move the animation.

Code:
ResetAnimations();
Removes any customizations from the scripts above. Be aware that this is called after every battle.

Spoiler: Replicating Example #1
This animation was created at Animation Move Rate: 1 (60 FPS) with 15 FPS animations. (See Plugin Parameters)
l3O7OOx.png

Animation 87 was modified to be static.
SardonicGlassHalicore-size_restricted.gif
Spoiler: Replicating Example #2
GMQRf92.png

Compatibility
Have yet to encounter compatibility issues.

Terms of Use
Free and commerical use and redistribution (under MIT License).

Spoiler: Changelog
v0.4.1 - Bug fix
- Fixed a bug that caused mirrored animations to not be displayed properly.
v0.4 - Feature update
- New feature: Map animation variance/movement
- New feature: Global animation variance (see plugin parameters)
- Made Animation Move Rate parameter easier to understand.
- Fixed a bug that prevented multiple animation moves from working.
- Fixed a bug that broke the 'Show Animation' command outside of battle.
- Fixed an animation movement notetag bug that assigned screen Y values to position Y.
- Fixed a bug that caused enemy attack animations with custom screen movement to not appear.
- Enemy attack animation variance is now mirrored.
v0.3 - Feature update
- New feature: Animation move rate
- Fixed a bug that failed to read negative values properly when using an advanced action animation move.
- Errors for bad formulas will now display the formula in the console.
v0.2.1 - Bug fix
- Fixed a bug that caused an animation executed by the enemy to come flying offscreen when using screen animation movement.
v0.2 - Feature update
- New feature: Custom movement formulas
- New animation movement properties: Screen X / Y
- Fixed a bug that crashes the game when executing an action with no animation.
v0.1 - Initial
- Development test release
This is a pretty cool idea, following to see how it develops
Wow, that actually adds a lot to the battle experience. It’s the small details like this that matter, thanks!
This is actually a great idea! Great job!
v0.2 Feature Update
  • New feature: Custom movement formulas
    • You can now use custom formulas using Javascript to make calculated, fancy animation movements
  • New animation movement properties: Screen X / Y
    • You can now move animations by pinpointing the exact pixel on the screen.
    • With this, you can do stuff like moving animations from the skill user to the target, as if you are shooting something.
Bug fixes:
  • Fixed a bug that crashes the game when executing an action with no animation.

Caught this one right after releasing v0.2
v0.2.1 - Bug fix
  • Fixed a bug that caused an animation executed by the enemy to come flying offscreen when using screen animation movement.
v0.3 Feature Update
  • New feature: Animation move rate
    • You can now make animations move independently from the default animation frame rate.
  • Fixed a bug that failed to read negative values properly when using an advanced action animation move.
  • Errors for bad formulas will now display the formula in the console.
Awesome plug-in, great work!
is this only side view or also front view?
Any chance this can be used on battle animations that aren't associated with an item or skill? For example, if you were just playing a battle animation on the map?
Any chance this can be used on battle animations that aren't associated with an item or skill? For example, if you were just playing a battle animation on the map?

I'd like to second this OP, would be really useful
I'd like to second this OP, would be really useful
I'll see if I can get around to adding that feature sometime this week.
After 3 month of no updates, I finally got around to adding some new stuff.

v0.4
- Feature update
  • New feature: Map animation variance/movement
  • New feature: Global animation variance (see plugin parameters)
  • Made Animation Move Rate parameter easier to understand.
  • Fixed a bug that prevented multiple animation moves from working.
  • Fixed a bug that broke the 'Show Animation' command outside of battle.
  • Fixed an animation movement notetag bug that assigned screen Y values to position Y.
  • Fixed a bug that caused enemy attack animations with custom screen movement to not appear.
  • Enemy attack animation variance is now mirrored.
Not dead yet, been working on other stuff.

v0.4.1 - Bug fix
  • Fixed a bug that caused mirrored animations to not be displayed properly.
This plugin is so awesome. Unfortunately it breaks my game with enemy animations the way my game is set up currently. Is it possible to only affect my actors and Not enemies? I'm using a front view battle
system so not a major loss for enemy animation variance.
That's quite nice for front view battles for sure.
Hope you're keeping it updated 🙂

Original thread: https://forums.rpgmakerweb.com/threads/animation-variance-v0-4-1-2020-04-22.110787/