[Solved] Check if variable is equal to variable not working?

This could be a possible bug, but I'd like to see if I'm actually doing anything wrong first, given this works in Ace as it should.


Basically, you speak to the soldier.


This brings up a common event which checks his faction.


Based on this faction, some dialogue is brought up. (this is separated for easy modification later, to give different results based on rep, etc)


The dialogue that is brought up can then be common or milestone-based. Alternatively, it could just skip all of this and show the person's regular dialogue.


Expected end result example:

Spoiler
Spoiler





If army -> dialogue 1 -> well, hello


or


if army -> dialogue 2 -> well, hello


or


if army -> well, hello





However, what is actually happening is that the faction is not actually verified. Instead, MV seems to do something really rather odd, resulting in both the mercs AND the army being rolled for their checks TWICE EACH. 


Putting the "if army, do this, else, if merc, do this" in the faction dialogue base common event prevents this loop, but inexplicably. It shouldn't have to be in an "if/else". The common event should only be running that specific "call" to the dialogue, if the variable is equal to the variable being checked, otherwise, to skip it.


Basically, the "faction check" and faction dialogue base common events are broken, meaning that "if NPC's Faction = army" variable is never verified, unless an if else statement is used.


Imgur is broken, so I've the images instead. I'll replace them once imgur uploading works again.


Events in order of sequence:


[images removed]


And here's the console output FROM THE SAME EVENT, ACTIVATED ONCE with some testing if you are so inclined: (Undefined:1 is probably not relevant here, someone tried to help me with this, found the same issue on their end, and sent me the debug and that bit just went a bit weird when I pasted it into my project but in general, it was just meant to simply print the string in question)


[console output removed]
What exactly are your "British Army" or "Mercenaries"?


If you're trying to use a script option to store a string, they're formatted wrong and can't work that way.


If those are names for other variables, we need to see where you defined them.


Because your problems are most likely centered on the fact that those conditional checks and control commands don't work as you believe them to work.
First image, the Soldier event. That event sets the value of the variable in question to Army or Mercenaries. In this example, he is of course a Soldier. It is this variable that is being checked in the common event images in the spoiler.


EDIT: Excuse me while I go and facedesk. Solved it. Solution later, when I'm not so embarrassed 😛


Basically I was trying to set variable 1 = variable 2 but of course, this actually sets the value of variable 1 to the value of variable 2, which of course was "0"... >_>;


The fix was to assign every "faction" in question a number at the very start, eg variable 2 (army) would become 0, variable 3 (mercs) would become 1, etc

Original thread: https://forums.rpgmakerweb.com/threads/solved-check-if-variable-is-equal-to-variable-not-working.56118/