I started to work on making my own plugin, meant to help me give out random rewards to the player. My intention was making it so that each parameter is a separate rarity with various items assosiated with it. After that an NPC is supposed to trigger a function that would pick a random item from the array and put it in variable (atm it's just for testing)
Here's the code (apologies for weird naming):
And here's the script on NPC
Notihng works as intented. When I try to interact with the npc, no message is displayed. How to fix it?
Here's the code (apologies for weird naming):
JavaScript:
/*:
@plugindesc test
@author alex
@param common
@type item[]
@param rare
@type item[]
@param special
@type item[]
@param epic
@type item[]
@param legendary
@type item[]
*/
////GAMBLING STUFF
var alx_parameters = PluginManager.parameters(idiotsFirstPlugin);
var alx_common = alx_parameters.common
(function random_thing() {
x = JSON.parse(alx_common);
//x = Math.randomInt(alx_orbs.length);
//x = Math.randomInt(alx_orbs.length);
$gameVariables.setValue(83, x[0]);
$gameMessage.add("It's \\v[83].");
})();
JavaScript:
random_thing();
Notihng works as intented. When I try to interact with the npc, no message is displayed. How to fix it?