Issues with lunatic mode with YEP_Item core and YP_Newparameters.

Here is the picture of the error message I got. I first got the error when trying to modify the amount of an effect of an item. So, I went back to the sample code given with YEP_Item core. And I got the same error. I assume that I have a misunderstanding of how the plugin works.

For Context: Ideally I want to have random variance in a custom parameter that I have tied to the item. Then when I later use it in crafting I can take the ingredient values in the custom parameter and have it influence the properties of the crafted item. So, the three elements I need is setting a property of the item according to a custom random formula. Grabbing properties from ingredients in the formula. And being able to make it modify effects as well as properties such as price. But the important thing is the basic issues. Like the one I have here.

Here is the item I was using for testing:
TestItem.PNG


Here is the error message:
Error with custom code.PNG
Update: I got the source code for the Random function from googles V8 engine. But now I have a really weird issue. Although I still find it weird how sample code had issues. My new code is included in the error message. I have no idea how to begin fixing this issue.

Spoiler: New Error:
Error3ForYEPItems.PNG

Also it now crashes when I try to go to the items tab in the menu after the item is created.

I think the error in the log is because rngstate[0] is being referenced before it was defined.
However, I am pretty sure that the garbage we have when it is created is used as the seed. So I don't know if that brings me any closer to fixing it.
I managed to get this issue resolved. I switched to using randomInt(10) and it started working as soon as I restarted the editor.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/issues-with-lunatic-mode-with-yep_item-core-and-yp_newparameters.122731/