MZ Reference not defined error being generated by my code.

My code.

var tmp = $gameVariables.value(1) if (tmp = 0) { $gameParty.members()[1].setCharacterImage(Aiden.png,1) $gameParty.members()[1].setFaceImage(Aiden_Warrior_Talk.png,1) $gameParty.members()[1].setBattlerImage(Aiden_Battle.png) } else { $gameParty.members()[1].setCharacterImage(Saoirse_WarWlk.png,1) $gameParty.members()[1].setFaceImage(Saoirse_WarTlk.png,1) $gameParty.members()[1].setBattlerImage(Saoirse_WarBtl.png) }

The problem: For some reason it keeps saying Saoirse_WarWlk.png is not defined. Before you ask, the file does exist.

I've been bashing my head in on this one for quite some time, so I've decided to reach out.

For further context this code is checking if the player has picked a male or female character. This code is in the block of a conditional that is for if the player picks the warrior class.
First thing, your conditional is wrong.
tmp=0 is setting tmp equal to the value 0, which is not a condition. You mean if (tmp==0)

Then, you're sending into all of your functions stuff like Saoirse_WarWlk.png which would be interpreted as the name of a variable. And you do not declare a variable of that name, so yes, that's not defined.

If a function is expecting something like a filename, you need to be passing in a string, so you put it in quotations: setBattlerImage("Saoirse_WarBtl.png");
That did the trick. But you already knew it would.

Thanks for the help.

Original thread: https://forums.rpgmakerweb.com/threads/reference-not-defined-error-being-generated-by-my-code.145179/