Ghostrikz

Warper
Member
Joined
May 10, 2017
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I was wondering how to make it so a skill in battle has a delayed effect after x amount of turns. I want to give my party a huge buff and then after 2 turns (which is how long the buffs will last) my entire party loses 50% of their hp. Is there anyway to do this or am I just overreaching?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,295
Reaction score
8,743
First Language
German
Primarily Uses
RMMV
there are several ways to do this, but the easy ways will require a plugin.

Without a plugin you would have to use the troop events to check for skill effects and create a second state after the delay.

I remember an Ace-script for follow-up states (where the next state automatically is activated when the first one wears off), but I don't know if that has been ported to MV yet.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,158
Reaction score
10,730
First Language
Czech
Primarily Uses
RMMV
Yanfly's buffs and states core and passive states plugins (Lunatic mode) are a way to go. She even made one tips and tricks video about delayed effects if I remember correctly.
But generally you want to create a variable that, with Custom regeneration effect, increases by one, followed by the condition that if this variable is equal to some value, it will subtract 50% of user's mhp.
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
712
Reaction score
231
First Language
English
Primarily Uses
Use YEP_Buff_And_States core to do this:
<Custom Remove Effect>
for(i=0; i < $gameParty.size (); i++){
var hpId = $gameParty.members().hp * 0.5
$gameParty.members().gainHp(-hpId)
}
</Custom Remove Effect>
Now the code above makes it where everyone in the party looses 50% of their current HP. So let's say an actor in the party has 100/1000 HP (eg they have 100 out of 1000 HP) then they lose 50 HP and then have 50/1000 HP.
If you want it where they losed half of the max hp, ie an actor with 100/1000 HP would lose 500 HP (as 1000/2 is 500)
Then change
"var hpId = $gameParty.members().hp * 0.5"

to this


"var hpId = $gameParty.members().mhp * 0.5"

This code should be put on a state that adds the buff you want.
 

Ghostrikz

Warper
Member
Joined
May 10, 2017
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I ended up figuring it out with a little help from some of these posts. Ended up using Yanfly's buffs and states core, and passive states plugins. It ended up being really simple.
Thank you guys so much for your response, I really appreciate it.
 

Latest Threads

Latest Posts

Latest Profile Posts

Custom sleep sequence done! :kaopride:
fuY8hyg.gif
The other day I posted a merchant airship tileset and said it was overflow from my Advent Calendar. @Avery said something like "that's one way to flex!" Well, this morning I woke up and realized THAT I MISCOUNTED AND AM SHORT BY ONE DAY. My face and palm are now perfectly fused together.
Shin Megami Tensei V is really fun... and the music is sooo good.
*Saw a video of myself*
*Opens google*
*Search "How to delete my personality"*
Me: "I should make a quick prototype of my system to test early"
Also me: "Eh, drawing the character is more fun than actually making the game"
FFhEfyfUcAMOLjF

Forum statistics

Threads
117,101
Messages
1,104,592
Members
153,120
Latest member
Yam22
Top