It's me again with more questions. I can not for the life of me figure out why this formula doesn't work:
(&gameSwitches.setValue(11) === true) ; (a.gainMp(3))
Most of what ThreeSixNine said is spot on. One thing to emphasize, is "===" is always conditional. It's asking "is this equal?" (incidentally, it's also a strict equality which in RPG Maker is rarely necessary. You'll get the same results from just "=="). Any time you want to
make something equal to something else, it's only one "=". So aside from it being the wrong syntax for the setValue() method, that's a fundamental error to keep in mind.
Also, they're not
hurting anything, but I'd encourage you to get rid of all of the extra parentheses in your code. They can make it more confusing to read in situations where you actually do need them for function calls or proper grouping.
Try:...
I think there's a few issues with the way you have it now...
This is all perfect.
I'm making the assumption that you're trying to turn on switch 11 when the skill is used. If you simply want to check it switch 11 is turned on, you'll need to change it to:
$gameSwitches.value(11) === true;
This is leaving a bit out, for my preferences
:wink: That's a valid conditional, but it would have to be inside of an if statement, or part of a ternary operation, and the rest of the formula would need to be rewritten to accommodate it. So
if you were actually trying to change the formula based on whether the switch was true or false, you'd have to rewrite much more than just this.
I know that
you know this, ThreeSixNine, but Nox is clearly at a beginning level.
The other question I have is that I know how to set variables in a damage formula but I don't know how to increase them. I'm trying to create a skill that does x times the damage of a variable and the variable is increased every time the skill is used.
Also, to increase the variable try:
$gameVariables.setValue($gameVariables.value(ID), $gameVariables.value(ID) + 1);
This is also correct - however, the damage formula box makes this even easier, because you can use the v[x] shorthand. So you'd just do
v[ID]++ to increase it by one. Therefore, the formula for your skill that does the damage then increases the variable would be
where ID is the ID of the variable and x is how much you want to multiply it by.