Make a common event use a random chance -- help!

Hello all. I want to make this common event use a 1/4 chance to decide whether to activate. I have used this (image 1) to roll for a random chance. However, the full event (image 2) always returns the else. I suspect that the random trigger is causing the issue, but i have no idea how to go about fixing it.
Yes my example is from Balatro. It will not be this way in the final product, but I believe it makes what I want to be able to do more understandable.
1735973018045.png
1735973039132.png
I guess you have a reason to roll the value separately from the event that checks the value? Usually you'd roll the value just before you check it: all in one event.

Regarding your screenshots, I suggest replacing the branch in your Show Text event with a single test message, e.g.

◆Text:None, None, Window, Bottom : :Result = \v[1]
This should show the value of the variable, so you can tell more precisely what is happening. E.g.
  • If it's the same value every time (especially if it's not in the range 1~4) then check out Tools -> Event Searcher for that variable to see if another event is interfering.
    • Alternatively, ensure you're checking the correct variable: ID 1, per your first screenshot.

  • If it all looks OK except the only values are 2~4, then keep testing a bit longer. Randomness can sometimes play tricks like that.
loop in a parallel is a bad idea, you can do this best on boot than on a
common event.

alternative you set a selfswitch to randomize a number, depending how many
you use it, but on boot is cleaner, as loop and parallel can lag a lot as parallel
already loop 60x a second.
I guess you have a reason to roll the value separately from the event that checks the value? Usually you'd roll the value just before you check it: all in one event.

Regarding your screenshots, I suggest replacing the branch in your Show Text event with a single test message, e.g.

◆Text:None, None, Window, Bottom
: :Result = \v[1]

This should show the value of the variable, so you can tell more precisely what is happening. E.g.
  • If it's the same value every time (especially if it's not in the range 1~4) then check out Tools -> Event Searcher for that variable to see if another event is interfering.
    • Alternatively, ensure you're checking the correct variable: ID 1, per your first screenshot.

  • If it all looks OK except the only values are 2~4, then keep testing a bit longer. Randomness can sometimes play tricks like that.
Rolling the chance in the event itself was a great idea. No idea why I didn't do that before, and putting the result in the dialogue was also helpful.
It seems to work now, but even when applying the state, it visually shows as a "miss", and says that the effect didn't do anything. It properly applies, but is visually annoying. I'd also like to make the dialogue play before the item gives buffs or not if possible, but I've heard that's only doable with plugins.
People didn't probably realize that you wanted that to happen in battle. Parallel events don't run in battle, so your common event wasn't doing anything. If you don't want it to say "there was no effect" I think you can make the skill have an effect where you add an "empty state" with nothing on the state (in addition to your common event). Change it to certain hit as well.
People didn't probably realize that you wanted that to happen in battle. Parallel events don't run in battle, so your common event wasn't doing anything. If you don't want it to say "there was no effect" I think you can make the skill have an effect where you add an "empty state" with nothing on the state (in addition to your common event). Change it to certain hit as well.
Worked perfectly. Thanks everyone!

Original thread: https://forums.rpgmakerweb.com/threads/make-a-common-event-use-a-random-chance-help.174407/