[MZ]Change parameter value

Hi guys, thanks for helping me every time I needed it.
Once again I come to ask for your help.
I want to change a parameter of a hero, not add or subtract, just change it to a specific value.
I tried using this code, but it didn't work:
$gameActors.actor(1).luk = 1;
can anybody help me?
it can't be done that way.

what you need to do is mathematics:
calculate the difference between the current value and the value you want, then add that difference.

you can't set any actor value like that because the values aren't calculated that way.
Short answer - you have to add a value or use a plugin.

Longer answer - basic parameters like LUK are calculated based on various factors:
  • The actor's class & level;
  • Their equipment - weapon(s) & armor(s);
  • Permanent bonuses - from the Change Parameter command;
  • Parameter Rate traits.
If there are no Parameter Rate traits then you can calculate the difference between the current and target parameter values in a variable, then use a Change Parameter command, e.g.

◆Control Variables:#0030 = 50 ◆Control Variables:#0030 -= Luck of Reid ◆Change Parameter:Reid, Luck + {#0030}
[Edit: ninja'd.]

Original thread: https://forums.rpgmakerweb.com/threads/mz-change-parameter-value.147790/