MV How can 1 plugin read values from another plugin

A while back, I asked how I could make var values permanent, so I could use it over and over in script calls.

Spoiler: How I did that
In plugin:
JavaScript:
Object.defineProperties(window.JDN, {
  picId:    { get: function() { return $gameVariables.value(1); } },
  arrX:     { get: function() { return [0,48,48,48,96,96,96,144,144,144]; } },
  arrY:     { get: function() { return [0,48,96,144,48,96,144,48,96,144]; } },
});

In project script call:
JavaScript:
const { picId, arrX , arrY } = JDN;
$gameScreen.movePicture(picId, 1, arrX[picId], arrY[picId], 100, 100, 255, 0, frames);

Since then I got a lot a lot done and learned quite a bit more about how to make plugins. One thing I can't seem to figure out...

How can I read info like the example above, but instead of reading it in a script call, I want to use them in formal's of a second plugin.

I also need to read out the params set by the user. So when I work in the second plugin, I can use the params as they were set in the first plugin.

Can anyone help me out with this, please?
It helps to not frame it as "values from another plugin", because what that plugin does is define and store data into some variables. It helps to know exactly where your data is stored.

Based on what you shared, it looks like that data you're trying to fetch are getters defined for the JDN object. Since it's assigned under the window object, you could literally just reference them directly like this:
Code:
var picId = JDN.picId
$gameScreen.movePicture(picId, 1, JDN.arrX[picId], JDN.arrY[picId], 100, 100, 255, 0, frames);
EDIT: I haven't tested this and I don't have the plugin you're using. Let me know if this works
It helps to not frame it as "values from another plugin", because what that plugin does is define and store data into some variables. It helps to know exactly where your data is stored.

Based on what you shared, it looks like that data you're trying to fetch are getters defined for the JDN object. Since it's assigned under the window object, you could literally just reference them directly like this:
Code:
var picId = JDN.picId
$gameScreen.movePicture(picId, 1, JDN.arrX[picId], JDN.arrY[picId], 100, 100, 255, 0, frames);
EDIT: I haven't tested this and I don't have the plugin you're using. Let me know if this works
Awesome! Yes this works indeed, for the variables.

You can't have the plugin, because its is not anything yet. 😛 What I showed up here is just an example of how I do it.

I had no clue it would be as easy as just putting JDN. in front of it.

Thanks a lot!

Original thread: https://forums.rpgmakerweb.com/threads/how-can-1-plugin-read-values-from-another-plugin.169819/