MV Array in formula (Yanfly_Base Parameter Control)

Hello everyone,

I’m using rpg mv and have some question with Yanfly's Base Parameter Control plugin.

I’m trying to access an array value from a game variable in the formula settings. While I can successfully use $gameVariables.value(2), I am unable to use $gameVariables.value(1)[0] for accessing specific array indices.

1729368910917.png


I defined variable 1 as an array and then set its values. but It returned only values excluding $gameVariables.value(1)[0]. Using $gameVariables.value(2) works properly. Additionally, I tested that the array is being recognized correctly in the default rpgmv skill damage formula.

Does anyone know a solution to this problem? I would appreciate any help.



I'm not good at english so I got help from translator. and I am posting on the forum for the first time. I apologize if I made any mistakes.

thank you.
if english isn't your first language, change first language to your own as that
says your first language is english.

as for the formula, I think it isn't made on boot or new game directly, so it doesn't
work.

it probably need a modification in order to make it read correctly as most empty
array starts with null/undefined.

so how is your starting array initilized?
i dont know what relevance variable 2 is supposed to have when youre looking at variable 1. is variable 2 another array that you can grab values out properly?

if youre putting all the needed data into variable 1, have you confirmed that its correct when you test it? check the values within the console to see if it still is an array when you need it.

what value are you getting from value(1)[0]? 0? undefined?
what is it doing to the stats? zeroing it out? making it NaN?
I'm not good at english
Then why did you fill in
1729381041738.png


I defined variable 1 as an array and then set its values.
Where? How? Show us.

but It returned only values excluding $gameVariables.value(1)[0].
What does that mean? Are you saying $gameVariables.value(1)[1] works?

Using $gameVariables.value(2) works properly.
That has nothing to do with variable 1.

Additionally, I tested that the array is being recognized correctly in the default rpgmv skill damage formula.
Again, how? Show us.

as for the formula, I think it isn't made on boot or new game directly, so it doesn't
work.
If you mean that it isn't working because game variables don't exist when the game is starting up, that's a good thought but it shouldn't matter.

The code in those plugin parameters isn't getting evaluated until during the game, when it needs to look at what an actor's parameters are. In fact, Yanfly even provides a v reference to variables, just like the damage formula does.

So the OP could simply be doing v[1][0] or whatever.
First of all, I apologize for not providing enough explanation earlier.

Initially, I set variable 1 to [0, 0, 0] and variable 2 to 0 (since using arrays in the YEP_Base Parameter Control plugin caused an error when defining arrays after starting new game, I created a new plugin to add a script for setting variables). At the point when I was testing how to modify those variables, I wrote the post.

After reading your message and retesting with a different method, I found that the issue was resolved. It turns out I misunderstood because I started with the variables set to 0. When modifying through events or scripts, the array works properly.

thank you everyone.
(i wrote it with translator)

Original thread: https://forums.rpgmakerweb.com/threads/array-in-formula-yanfly_base-parameter-control.172697/