State effects on walking.

sock

Veteran
Veteran
Joined
Aug 9, 2013
Messages
53
Reaction score
4
First Language
English
Primarily Uses
N/A
Hey there, I've been trying to make a game mechanic where after being inflicted by a 'state', your MP slowly decreases by how far you walk (on map). And then, once you MP reaches 0 another state is applied.  

I already know I can set my state, so its feature reads Ex Parameter MRG -10%, so I'm currently losing 10 MP per 16 steps.
 

Although I can't seem to figure out how to make a new state inflict the character once my MP is at 0  (which is not during a battle) I'm a lil lost.

I can't say there is much that I've tried doing, because the options I'm aware of would not work. Is there something I'm missing, or can't see?

Also, what constitutes how far you can walk before MP is actually visibly decreased. For instance, I have tried changing it to MRG -1% but it seems like I need to walk forever before it actually starts going down, alternatively I tried setting it to 100% but it still took 17 steps until I lost all my MP. :/

Any advice on any of the above? Thank you! :D
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
For something simple, I would have a parallel process event (a common event, if this can happen on any map) that's triggered by a switch. When the first state is inflicted, turn the switch on. Then have it put the player's MP into a variable and check if the variable is 0 or less. If it is, remove the first state, add the second state, and turn the switch off.


Make sure to add a Wait 5 Frames or something like that so it's coming up for air and not causing lag.
 

sock

Veteran
Veteran
Joined
Aug 9, 2013
Messages
53
Reaction score
4
First Language
English
Primarily Uses
N/A
Ah, I knew it would be something like this. Thanks for the help Shaz.

Now time to go back to Solitary until my next barricade brings me back.

 
 

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
Make sure to add a Wait 5 Frames or something like that so it's coming up for air and not causing lag.
Is adding a wait command for a few frames going to help reducing lag when use a parallel common event on a map?EDITED: Some typos.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
Is adding a wait command for a few frames going to help reducing lag when use a parrarel common event on a map?
Always - parallel processes are usually called sixty times per second, and the wait command makes the process skip several of those calls. With a wait(5) for example the process will only be called twelve times per second instead of sixty times.
 

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
Always - parallel processes are usually called sixty times per second, and the wait command makes the process skip several of those calls. With a wait(5) for example the process will only be called twelve times per second instead of sixty times.
OMG!! 60 times per second!!? That's really insane!! I must try adding a wait command and see the difference!! Thanks Andar!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Best way to see the difference is to have a number of events set to parallel process all with some command(s) and not having any wait. Then try walking around. Then do it again with a wait as part of each parallel process.


Just make sure it's going to be executed every iteration - not inside a conditional branch or something that may not be run.
 

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
Best way to see the difference is to have a number of events set to parallel process all with some command(s) and not having any wait. Then try walking around. Then do it again with a wait as part of each parallel process.

Just make sure it's going to be executed every iteration - not inside a conditional branch or something that may not be run.
I once created a common event running on parallel process on a map to check if the player is in specific region ids, then something would happen. Surely I didn't add wait command and when I tested the event, it was laggy like hell.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Also, what constitutes how far you can walk before MP is actually visibly decreased. For instance, I have tried changing it to MRG -1% but it seems like I need to walk forever before it actually starts going down, alternatively I tried setting it to 100% but it still took 17 steps until I lost all my MP. :/
 
MRG, HRG and TRG doesn't effect per step, it takes a few steps before they are even checked which is why  

alternatively I tried setting it to 100% but it still took 17 steps until I lost all my MP.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top