This animation was created at Animation Move Rate: 1 (60 FPS) with 15 FPS animations. (See Plugin Parameters) Animation 87 was modified to be static. Spoiler: Replicating Example #2 Compatibility
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.
Download
Itch.io Link
-or-
Right-click > Save As...
How to Use
- Download plugin in the link above.
- Place in your #4da6ff">/RPG Maker MV/[YourGameTitle]/js/plugins/ folder.
- Open the Plugin Manager, and create a new entry at the bottom of the list
- Under the Name dropdown, find dingk_AnimationVariance.js near the bottom of the list.
- Customize the plugin parameters to the right and click OK.
- 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.
#ff0000">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
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.
#ff4d4d">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.
Removes any customizations from the scripts above. Be aware that this is called after every battle.
This animation was created at Animation Move Rate: 1 (60 FPS) with 15 FPS animations. (See Plugin Parameters)
Animation 87 was modified to be static.
Compatibility
Have yet to encounter compatibility issues.
Terms of Use
Free and commerical use and redistribution (under
MIT License).
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
Terms of Use Free and commerical use and redistribution (under MIT License). Spoiler: Changelog v0.4.1 - Bug fix