Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,602
First Language
English
Primarily Uses
RMMV
Wasn't sure whether to post this here or JS support. Anyways, in my project all potions (HP or MP) restore some amount per turn, as in there is ONLY as HoT component to the potions in my game. This creates an issue when trying to use these potions outside of battle, however. I would like them to heal some amount every several steps the player takes. Is this possible?
 

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
334
Reaction score
103
First Language
English
Primarily Uses
RMMV
if you make it apply a state, yes. then it's just a matter of a parallel common event checking for the state, if it exists, restore HP.
 

Mewgles

Veteran
Veteran
Joined
Jul 24, 2020
Messages
86
Reaction score
93
First Language
German
Primarily Uses
RMMZ
It should be possible, but you will most likely need a Plugin for that. As far as I know MV doesn't have a built in step counter like some of the older RPG Maker entries. You might be able to do that with an common event, but that would probably end up being quite a chore to set up.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,602
First Language
English
Primarily Uses
RMMV
if you make it apply a state, yes. then it's just a matter of a parallel common event checking for the state, if it exists, restore HP.
Yea, it already had a state being applied, which works for combat anyways.
JavaScript:
<Custom Regenerate Effect>
var hpRegen = Math.round(1.5 * target.level);
target.gainHp(hpRegen);
</Custom Regenerate Effect>

So if I use a common event, how do I get it to count steps?
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
574
Reaction score
147
First Language
Engilsh
Primarily Uses
RMMV
@Frostorm You can set an ingame variable that tracks the steps and then use that variable to create a simple algorithm like so,

JavaScript:
// create a variable outisde of the regenerate effect that will be the initial steps, this variable should only be defined once when the item is used.
$gameVariable.setValue(id of initial variable) = $gameVariables.value(id of step counter variable);

// then use it like this in the regenerate effect
var initialSteps = $gameVariables.value(id of initial variable)
var currentSteps = $gameVariables.value(id of step counter variable)
var numberOfSteps = 5 // set this to how many steps you want it to take before it regenerates.
var hpRegen = Math.round(1.5 * target.level);

if (currentSteps == (initialSteps + numberOfSteps)) {

    target.gainHp(hpRegen);

    initialSteps += numberOfSteps

}

Disclaimer,

I have no idea if this will work I just wanted to give you a rough idea on how to go about it.
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
Step number is available in the database - Control Variables --> Game Data.
 

SoftCloud

Aspiring Game Alchemist
Veteran
Joined
Nov 28, 2018
Messages
66
Reaction score
167
First Language
English
Primarily Uses
RMMV
@Frostorm Also possible is just using a state to be removed after x-amount of steps and set it with Ex-Parameter HP Regeneration. Essentially opposite of the extant poisoned state. I know you mentioned every few steps but with some percentage increases you may be able to achieve the volume of health to be recovered. No need for common events. Can have potions give a burst heal then add the state. Turn removal I think can too be applied easily. I believe this can be done with the vanilla engine.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,602
First Language
English
Primarily Uses
RMMV
Yea I already considered the Ex-Param method w/ HP Regen, but that would mean tank builds get healed for more, which just wouldn't sit right w/ me. If in the end I can't get steps to work, then I'd be ok w/ healing over "time", aka frames.
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
I made a plugin that counts steps for encounters so that the count persists between maps. You could probably use it with minimal amendment to achieve what you need if you've got a basic grasp of JavaScript. Happy to provide it if it would help.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,602
First Language
English
Primarily Uses
RMMV
I made a plugin that counts steps for encounters so that the count persists between maps. You could probably use it with minimal amendment to achieve what you need if you've got a basic grasp of JavaScript. Happy to provide it if it would help.
That sounds great, I would definitely it. Where can I find your plugin?
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
My plugin was actually no good for it so I made you one that is. If you can read basic JS then should be easy enough to amend for what you want, help will show you how it's currently configured. Let me know if you need any help with it. Should save you a parallel process at the very least.
 

Attachments

  • Adept_HealingOnSteps.js
    1.4 KB · Views: 1

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,602
First Language
English
Primarily Uses
RMMV
My plugin was actually no good for it so I made you one that is. If you can read basic JS then should be easy enough to amend for what you want, help will show you how it's currently configured. Let me know if you need any help with it. Should save you a parallel process at the very least.
Awesome, it looks simple and very easy to read. Thank you! ^.^

Edit: I just noticed a huge issue when using steps for HoT. Basically, if the player isn't moving then they don't get healed lol. I think I'm gonna have to use time/frame based HoT instead. I tried the following common event, but the "wait" portion makes it so the player can't move during that time. Is there any way around that?

Code:
◆Change HP:{ActorID}, + {Health}
◆Wait:180 frames
◆Change HP:{ActorID}, + {Health}
◆Wait:180 frames
◆Change HP:{ActorID}, + {Health}
◆Wait:180 frames
◆Change HP:{ActorID}, + {Health}
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

unnamed_image.jpg
SOMEONE'S SINGLE! HE DOES LIKE LONG WALKS IN THE IN THE SHADOWS AND THE SMELL OF DECAY. SADLY, HE HAS NO NUMBER TO NOTE OF BECAUSE HE HAS NO USE FOR A PHONE, BECUASE SUMMONING WORKS MUCH BETTER AND DOES NOT COME WITH AN ITEMISED BILL.
I just found out that MZ regional price on Steam in my place is much cheaper than MV.
Our water started to work again, now i don't have to fill up our toilet with water again.
Finally able to return to work after months of lockdown. My poor feet are hurting :( I need to get used to working again haha

Forum statistics

Threads
108,884
Messages
1,040,268
Members
141,320
Latest member
Hyo
Top