How to have auto passive state for 1 turn

Calv

Warper
Member
Joined
Oct 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello. I am new to RPG Maker and the forum, so let me know if anything is wrong.

First, I am using MP like a stamina, so that it will be recovered every turn a little bit, but decreases when skills are used.
I want a player/monster to be in stun state for 1 turn when the MP becomes 0, and recover to the max MP after that turn.

Therefore, I've created 2 states: (I'm using Yanfly's auto-passive state.)
1, the default state where MP regenerates by 10% each turn. (state 11)
2, the stun state where the actor cannot move. (state 12)

But if I set the default state condition as
Code:
<Custom Passive Condition>
if (!user.isStateAffected(12)) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
and stun state condition to <Passive Condition: MP below 1>,
and actor's notetag to <Passive State: 11, 12>,
the actor would never come back to state 11.

What should I do to implement what I want?
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,890
Reaction score
521
First Language
English
Primarily Uses
N/A
It must be reapplying it, cuase MP is less than 1. The charecter Also probably isn't regenerating MP from being stunned. I'll try to come up with a solution unless someone beats me to it
 

Calv

Warper
Member
Joined
Oct 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
It must be reapplying it, cuase MP is less than 1. The charecter Also probably isn't regenerating MP from being stunned. I'll try to come up with a solution unless someone beats me to it
It would be awesome and I'd be very thankful if you could do that...!
I'm stuck because if I don't apply the condition to default (11) like that, it would regenerate the MP while in stun and just escape from stun right away, instead of staying unable to move.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,890
Reaction score
521
First Language
English
Primarily Uses
N/A
Wait. Try fliping true and false. i think "!" means the condition isn't active

If that doesn't work. try making the MP regain a part of the charecters instead of in a state

If that doesn't work, do the code with battle events instead of code making it increase MP and stun the charecter at the same time
 

Calv

Warper
Member
Joined
Oct 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Wait. Try fliping true and false. i think "!" means the condition isn't active

If that doesn't work. try making the MP regain a part of the charecters instead of in a state

If that doesn't work, do the code with battle events instead of code making it increase MP and stun the charecter at the same time
I put in the '!' because I don't want regaining to be active while stun, which will cause the actor to exit from the stun.
Would MP regain inside character also trigger the character to escape the stun state at the same turn?
Also, I would really appreciate if you can explain a little more about the last thing you mentioned :)
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,890
Reaction score
521
First Language
English
Primarily Uses
N/A
I put in the '!' because I don't want regaining to be active while stun
Ironicly that's whats causing your problem then. The stun is removed when MP is above 0 right? And with this set up, MP won't go above 0 thus the charecter will be stunned indefinitly

Edit: You might want to use a progressive state script. So that the exhaustion state can progress into the MP Regain state. There is still work to be done, but it's a start

http://himeworks.com/2015/11/progressive-states-mv/
 

Calv

Warper
Member
Joined
Oct 27, 2019
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ironicly that's whats causing your problem then. The stun is removed when MP is above 0 right? And with this set up, MP won't go above 0 thus the charecter will be stunned indefinitly
Alright. Makes sense.
Now I'm trying a different approach.
If I can have the default state to cause the user to have stun state when mp is 0, and stun state, without relying on passive stuff, would last for the turn i set through the tool itself. Is there some way to do this?

I'm trying something like
Code:
<custom battle effect>
  if (user.mp <= 1) {
    user.addState(12);
  }
</custom battle effect>
to the default state, but it wouldn't work...
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,890
Reaction score
521
First Language
English
Primarily Uses
N/A
See my edit in my last post
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,890
Reaction score
521
First Language
English
Primarily Uses
N/A
After thinking about it, i think you can do this in battle events with it being set to turn 1 + 1. In a conditinal branch, check if MP is below 1. in another, make sure a switch isn't on. If its not, apply the state and turn on the switch. Then, in another set of conditinal branches do the opposite (Like checking if MP is above 0. Fliping the switch off, ect)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I just saw in a manga an interesting mechanic - setting up a stationary teleport beacon that one can go to no matter where one is in a dungeon. I think it'll work with a similar setup to how I did my airship transition.

Ooh what if you could set up multiple beacons and choose from a list of the beacons you set up?

Hmm...
Actor2_1 added!

Is the running performance of MZ output to Android platform smoother than MV output?
FINALLY GOT ALL 120 STARS IN SUPER MARIO 64!!!

Ok i got the model New and I will develop a little more, I think my SV is not beautiful yet.

Forum statistics

Threads
103,251
Messages
998,359
Members
134,747
Latest member
DanMillerPlays
Top