Disable HP & MP Regeneration outside battle?

Status
Not open for further replies.

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
Hi,

is there some way to disable the HP & MP Regeneration outside of battle - my outside battle regeneration will be handeled with a belly system (hunger system) similar to pokemon mystery dungeon, and if my actors have HPREG or MPREG it messes with the regeneration outside of battle.


cheers!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
The smartass in me really wants to say "Yes, there is some way." because that is the actual question you asked, but I'll be nice.

The easiest way to do it would be to remove the call to onTurnEnd() in Game_Actor.prototype.turnEndOnMap, though that will also prevent the clearing of result, the updating of state turns, the updating of buff turns, and the auto-removal of states.

Probably the way I would go about this would be to overwrite turnEndOnMap to call clearResult(), updateStateTurns(), updateBuffTurns() and removeStateAuto(2) and remove the call to onTurnEnd(). This will make everything work exactly the same way as before but you won't regenerate while walking.
 

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
So, I found this. I am pretty noob, so to what exactly shall I change it >. < ?
Its in rpg_objects.js , thats the file I was looking for right?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
There is another approach if you don't want to go through scripts.

Regeneration is a trait, which means there will be no regeneration if nothing gives the actors that trait outside combat.

If all regeneration is done by states, then simply make those states end when combat has ended, and don't give any HP/MP-Regen-Traits to any equipment, class or actor.

At the same time, that is the only problem where it doesn't work: if you want to have an equipment that regenerates only inside battlescreen, then you'll need a script modification because by default that would work if equipped outside battle.
 

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
There are items & equipment that give regeneration so I can't really do it, also have thought about just reducing recovery rate to 0 on maps, but its kinda counter intuitive because I am using the better status menu from ... yanfly (I think it is) and then you wouldn't be able to check your HPREG outside of battle.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Do you want me to tell you how to achieve the effect by editing the default code or do you want me to write you a small plugin to do it?
 

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
You decide whats easier, usually I am not too dumb to edit the default code, but ay - you plugin makers and your magic, maybe its easier to just create some small plugin.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Code:
//=============================================================================
// DisableMapRegen.js
//=============================================================================

/*:
 * @plugindesc Disables regeneration on maps.
 * @author John Clifford (Trihan)
 *
 * @param Disable HP regen
 * @desc Disable map regeneration for HP.
 * @default true
 *
 * @param Disable MP regen
 * @desc Disable map regeneration for MP.
 * @default true
 *
 * @param Disable TP regen
 * @desc Disable map regeneration for TP.
 * @default true
 *
 * @help
 *
 * Plug and play. Disables all regen by default, but there are parameters to allow HP, MP or TP regen separately.
 *
 * Terms of use
 * Please feel free to use this plugin for any purpose you see fit. Credit is appreciated but not necessary.
 *
 */

(function() {
    var parameters = PluginManager.parameters('DisableMapRegen');
    
    Game_Actor.prototype.turnEndOnMap = function() {
        if ($gameParty.steps() % this.stepsForTurn() === 0) {
            this.clearResult();
            this.regenerateMap();
            this.updateStateTurns();
            this.updateBuffTurns();
            this.removeStatesAuto(2);
            if (this.result().hpDamage > 0) {
                this.performMapDamage();
            }
        }
    };
    
    Game_Actor.prototype.regenerateMap = function() {
        if (this.isAlive()) {
            if (parameters['Disable HP regen'] !== "true") {
                this.regenerateHp();
            }
            if (parameters['Disable MP regen'] !== "true") {
                this.regenerateMp();
            }
            if (parameters['Disable TP regen'] !== "true") {
                this.regenerateTp();
            }
        }
    };
})();
 

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
for some reason its not disabling the regen.
I tested it putting HREG of my actor to 10% and then running around, it kicks in about every 20 steps :/
I put it on top of all plugins... maybe some other plugin is messing with it >.< but I am like 99.99% sure its not another plugin because
I tested it in a completely new project without any other plugins and the actors regenerated too.
:>
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Hmm, it worked in my tests. Let me take another look.

Yeah, they definitely don't regen on my test project. I'd say you might be using a plugin that also does something with turnEndOnMap but you said it also did it in a brand new project...hmm. You didn't change any of the default parameters did you?
 

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
I didn't edit anything in the default scripts.
I tried setting the HP regen trait in different places like, actor, classes etc. and it is still regenerating.
(testing in the new empty project)
What are we doing differently :D hmmm~

I found the problem. :D

It says "disable Hp regen" , so I set it to >true< to disable the hp regen.
Now that I turned it to false, its turned off... so it works! Just maybe a wording issue, but thats not huge if you know it.
Thanks soo much <3
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Wait, it doesn't regen if you set it to false? That doesn't sound right...the way I coded it, it should regenerate stats if the parameter is anything but true. So you're saying when you set it to false, you DON'T regenerate?
 

Benji01

Veteran
Veteran
Joined
Jun 7, 2015
Messages
104
Reaction score
8
First Language
German
Primarily Uses
Nvm.
Ok seems there is some other problem, as we have started discussing it in PMs already lets continue to try to fix it there. If I get it going, I will edit this post so its documented for future users looking for a way to disable on map regen.
__________
Ok "we" found the problem.
So here is what I did wrong!
I named the plugin not in the correct way.
It is supposed to be called "DisableMapRegen.js" - that was the problem. kek.

Thanks so much @Trihan !

cheers
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,377
Reaction score
8,536
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top