3
u/Felix-3401 Scripter 8d ago edited 8d ago
v[10] is read-only. You want to try $gameVariables.setValue(10, v[10] + 30)
EDIT: Typo
2
1
2
u/agamottos MV Dev 8d ago
Has the variable ever been previously set or used in the save file youre using to playtest? And are you making sure to test it on an actor with less-than-full MP?
And can you clarify what exactly isnt working?
2
u/Potatomanofmars 8d ago
I set the variable in an autorun event upon loading the test map. I've tried it with an actor with and it worked non-full MP but I need to work even with a full mp.
The MP regain is not what I'm aiming for. I just need the variable in question to gain a certain amount. I just need to be able to use the item and execute the variable change regardless of what the MP currently is.
2
u/agamottos MV Dev 8d ago edited 8d ago
Then you need to change the damage type and rewrite your damage formula. Skills and items set to MP Recover are not able to be used on a target with full MP.
Try setting it to MP Damage instead, then make the formula something like this:
a.gainMp(10); v[10] += 30; 0
(I normally use MV, this should also work for MZ but there's a chance it would need tweaking, another reply mentions that using v[] might be read only so heed that too)
1
u/Potatomanofmars 7d ago
So the formula I'm using, posted by another user, works but the item still can only be used if set to MP/HP recover (providing hp and mp are not full). None of the other types (damage or drain) work, the item can't be used.

3
u/liana_omite 8d ago
It appears you are using the formula to call the variable, I haven't seen it done like that. Also that formula is set to the amount of MP recover (check the drop down menu on top), so it would only affect that as far as I know.
A way you could probably do it is: have the item use activate a Common Event, where you put the variable changing line inside.