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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,715
Reaction score
15,839
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,715
Reaction score
15,839
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

normal_water_is_fine.jpg

Just going to use stationary water for the randomized maps. Sure, particles would look cool... But this is about compromising and not spending countless hours making the perfect water particle for each set piece with water. :kaoswt:
Maybe I should get rid of the Banish ability in my game. It's a non-elemental spell that doesn't even appear in the magic chart. It's only there because my Elementalist doesn't use light or dark magic. It only effects summoned creatures.
ScreenShot_5_18_2022_0_37_0.png
I've been redoing all of the major areas in my game. starting with a place called Century Park. thankfully because all of the locations are distorted memories, I can make these places pretty abstract.

Forum statistics

Threads
121,910
Messages
1,145,104
Members
160,173
Latest member
Tinseltownie
Top