Resetting magic to 50% before battles.

DarkSeraph

Villager
Member
Joined
Oct 25, 2019
Messages
12
Reaction score
0
First Language
english
Primarily Uses
RMMV
So I'd like to have the game reset each actor's magic to 50% of their max at the beginning of each battle.

The actor's regen magic throughout the battle allowing them to use weaker skills over and over but they would have to save up MP to cast more powerful spells.

Anyways. The core game doesn't allow anyway that I can see to reset an actor's magic to anything other then max, or to gain a set amount.

Is there any scripts that allow this? Or perhaps some cleaver events that would allow an actor to rest their MP to 50% of their max at the beginning of each battle?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
565
Reaction score
276
First Language
German
Primarily Uses
There is actually a trick to do this:
You can either reduce the MP to 0 first and then increase it to the amount you want, or you can increase the MP directly by that amount minus the MP the actor already has:

Control Variables : #0017 Difference = Max MP of Actor
Control Variables : #0017 Difference /= 2
Control Variables : #0017 Difference -= MP of Actor

Change MP : Actor, + {Difference}
 
Last edited:

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
You can also use those script lines if you don't want to use variables:

$gameParty.members().forEach(function(m){
m.gainMp(m.mmp);
var half = Math.round(m.mmp / 2);
m.gainHp(-half);
})
 

DarkSeraph

Villager
Member
Joined
Oct 25, 2019
Messages
12
Reaction score
0
First Language
english
Primarily Uses
RMMV
You can also use those script lines if you don't want to use variables:

$gameParty.members().forEach(function(m){
m.gainMp(m.mmp);
var half = Math.round(m.mmp / 2);
m.gainHp(-half);
})
I like the idea of this, unfortunately I'm not sure how I'm supposed to implement this. Currently I'm using this at the beginning of the battle, so that it only activates once per battle, but it doesn't seem to be doing anything. Am I supposed to add my party member names with in the parenthesis after $gameParty.members() ?

My scripting skills aren't very good at the moment.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Sorry, it seem I made a typo. The last line should be read m.gainMP(-half) and not gainHp...
Just change the H for a M and trigger it at the start of battle as you did.
 

DarkSeraph

Villager
Member
Joined
Oct 25, 2019
Messages
12
Reaction score
0
First Language
english
Primarily Uses
RMMV
Sorry, it seem I made a typo. The last line should be read m.gainMP(-half) and not gainHp...
Just change the H for a M and trigger it at the start of battle as you did.
Oh it worked! Sa-weet! thank you!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,243
Members
137,609
Latest member
shododdydoddy
Top