Event variable condition only equal, no greater?

Hello, i would like to know if there is any way to modify the variable condition in the events so that instead of it being greater than or equal, it is just equal?
1698559566392.png

Uhm... By using the equal sign?
If you mean event page conditions, set a page where the value is >= 8 for example, and add another page that does nothing with condition value >= 9

The page you want will only be triggered when the variable equals 8.
You either go with Schlangan's solution, or, when things become more complicated, you would define a new Switch for this Event which is ON only when your requirements are met.
There are of course some workarounds. You can create an extra dummy page just to deactivate the page before it - so have page 1 with no conditions, page 2 set to >=8 and page 3 set to >=9, as mentioned by @Schlangan . This will cause page 2 to only trigger when the variable is set to 8, and either page 1 or 3 to trigger otherwise. To make your life easier, you can even add Run Nearby Event and use the plugin command RunEvent this 1 on the 3rd page - this will cause page 1 to always run when the variable is not 8, saving you from having to copy over all of its contents every time you change them.

You could also check the condition in a conditional branch instead of page conditions, which might sometimes be enough.

But, to actually answer the question about modifying how it works, you'd change Game_Event.prototype.meetsConditions. I don't know how specifically you'd like it to work, but if you'd like to use an event notetag <VarEqual> to make the check only work for equal values, save this as a plugin:

JavaScript:
void ((alias) => {
    Game_Event.prototype.meetsConditions = function (page) {
        var c = page.conditions;
        if(c.variableValid && this.event().meta["VarEqual"] && $gameVariables.value(c.variableId) !== c.variableValue) return false;
        else return alias.call(this, page);
    }
})(Game_Event.prototype.meetsConditions);
I would suggest >= instead of = though, mainly if there is a lag, it can bypass it unless you
just add 1 and no automatic variable increase the variable over time.

if a number = or >= than 8, it will be 8 or higher, but you can also set a return value,
if it somehow become 9, 10 or higher, the value become 8 as failsafe.

but that depends on the mechanic you use though, but all solutions does work, it depends
on the situation you are using it for.

@Mac15001900 what exactly does your code do?
a comment tag "VarEqual 5 = x" to check the variable value to be equal? or did I misunderstand that part?

also, your link "run nearby Event" doesn't work (I think a small issue on the last part [\URL] that fails
to load the page.
what exactly does your code do?
a comment tag "VarEqual 5 = x" to check the variable value to be equal? or did I misunderstand that part?
It overrides the way the variable check works if the tag is present. You would only put "<VarEqual>" into the event notetags, and set the variable condition as normal. Since we can't modify the editor, it will still show the ≥ symbol, but in-game only enable the page if the value is equal to the one specified, not when it's greater.
I've also fixed the link, looks like I pasted in the wrong thing. Thanks for pointing that out.
I see, that can in handy if you check equal only, as >= does the same thing on 1 way, but if you want to fail
it when over that, I can find a cool mechanic for it ^^
First of all, thank you all for your help. I had considered the options they mentioned @Schlangan and @Aerosys but since it is something that I need to use on a recurring basis I was looking for a simpler solution.
The solution of @Mac15001900 worked perfectly, thank you very much!

I needed this because I am setting up a point and click action system, so I have the "P&C" variable at 0. When the player touches an event it is set to 1 and 3 options are displayed: look, touch and talk. But when another event occurs, the variable is set to 2 and the same 3 options appear for that event. That's why I needed it to be like this, so that when I activate the event at 2, it only activates that one and not 1. And since it is something that I am going to use a lot, I wanted to build the system based on the same variable.
Thank you all very much for the answers and help!
There are of course some workarounds. You can create an extra dummy page just to deactivate the page before it - so have page 1 with no conditions, page 2 set to >=8 and page 3 set to >=9, as mentioned by @Schlangan . This will cause page 2 to only trigger when the variable is set to 8, and either page 1 or 3 to trigger otherwise. To make your life easier, you can even add Run Nearby Event and use the plugin command RunEvent this 1 on the 3rd page - this will cause page 1 to always run when the variable is not 8, saving you from having to copy over all of its contents every time you change them.

You could also check the condition in a conditional branch instead of page conditions, which might sometimes be enough.

But, to actually answer the question about modifying how it works, you'd change Game_Event.prototype.meetsConditions. I don't know how specifically you'd like it to work, but if you'd like to use an event notetag <VarEqual> to make the check only work for equal values, save this as a plugin:

JavaScript:
void ((alias) => {
    Game_Event.prototype.meetsConditions = function (page) {
        var c = page.conditions;
        if(c.variableValid && this.event().meta["VarEqual"] && $gameVariables.value(c.variableId) !== c.variableValue) return false;
        else return alias.call(this, page);
    }
})(Game_Event.prototype.meetsConditions);
Is this snippet of JavaScript intended to be a plugin, or to be used in the event? Please instruct. Thanks.
Is this snippet of JavaScript intended to be a plugin, or to be used in the event? Please instruct. Thanks.
From the text you quoted:
to make the check only work for equal values, save this as a plugin:

Original thread: https://forums.rpgmakerweb.com/threads/event-variable-condition-only-equal-no-greater.162479/