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,757
Reaction score
2,107
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,757
Reaction score
2,107
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,757
Reaction score
2,107
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,757
Reaction score
2,107
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

Zombie status is now complete. I didn't have to do much in the way of changing how healing is applied to undead targets, was just a simple 3 line code. I thought I had to overhaul Game_Action lol. Everything else was doable by events. So.. Zombie: You turn undead. Your element changes to darkness. You're weak to light, you're strong to physical attacks and healing hurts you and revival items will kill you.
My Overworld might be a mix of inspiration from 2D Final Fantasy games, Breath of Fire, Battlechasers: Nightwar, Super Mario World, and Pillars of Eternity. If I can make it more in-depth than just walking from point A to point B, that might do a lot for the gameplay experience. Hmm...
Terribly depressed. Worst birthday I've had in years, no motivation to work on anything. Still no income. At least I've got my computer running again.
Doing RPG Maker News for 19th September 2021

Forum statistics

Threads
115,213
Messages
1,088,099
Members
149,794
Latest member
relache
Top