Ok so title says all.
I`ve been crackin my head trying to make this by events by touching variables and conditions.
Im pretty sure it can be done via events but I cant seem to find a way.
What I`m looking for is to make characters heal fixed x ammount by every y steps. (Not %)
Any help for this poor fella here would be great.
def regenerate_mp @result.mp_damage = -(mmp * mrg).to_i if(in battle) @result.mp_damage -= 1 end self.mp -= @result.mp_damage endThe idea will work with some edits. I don't remember the command for seeing if the party is in battle or not either right now, but once we know it, replace where I put in_battle in the code with the correct script code, it should then work only outside of battle (the lines above it are the default code, so we want that unchanged). Then change 1 to whatever you want the fixed MP regenerate to be.
No errors happened whoever no regen happened either (outside and inside battle)
def regenerate_mp
@result.mp_damage = -(mmp * mrg).to_i
if($game_party.in_battle)
@result.mp_damage -= 1
end
self.mp -= @result.mp_damage
end
btw, what to_i means?
to_I means convert the result to an integer. Without it, you would see people regenerate 0.65 MP.
Ok, the way you entered it, it will only regenerate 1 MP when in battle. We need the opposite of the party in battle. My bad. Will
!$game_party.in_battle work?
You don't need a script to do this. Just have a common event set to Parallel Process and conditioned by a switch that's turned on at the beginning of the game:
Control Variables: [0055: Player Steps] = Game Data > Other > StepsConditional Branch: Variables [0055: Player Steps] <> Variables [0056: Last Player Steps] Control Variables: [0056: Last Player Steps] = Variable [0055: Player Steps] Control Variables: [0055: Player Steps] /= 3 Conditional Branch: Variables [0055: Player Steps] == 0 Change HP: Entire Party: + 1 Branch EndBranch EndWait 10 Frames
What's happening here is that it's keeping track of # steps in 2 variables. One is the current step count each time this check is done, and the other is the "old" step count. They are compared, to see if the player has actually taken a step. If they have, the "old" counter is updated, and the "new" counter then just becomes a variable to muck around with. It does a /= 3 (mod 3) to see if 3 steps have been taken, and if they have, adds 1 HP to all party members.
Change the 3 to however many steps you want the player to take before HP is increased. Change the +1 to however many HP you want to give at that step count. And replace variables 55 and 56 with whatever you have available.
I made a few adjustments and everything is working fine, thanks guys!
Solved.
Nice add Lecode, looks very simple, thanks!
The thing is that characters get revived with your regen.
What can i do to make characters not regen when they are dead?
use $game_party.alive_members instead of $game_party.members
All working, I hope this script helps people who need the same thing as I did.
Thanks for everything guys!