MV Galv's Simple Crops crashing, plants not growing

Plugin from: https://forums.rpgmakerweb.com/index.php?threads/galvs-simple-crops-galvs-tools-farming.72280/


Using the script copied directly from the demo, when I attempt to update the map's crops for their growth cycle I get this crash. This occurs whether it is called by a map event being triggered by a player action (when activated) or a map event being a parallel process (immediately). It occurs whether or not I have planted something and time has passed (the variable has increased) for it to grow.

r/RPGMakerMV - Crash with Galv's Simple Crops plugin, crops won't grow
If I change the script to be a plugin command instead it doesn't crash but it also doesn't do anything. I've ensured the plant is checking the correct variable for its growth cycle, I've ensured there's no missing tags or codes for the plant, and I even tried copying parts directly from the demo. When run in the demo it functions. When run in my game it crashes. I copied the plugin .js directly from the demo as well so there shouldn't be any issues in that file.

I have experience with both RPGMaker and programming but Javascript is not my language so I don't understand everything I'm reading when I open the .js. Let me know if further information is needed. Thank you in advance for any suggestions and assistance.
the error is in eval at game interpreteer, and that means that you gave the wrong command in an event.
please give a screenshot of the event pages so we can check where you made your mistake - it's most likely a typo somewhere with that "not a function"
the error is in eval at game interpreteer, and that means that you gave the wrong command in an event.
please give a screenshot of the event pages so we can check where you made your mistake - it's most likely a typo somewhere with that "not a function"
This is how the demo event looks
1643934571754.png


And this is how my event looks (My day variable is increased periodically through a common event so that's why it's not shown. I've run tests to confirm the variable itself is working.)
1643934615810.png
What is line 299 of the plugin?
What is line 299 of the plugin?
1643935007941.png
On the map you're doing this on, if you open the console and put "$gameMap.events()" what comes up?
On the map you're doing this on, if you open the console and put "$gameMap.events()" what comes up?
1643935693124.png
It's because you have a Game_SpawnEvent. That doesn't have an event function, so it's crashing when it tries to check it.
It's because you have a Game_SpawnEvent. That doesn't have an event function, so it's crashing when it tries to check it.
I changed the spawn event to a regular map event and I'm still getting the crash. (I was spawning my plots in with a different plugin so I can till the ground wherever I want, this time I just put it into the map the way the demo does.)

1643937700334.png
Is it the same crash on the same line?
Is it the same crash on the same line?
1643938098568.png

Yep, looks like it is exactly the same
Okay, in the console put

JavaScript:
for (var e of $gameMap.events) { console.log(e.event()); }
Okay, in the console put

JavaScript:
for (var e of $gameMap.events) { console.log(e.event()); }
1643940654405.png
Oh, whoops. Put a () after events
Oh, whoops. Put a () after events
1643981962516.png
It's weird that you're still getting that error now then, since all the events do have an event function...
It's weird that you're still getting that error now then, since all the events do have an event function...
I had a lightbulb go off so I went and disabled every plugin I had enabled except for Galv's and it didn't crash. I started turning them back on one by one until I got the crash again. It appears for some reason Khas Core plugin (needed for ALL of Khas' plugins) is causing an incompatibility.
That's frustrating...it is involved in my day/night cycle I have setup already.

Edit: OcRam's Core is also incompatible.

Edit edit: Every lighting plugin I was attempting to use was incompatible so I rewrote the update function to not crash when used. This script needs to be used in place of Galv.CROPS.update();
for (var e of $gameMap.events()) { if (e.event().meta['crop'] === true) { e.updateCrop(); } }
I will also be posting it on the Galv's simple crops thread in case anyone else has this issue.

Original thread: https://forums.rpgmakerweb.com/threads/galvs-simple-crops-crashing-plants-not-growing.144587/