Do you know a code that can do my request ?

  • Yes i have

    Votes: 0 0.0%
  • No i don't

    Votes: 1 100.0%

  • Total voters
    1

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
Hello,

I'm using plugins of Yanfly (Battle Core, Buff and Sate, Skill Core etc....)

I want to know how i can do a passive state where it react if the user do an evasion.
For exemple, if my character evade from a skill, i want him to win a buff or a state.

Is there a formule for my passive state to react when this happen ? I am just learning about javascript.

I tried to put :

<Custom React Effect>
if user.result().evaded

user.addBuff(6,5);

</Custom React Effect>

But nothing happen ^^

Thanks in advance for answering me, and have a good day !
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,858
Reaction score
2,195
First Language
EN
Primarily Uses
RMMZ
Two mistakes here:
  • "React effect" only applies if the action hits. =P
  • If statements require the condition to be in brackets after the "if". ^_^
Try this instead:
Code:
<Custom Deselect Effect>
if (user.result().evaded) {
  user.addBuff(6, 5);
}
</Custom Deselect Effect>

(Edit: also, polls are optional when you create a thread.)
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
I see, well thank you for the help !
Truely help me to understand better how it works and help me for my project.

Have a good day :)
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
I reply again about my post after some days, i could test well the statut sorry ^^

I change, now it seems that the game reconise that my character is evading but now the buff don't apply.
I don't know if its a problem with " user.addBuff(6, 5); " or that it miss something to show the application of the buff.

I shouldnt had to reply without testing sry ^^
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,858
Reaction score
2,195
First Language
EN
Primarily Uses
RMMZ
Oops, no worries, I should have tested it too! :kaoback:

Yes, user actually refers to the skill user, that's why it wasn't working correctly. :kaoswt: I tested this notetag and it seemed to work as expected:
Code:
<Custom Deselect Effect>
if (target.result().evaded) {
  target.addBuff(6, 5);
}
</Custom Deselect Effect>
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
Weird, for me it doesn't work, the state is here in passive, i put an icon to verify it but it seems that the buff don't apply...
I don't know what is the problem i have almost all plugins of Yanfly (Battle Core, Buff and State, Selection Control, Target Core, Passive State etc...)

My passive state is on priority 0 but even if i put it on 99 doesn't change nothing....
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,858
Reaction score
2,195
First Language
EN
Primarily Uses
RMMZ
That is strange, for me it works the same regardless of if it's a passive state. I put it on Harold, and whenever he evades, he gets an agility buff. :kaoswt:

A couple of things to try:
  • Make sure your Yanfly plugins are up-to-date and in the recommended order, listed here: http://yanfly.moe/yep/
  • Replace the notetag with this (just for testing) and press F8 during play to open the console window to see what code is, or isn't, running:
    Code:
    <Custom Deselect Effect>
    console.log('Custom Deselect Effect');
    if (target.result().evaded) {
      console.log('Add buff!');
      target.addBuff(6, 5);
    }
    </Custom Deselect Effect>
    This should show "Custom Deselect Effect" in the console window when the actor is targetted, and "Add buff!" whenever they evade. :)
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
Ok, i did all updates and now its all work correctly ! my bad... haha

Thanks for your help !
 

Klunky2

Veteran
Veteran
Joined
Jul 2, 2017
Messages
118
Reaction score
4
First Language
german
Primarily Uses
RMMV
Unfortunelately this code doesn't work for me too when I test it. The state doesn't apply. In which notetages do I have to put it? Actor, States anywhere?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,858
Reaction score
2,195
First Language
EN
Primarily Uses
RMMZ
Unfortunelately this code doesn't work for me too when I test it. The state doesn't apply. In which notetages do I have to put it? Actor, States anywhere?
<Custom Deselect Effect> is a notetag for States: it goes in the notebox of a state. :)

Maybe also make sure you have the latest version of Buffs & States Core:
...and check that your Yanfly plugins are in the recommended order:
(You can click+drag to rearrange the order in the Plugin Manager.) Remember to save your project after making changes in the Plugin Manager, otherwise those changes will not be seen in-game. :kaoswt:
 

Latest Threads

Latest Profile Posts

Redesigning characters after such a long time feels great. Makes me excited to work on an old game again.
Phone menu to replace main menu WIP:
It's been that long since I wrote a plugin, it took me 4 attempts to realize it's != rather than #. In a 40-line plugin, 20 of those lines being documentation!
Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead

Forum statistics

Threads
116,086
Messages
1,095,641
Members
151,462
Latest member
julienrg
Top