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,968
Reaction score
560
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,968
Reaction score
560
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,968
Reaction score
560
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,968
Reaction score
560
First Language
English
Primarily Uses
N/A
See my edit in my last post
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,968
Reaction score
560
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)
 

Latest Threads

Latest Posts

Latest Profile Posts

just hopped into project recruitment... hoping to maybe find some artists to help with parallax maps and whatnot. I could do them myself, but I'm not really good at it so I'd prefer to stick to my strengths which is character art and SOME UI elements.
PRODUCTIVE DAY! I think I FINALLY completed all the items for part 1 of Fallen Feather, that includes the animations, the stats, the pricing, etc. for weapons, armors, key and consumables! all i need to be 100% done is write a few more descriptions (only 10 left out of the 40+ items) and to find some nice pants icons (dont ask lol).
Kinda hate it everytime reinstall rpg maker because the program refuse to testplay
For every amazing step of the way I make, I find myself in a moment where I feel really stupid for not knowing something. I probably shouldn't though, but still, it sometimes feels more obvious than perhaps it is
Just spent $174 on Shining the Holy Ark on the Saturn. Good lord.

Forum statistics

Threads
111,097
Messages
1,058,244
Members
144,300
Latest member
Cosmosyn
Top