MV Does Yanfly's Button common events plugin prevent the "button Pressed" conditional branch?

Hi!

I'm trying to have a common event triggered by the shift button that checks if the button is held down. However, nothing happens when I press shift. I suspect Yanfly's plugin somehow interferes with that. Here's my setup:

The "Nukeequip" switch is the one I'm talking about. It's supposed to trigger the countdown in the first image, but like I said when I press shift nothing happens. I might have screwed up the code royally, I'm bad at coding complex things like that, but I suspect it's the plugin interfering, that's why I'm asking here
Screenshot 2024-07-21 054900.png

Screenshot 2024-07-21 054936.png
Your setup is a little confusing.

What does the first event you show have to do with it? It's not referencing this nukeequip switch at all, so why is it there?

Although, it is written incorrectly - you tell it to Exit Event Processing on the line before you tell it to turn the nukeshift switch off, so that will never happen. I don't see the point of those two lines.

(but, then, I also don't see what the entire event is supposed to achieve. If you press shift, you see an animation then it turns itself off. If you don't press shift, it turns itself off. It seems like a lot of lines just to show one animation)

As far as the second event...like, okay? It's activated by a "shift pressed" switch and we don't see where you're supposed to turn that on. And it checks whether a nukeequip switch is on, and we don't see where you're supposed to turn that on.

Although, again, it's written incorrectly. The first line is a conditional saying "is nukeequip on?" and the second line inside of that is saying "then turn on nukeequip" - that will always be pointless, that command is only happening if the switch is already on.

If you're using Yanfly's Button Common Events, why do you even have your first event that's running parallel and checking for a button to be pressed? That's the whole point of the plugin, to not have to do that.
The first picture event is a countdown that's supposed to be happening only while the shift is being held. I put a conditional branch to check for nuke equip before the whole countdown code.

I also switched positions of the "Exit Event Processing" and nukeshift off switch.

My bad, it is an older screenshot before I changed some things. This "effect use" event is not triggered by the shift pressed switch, but rather by Yanfly's plugin. I set the plugin to trigger this event when shift is pressed. The nuke equip switch is turned on when you use the item, the item "Nuke" has en effect of "common event", which triggers an event that contains the nuke equip switch (I'm making a Yume Nikki fangame, these items are the effects you collect)

The second line actually turns on "nukeshift", not "nukeequip", it's supposed to activate the first picture event, which is set to parallel to trigger by that "nukeshift" switch (the countdown which is supposed to happen ONLY while shift is being held

It looks like this now:
Screenshot 2024-07-24 212709.png
Screenshot 2024-07-24 212722.png
The first picture event is a countdown that's supposed to be happening only while the shift is being held.
That's not how that works.

The Button is Pressed Down only does what it says - it returns true if that button is pressed at the specific moment the engine checks. Everything else you put inside that conditional branch will just go - there's nothing in there to make it stop if the player stops holding the button down.

As far as the rest of it, yes - going off of these passages in the plugin instructions:
"If you assign a common event to these keys, the native function of the key will be removed in favor of
the common event you've assigned."

"Once again, if you assign common events to these keys, the common event will removing the binding the key had natively."

would make me understand that assigning that key to a common event means it will no longer be checked for input by the engine in the usual ways, including the Conditional Branch.

It seems to me like you have a lot of over-complication with events activating switches to activate other parallel events and such...I'd strongly suggest you could probably combine a lot of that functionality into one (or at least fewer) events.
Hi!

I was wondering how the Eyeball Bomb's effect of cancelling its activation if the button is let go is achieved. I want to have something similar in my game. I tried a bewildering amount of convoluted setups with countdowns, variables and switches, but nothing seemed to work (either nothing happened at all when the button was pressed or it triggered and went through with my effect's activation, even if the button was no longer being held) , so I want a simple explanation of how to implement something like this. I should note, I'm using Yanfly's Button Common events plugin, so it overrides the engine's default checks, so anything with "Input.isRepeated" or similar scripts won't work. I would look at the game's code myself to figure it out, but I don't know how to open finished games with RPG Maker
You're right, my setup is WAAAY to convoluted. What I'm trying to achieve is basically like the Eyeball Bomb effect from Yume 2kki: it only activates its effect when the button is held down long enough. I'll scrap my setup and I've asked in the support forum how to simply achieve this
I don't get why this question isn't just a post in your existing thread that's already trying to figure out the same issue. It seems like a duplicate topic.

I should note, I'm using Yanfly's Button Common events plugin, so it overrides the engine's default checks, so anything with "Input.isRepeated" or similar scripts won't work.
The answer may be "you can't do both", or "you'd have to modify Yanfly's plugin."

The core engine has an Input.isLongPressed() method to see if a button is being held down - that returns true if the key has been held down for 24 frames, so you can string a few of those together with Waits in between to create break points where your event will stop if the key is released.

I would look at the game's code myself to figure it out, but I don't know how to open finished games with RPG Maker
You're not supposed to - that's the point of deploying games, it encrypts the files so that other people can't just open your game with their own copy of the editor and steal all your work.
Yeah, modifying a plugin is WAAAY beyond my skill level. I think I'll just give up this idea and have no activation cancellation, after all the Eyepalm effect from the original Yume Nikki did not nave an activation cancellation either. It's a shame, because during the development of my game I faced MANY problems, but I managed to solve them all using Google, but this one broke me....

Mods, close all my threads about this issue
You can do this with two common events.

The first common event is triggered by Yanfly's common event button plug in. it adds one to a variable (call it Bomb Timer) and sets a switch (call it Check Bomb Cancel)

The second common event is parallel process, controlled by the Check Bomb Cancel switch. it compares the variable Bomb Timer to a second variable Bomb Timer Copy. If Bomb Timer does not equal Bomb Timer Copy, set Bomb Timer Copy to Bomb Timer. else, set Bomb Timer to 0 and set the switch Check Bomb Cancel OFF. Next, check if Bomb Timer is greater than 60 (this means the user held the button for one second). If the Bomb Timer is greater than 60, do the effect and set Bomb Timer to 0 and set Check Bomb Cancel to OFF.
So just like this then? I did everything you said, yet nothing happens when I hold shift for one second... Did I miss something?
Screenshot 2024-07-25 012608.png
Screenshot 2024-07-25 012616.png
Remove the first if bomb timer =/= bomb timer copy in the check bomb cancel event. And then check if it works. the repeat interval on Input.isRepeated(key) is actually on press, then wait 24 frames, then every 6 frames.
Next, check if Bomb Timer is greater than 60 (this means the user held the button for one second).
How does it mean/know that?
It was intended to add 1 to the counter every frame. 60 frames is one second.

However it didn't quite work due to the repeat timer on Input.isRepeated.

Original thread: https://forums.rpgmakerweb.com/threads/does-yanflys-button-common-events-plugin-prevent-the-button-pressed-conditional-branch.170583/