State that when wears off play a skill

Do you know a code that can do my request ?

  • Yes i have

    Votes: 1 100.0%
  • No i don't

    Votes: 0 0.0%

  • Total voters
    1

Grumphlu

Villager
Member
Joined
Mar 25, 2015
Messages
28
Reaction score
6
First Language
Français
Primarily Uses
Hi ! i am using almost all plugins of Yanfly (Battle Core, Buff and States etc....)
And i want to do a state that when it wears off will do a skill.

For exemple this state can be put on a foe and will stay for 3 turns then damage him when the state wears off.

Is someone know a code that can do this ? It will help me a lot.

Thanks in advance.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,655
Reaction score
8,080
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

artoni

Writer, Editor
Veteran
Joined
Jan 18, 2014
Messages
115
Reaction score
162
First Language
English
Primarily Uses
RMMV
Yep, easily done with Buff/States. Make sure you have the state set to last 3 turns, or however many you plan.

<Custom Leave Effect>
// Get the damage skill.
var skill = {{INSERT SKILL NUMBER HERE}};
// Get the 'self' index.
var target = 0;
// Queue the forced action.
BattleManager.queueForceAction(user, skill, target);
</Custom Leave Effect

If that doesn't work let me know, I'll play around with it for you.
 

Grumphlu

Villager
Member
Joined
Mar 25, 2015
Messages
28
Reaction score
6
First Language
Français
Primarily Uses
Yep, easily done with Buff/States. Make sure you have the state set to last 3 turns, or however many you plan.

<Custom Leave Effect>
// Get the damage skill.
var skill = {{INSERT SKILL NUMBER HERE}};
// Get the 'self' index.
var target = 0;
// Queue the forced action.
BattleManager.queueForceAction(user, skill, target);
</Custom Leave Effect

If that doesn't work let me know, I'll play around with it for you.
Hi artoni, thanks for help ! Sorry for the place of the post, it's my first one here.

It work good but the problem now is the damages. I did a Trap, it wears off after 3 Turns but then when the skill plays there is no damage.
My formula is a.mat * 4 - b.mdf * 2. I don't know if its a problem of formula here or that the code you give me just loose who is "a" and who is "b"
I am terrible with coding, i am learning by myself ^^

In this spell i use a formule of Yanfly to make the spell having a critical damage if the ennemy is on Fire.
So basicaly my trap will deal damage after 3 turns and can be critical if the foe is on Fire.

Thanks for your help
 

artoni

Writer, Editor
Veteran
Joined
Jan 18, 2014
Messages
115
Reaction score
162
First Language
English
Primarily Uses
RMMV
Well, for one, I forgot to add the last > on </Custom Leave Effect> - whups.

You might want to consider creating a new skill with ActSeqPack as well; below is a skill I have that does damage to the person who uses it (for a battle cutscene).

<Setup Action>
display action
perform start
motion chant: user
wait: 20
motion spell: user
wait: 20
</Setup Action>

<Target Action>
animation 58: user
WAIT: 20
action effect: user
motion damage: user
WAIT: 20
</Target action>

<Finish Action>
clear battle log
perform finish
</Finish Action>

Alternatively, see if the scope "The User" works?
 

Grumphlu

Villager
Member
Joined
Mar 25, 2015
Messages
28
Reaction score
6
First Language
Français
Primarily Uses
Mhh, didn't change anything but i figure it out by myself

I put this code :

<Custom Leave Effect>
target.startAnimation(67)
user.gainHp(-1 * origin.mat * 4 + target.mdf *2)
target.startDamagePopup()
target.addState(16)
</Custom Leave Effect>

Now eveything is fine the foe takes damages, then he get on fire. The only thing now that change is that the spell is not aymore a Fire element
and it will not deal critical if the foe is already on Fire. But i don't know if it's important. So let's say that my problem is solved ^^

Thank you a lot for your attention, it helped me to understand more about the codes and how it works ;)
 

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

Latest Threads

Latest Profile Posts

Check out SpokenWord- my text-to-speech plugin for RPG Maker MV!
just watched spacex launch. was awesome.
Jumping and gravitation 0.1 build - RPG Maker MV
Currently playing final fantasy 3 on DS. It's an old one but its a classic.

Forum statistics

Threads
97,958
Messages
948,121
Members
129,204
Latest member
Nimhe
Top