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,824
Reaction score
2,162
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,824
Reaction score
2,162
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,824
Reaction score
2,162
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,824
Reaction score
2,162
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 Posts

Latest Profile Posts

**** it. I give up.
mwevzCp.png

Finally settled with a mapping style.
Hey there everyone! My laptop broke unexpectedly recently and I lost some files I hadn't backed up . . .
Pro tip to anyone looking for advice based on existing game mechanics: a lot of people reading your request won't have played the games you're talking about. Always assume your readers won't have, and explain what the mechanic actually *does* rather than just name-dropping the game. I see this a lot.
 …So I was looking at a question someone had asked and did some related experimentation. Apparently the Jump… movement route command works like the ultimate through. Including letting you move around outside the confines of the map entirely. o_O
Jump.png

Forum statistics

Threads
115,849
Messages
1,093,410
Members
151,051
Latest member
jy12138
Top