MV Help with setting variables through states

Hi. I have been pulling my hair out with plugins that are supposed to add more parameters for actors, so I gave up and tried to use variables in conjunction with yanfly buff states core, but I've run into an issue. This is supposed to check if the user is actor 1, and it increases/decreases a variable accordingly, otherwise change the other variable. The issue is that is does Nothing

<Custom Apply Effect>

if (user.actorId() == 1) {

$gameVariables.setvalue(21, $gameVariables.value(21) + 1);

} else {

$gameVariables.setvalue(26, $gameVariables.value(26) + 1);

}

</Custom Apply Effect>



<Custom Remove Effect>

if (user.actorId() == 1) {

$gameVariables.setvalue(21, $gameVariables.value(21) - 1)

} else {

$gameVariables.setvalue(26, $gameVariables.value(26) - 1)

}

</Custom Remove Effect>

Anyone have any advice to get this working? (Or have any better solutions to giving actors more parameters)
its setValue, not setvalue
the v is uppercase
wow it was that simple

I ran into another issue, though; when it goes on actor 1, it increases and decreases the variable accordingly, but on actor 2, it does absolutely nothing
Anyone have any advice to get this working? (Or have any better solutions to giving actors more parameters)
@Robro33 pointed out the syntax error that was preventing your code from working.

My better solution would be...to get help using the actual solutions.

There are entire plugins designed to do this in a simple and user-friendly way. You say you've tried them but can't get them to work so you're trying this more complicated roundabout way.

Did you ever ask for help with whatever was confusing you with the actual custom parameter plugins? That should be a much easier way to go about it - and, based on the above, it's entirely possible you just missed one detail carelessly and they could work for you perfectly well.

Just my two cents.

I ran into another issue, though; when it goes on actor 1, it increases and decreases the variable accordingly, but on actor 2, it does absolutely nothing
That's not possible. You may show your corrected code for more help.
First off; I forgot to say that I applied the solution and it worked, my fault
Second off; that's a great idea and I should do that, so I'll set up the plugins again and ask for help with that. Thanks lol

though the thing preventing me from asking for help with the plugins is that two of them don't work in the damage formulas even when I set them up properly which makes me feel like there has to be some sort of incompatibility, and the third one crashes when I open a menu, so I feel like that one won't work at all. I guess I'm just not sure what to even show to ask for help?
two of them don't work in the damage formulas even when I set them up properly which makes me feel like there has to be some sort of incompatibility, and the third one crashes when I open a menu, so I feel like that one won't work at all. I guess I'm just not sure what to even show to ask for help?
All of the things you just said.

The names of the plugins and links to their download.

Show how you have the parameters set up.

Show how you're using it in a damage formula.

Show the crash (press F8 and go to the Console tab for the full error trace).

Y'know...the information you have 😉
right right, sorry I'm new to all of this <🙂 thank you for the advice

Original thread: https://forums.rpgmakerweb.com/threads/help-with-setting-variables-through-states.167580/