Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
I like the 3 "autoregens" but one thing I totally hate about them is that they also work while you're just walking.
IMO the regen should operate only during battles. Because it's very easy to just move back and forth and fully restore HP/MP/TP in this way.
So my question is simple: is there a way to prevent HRG, MRG and TRG to respectively restore HP, MP and TP while you're just walking around?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
Game_Actor.turnEndOnMap()

that triggers the turn end as in battle, which calls for the regeneration.
cut that flow as you see fit.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
Where is that line and do I only have to remove it?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
that's the function that gets triggered outside of battle
look for it within Game_Actor and follow the code.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
Is there such a thing as Game_Actor for MV? I can't seem to find it...
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
within rpg_objects?
line 3400-ish?
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
The closest I've found is this:

Game_Actor.prototype.turnEndOnMap = function() {
if ($gameParty.steps() % this.stepsForTurn() === 0) {
this.onTurnEnd();
if (this.result().hpDamage > 0) {
this.performMapDamage();
}
}
};

If this is it, what should I change?
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
816
Reaction score
361
First Language
English
Primarily Uses
N/A
Hmmm... You can just comment out the performmapdamage line.

The problem will then be if you need poison effects to work.

You might do better to find that function and edit it directly.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
606
First Language
English
Primarily Uses
RMMV
Maybe I'm not seeing the bigger picture here, but wouldn't it be easier to just make the regen a state that expires at the end of battle?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
this.onTurnEnd();

that.
that triggers the battle turn end, from the map.
if you go into that function, you'll see the calls to regenerate everything.

that's why I leave it up to you, to either disable that, or disable the whole function, or disable the individual regenerations at battle level.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
And do I go into a function, specifically how do I go into this.onTurnEnd and then disable the regeneration on map level?
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
Sorry for the double post but I tried to remove the bit in bold, and it didn't change anything.
Still getting regenerated by just walking...

Game_Actor.prototype.turnEndOnMap = function() {
if ($gameParty.steps() % this.stepsForTurn() === 0) {
this.onTurnEnd();
if (this.result().hpDamage > 0) {
this.performMapDamage();
}
}
};



I also tried to remove the full thing entirely and the game gives an error message.

Has anyone got a clue what to do exactly?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
do a broad search for .regenerateHP() and go from there.
I was pointing you to the top-most function that deals with that procedure, but if it doesn't affect it whether you disable it or not, then something it bypassing that and triggering the actual regeneration.

if you don't find any hits on the default code or plugins, then most likely a plugin is overriding THAT as well, by doing the regeneration directly by adding to the HP.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
@gstv87 I'm not a scripter so it won't be easy.
Would it be easier to remove all map regen if poison on map (but not in battles) is also removed?
I'm willing to that at this point as regen on map is such a daft idea in itself IMO.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
map regen just calls the same function that is used in the battle scene.
regeneration is a property of actors, and all actors are battlers, and battlers are handled by the battle scene.

if you want to remove the regeneration on map, just disable that line.
if it doesn't work, then something else is triggering the same function somewhere else.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
@gstv87 I'm probably doing it wrong but I removed

Game_Battler.prototype.regenerateHp = function() {
var value = Math.floor(this.mhp * this.hrg);
value = Math.max(value, -this.maxSlipDamage());
if (value !== 0) {
this.gainHp(value);
}
};


located in rpg_objects

Then I got an error message I believe at the moment poisoned should have decreased HP.

bug.png
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
816
Reaction score
361
First Language
English
Primarily Uses
N/A
Firstly, good for you for trying to edit the code yourself.
Secondly, it's bad practice to edit the original files. You might break something accidentally.
Thirdly, if you're willing to give me a few hours, I'll knock this plugin out for you.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,357
Reaction score
1,383
First Language
Spanish
Primarily Uses
RMVXA
of course it's gonna be YEP.
*sigh.....*

the problem is yanfly's plugin overriding onPlayerWalk.
if you want to fix it yourself, you have to find the matching regenerateAll() from Game_Actor, to yanfly's override, and backtrack to it's common root.
I don't know the structure of YEP.

yanfly's onPlayerWalk() calls the standard onPlayerWalk(), IT calls onTurnEnd(), onTurnEnd() ITSELF is *again* overwritten by YEP, then YEP calls regenerateAll() from it's core, and IT returns the control to the standard regenerateAll()
you were modifying the last link of the chain.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
816
Reaction score
361
First Language
English
Primarily Uses
N/A
I tried making a plugin snippet for this.
DL this plugin and put it in your plugin list.
(Should be fine at the top.)

Let me know how it works.

plugin
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,010
Reaction score
852
First Language
French
Thanks for your help. Sadly, it didn't stop the regeneration from happening. I tried putting it at the top like advised, and then at the bottom. Made no difference. I'm using several YEP plugins, if that helps (or not).
 

Latest Threads

Latest Posts

Latest Profile Posts

Gameboy Tiles, Cure Writer's Block, Animations on Menu, Generate Tasks | RPG Maker News #40

How would you judge a game you played? Art/Graphics? Story? Gameplay?
Learn MV sales goal = 2%
NSFW game sales goal = 2500% (no jokes) :guffaw:
After gathering, sorting out & reconsidering hundreds of enemy battlers over the last two das, finally my favorite part begins: Inventing names and lore for them all :D

Forum statistics

Threads
111,377
Messages
1,060,583
Members
144,706
Latest member
DonTonyPepperoni
Top