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,986
Reaction score
2,304
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,986
Reaction score
2,304
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,986
Reaction score
2,304
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,986
Reaction score
2,304
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

aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v
Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)

Forum statistics

Threads
117,281
Messages
1,106,082
Members
153,453
Latest member
kuzmitchoww
Top