First plugin - recover all on level up

DSR

Warper
Member
Joined
Dec 22, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Script Name+Version Number:  DSR_plugin v0.1



Creator name: DSR


 


Introduction


Include script in plugin manager (placing .js file in the js/plugin folder naturally)


By default, it will enable the recover all on level up.  Change parameter to false (or just turn plugin off or remove it) to disable this feature


 


Features


- When an actor levels up, all of their depleted HP MP (and whatever else) will be recovered


 


Screenshots


none


 


How to Use


See above.  Pretty much just plug and play, no dependencies and shouldn't interfere with other plugins.  No guarantees though.


 


Demo


none


 


Script


 

Code:
//=============================================================================
// DSR - plugin
// DSR_plugin.js
// I totally copied all the coding conventions from the Yanfly plugins,
// sorry for biting your style!  I hope you feel, as I do, that
// imitation is the sincerest form of flattery.
//=============================================================================
var Imported = Imported || {};
Imported.DSR_plugin = true;
var DSR = DSR || {};
DSR.plugin = DSR.plugin || {};
DSR.plugin.version = 0.1;
//=============================================================================
/*:
 * @plugindesc adds some functionality I wanted to see.
 * @author DSR
 * @param Restore all on level up
 * @desc run restore all on level up? true or false
 * Default: true
 * @default true
 * @help you're pretty much on your own with this one
 */
//=============================================================================
DSR.Parameters = PluginManager.parameters('DSR_plugin');
DSR.Param = DSR.Param || {};
DSR.Param.RestoreAllOnLevelUp = String(DSR.Parameters['Restore all on level up']);
DSR.Param.RestoreAllOnLevelUp = eval(DSR.Param.RestoreAllOnLevelUp);
DSR.plugin.levelUp = Game_Actor.prototype.levelUp;
Game_Actor.prototype.levelUp = function(){
  DSR.plugin.levelUp.call(this);
  if (DSR.Param.RestoreAllOnLevelUp) this.recoverAll();
};

FAQ


 


Q: Why did you make this plugin?


A: I tried to find a built in way to make this happen, and couldn't find one (please tell me if I missed it) so this is what happened.


 


Q: Limitations on use?


A: Free to use for any purpose, no matter how offensive to god, man, or nature.


 


Credit and Thanks


- Author: DSR


- Mad props to Yanfly, as noted in the script I heavily emulated the conventions and style from the Yanfly series of plugins.


 


Author's Notes


None yet, please provide feedback.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,939
Reaction score
13,577
First Language
English
Primarily Uses
RMMV
The formatting is really bad for a script.  Code should be in a code block - the <> on the toolbar.  And you can leave it as 'no formatting' or set to 'javascript' when you get that window up.  That keeps it aligned to the left and indented correctly.  I'm not sure what those couple of lines are all the way over to the right.


Also, since you asked:





But good on you for having a go and making something that works.  There's nothing quite like sharing your first script :)   If you're planning to release a few, it might be worth getting a pastebin or git or something like that, just to keep your scripts/plugins all in one place away from the forum.  If you look through the old script threads, you'll see one of the forum updates accidentally reformatted all the scripts in such a way that they're no unusable.  If you do that, you can still set up the thread as usual, but instead of pasting the script into the thread, you can just provide a link to it.


Now on to your next one ;)
 
Last edited by a moderator:

DSR

Warper
Member
Joined
Dec 22, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
thanks for the rapid feedback!


when you say the formatting is bad for a script, is that just the way it looks in the forum (i copy-pasted the submission template from another thread), or is there something ugly about the code itself? i'm blind leading blind teaching myself javascript, so if it's the latter, i'd like to fix it before it becomes a habit.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,939
Reaction score
13,577
First Language
English
Primarily Uses
RMMV
It's just the way it's showing on the forum.  The code is centered, with a whopping big horizontal scroll bar, and for some reason there are a couple of commands that should be on their own lines but are far across to the right.  That last bit could be an issue with your code, but the centering is the forum.  I'd say it's probably because the entire post is centered (which isn't necessarily good, either - centered text makes it harder to read).


I think if you remove the centering from the whole post, and take a look at those two lines way out to the right, it should be fine.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I will be streaming RPG Maker demos very soon
Not. Enough. TIME.
Ami
--- Cheating ---

Hero: I can't Stand this! (Activate Infinite HP, Stats 999)
Game Police: Hold right there!
Hero: What happened,sir?
Game Police: You're under arrest because Using Cheat in the Game,illegally!
(Handcuffing the Hero)
Hero: Huh???
Game Police: You have the Punishment to Not be in this world: 6 Months
Hero
: (Shocking) WHAT???
Need advice that should be adjusted
Some local cursed and attacked me because I said children should learn copyright....

Forum statistics

Threads
103,131
Messages
997,498
Members
134,607
Latest member
Hade
Top