RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[MV] Actor Sprite Options 1.0.1

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)Secret Santa 2012 ParticipantProject of the Month winner for July 20092011 Favourite Staff Member2011 Best Veteran2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Actor Sprite Options
Version: 1.0.1
Author: modern algebra
Date: 31 October 2015

Version History


  • <Version 1.0.1> 2015-10-31 - Converted to lazy instantiation to preserve save files
  • <Version 1.0.0> 2015-10-30 - Original Release

Description


Set the step animation, move animation, and blend type for each actor individually. For instance, this will let you make a flying actor that still flaps his or her wings whenever the party is stationary.

Features

  • Easy to set up through actor notes

Instructions

Save the script in your plugins folder and import it through the Plugin Manager.

The plugin is set up by writing the following codes in an actor's notebox. To make it so that an actor is animating even when stationary, write:

      \step

To make it so that an actor is not animating even when moving, write:

      \immobile
 
 To change the blend type of an actor to something else, write:

      \blend[x]

Replace x with an integer, where the integers mean the following:
      0  : Normal
      1  : Additive
      2  : Multiply
      3  : Screen

Plugin


You can download the .js file from Pastebin: http://pastebin.com/Fh1n8SHL

Code: [Select]
//=============================================================================
//  Actor Sprite Options
//  Version: 1.0.1
//  Date: 31 October 2015
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*:
 * @author Modern Algebra (rmrk.net)
 *
 * @plugindesc Set the step animation, move animation, and blend type for each actor individually
 *
 * @help With this plugin, you can set the blend type, walk animation, and step
 * animation for actors. If one of your actors is a flying creature like an
 * angel, for instance, this script lets you set it so that he or she is still
 * beating his or her wings while the player is stationary.
 *
 * The plugin is set up by writing the following codes in an actor's notebox.
 *
 * To make it so that an actor is animating even when stationary, write:
 * \step
 *
 * To make it so that an actor is not animating even when moving, write:
 * \immobile
 *
 * To change the blend type of an actor to something else, write:
 * \blend[x]
 *
 * Replace x with an integer, where the integers mean the following:
 * 0  : Normal
 * 1  : Additive
 * 2  : Multiply
 * 3  : Screen
 */
//=============================================================================

(function() {

// mafsoBlendMode - Lazy Instantiation, default of 0
Game_Actor.prototype.mafsoBlendMode = function() {
if (!this._mafsoBlendMode) {
var actor = this.actor();
if (actor) {
var rmatch = actor.note.match(/\\BLEND\s*\[\s*(\d+)\s*\]/i); // \blend[x]
this._mafsoBlendMode = rmatch ? +rmatch[1] : 0;
}
}
return this._mafsoBlendMode || 0;
}

// mafsoWalkAnime - Lazy Instantiation, default of true
Game_Actor.prototype.mafsoWalkAnime = function() {
if (!this._mafsoWalkAnime) {
var actor = this.actor();
if (actor) { this._mafsoWalkAnime = !(/\\IMMOBILE/i).test(actor.note); } // \immobile
}
return this._mafsoWalkAnime || true;
}

// mafsoStepAnime - Lazy Instantiation, default of false
Game_Actor.prototype.mafsoStepAnime = function() {
if (!this._mafsoStepAnime) {
var actor = this.actor();
if (actor) { this._mafsoStepAnime = (/\\STEP/i).test(actor.note); } // \step
}
return this._mafsoStepAnime || false;
}

// Set Sprite Options based on actor
Game_Character.prototype.mafsoSetActorSpriteOptions = function(actor) {
this.setBlendMode(actor.mafsoBlendMode());
this.setWalkAnime(actor.mafsoWalkAnime());
this.setStepAnime(actor.mafsoStepAnime());
};

// Refresh
var mafso_Game_Player_refresh =
Game_Player.prototype.refresh;
Game_Player.prototype.refresh = function() {
mafso_Game_Player_refresh.apply(this, arguments); // Call original method
var actor = $gameParty.leader();
// Set options based on lead actor
if (actor) { this.mafsoSetActorSpriteOptions(actor); }
};

// Game_Follower - Update
var _mafso_Game_Follower_update =
Game_Follower.prototype.update;
Game_Follower.prototype.update = function() {
_mafso_Game_Follower_update.apply(this, arguments); // Call original method
var actor = this.actor()
// Set options based on actor in this position
if (actor) { this.mafsoSetActorSpriteOptions(actor); }
};

})();

Credit


  • modern algebra

Support


Post in this thread if you have any comments or questions. It is perfectly fine to post here even if this topic has not been posted in for a very long time.

Please do not message me privately, as any concerns you have are likely shared by others and they will benefit from our correspondence being public. Additionally, I am often absent, and posting publicly will allow other members to assist you when I am unable to do so quickly.

Author's Notes


This is humiliating.

Terms of Use


You are welcome to use this script in any project of yours, whether it is commercial or non-commercial. There is no need to credit me, and please feel free to modify the plugin in whatever ways suit your project.

Basically, my plugin is your plugin, but please do not re-post this plugin or any modified version of it on another forum or website.
« Last Edit: October 31, 2015, 08:49:20 PM by modern algebra »

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - Story2014 Queen of RMRKProject of the Year 20142011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
Heeeyy, neat idea! :D No need to be ashamed of your plugins, sir!
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
I love you thank you.
&&&&&&&&&&&&&&&&

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best Member2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)Secret Santa 2012 ParticipantProject of the Month winner for July 20092011 Favourite Staff Member2011 Best Veteran2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
I updated this plugin to version 1.0.1. Save files made prior to adding this plugin should now be preserved.