• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Apologies if you've had troubles connecting to the site, you may need a VPN to access it. Staff are also facing issues connecting, so if it's urgent please message Cat on-site or through Discord directly.
  • Hey Guest, staff applications are open! If you are interested in becoming a forum staff member and/or Discord staff member, please apply through this Google Form before April 2! You can also message Cat with any questions.
Berry Planting Improvements

Resource Berry Planting Improvements 1.9.1

colin24601

Novice
Member
Joined
Feb 21, 2025
Posts
26
Thank you! After updating I'm getting a different error. Not sure if I'm planting the berries wrong or something, but I'm currently just copy/pasting them from other maps where they work fine.

=================

[2025-03-17 22:41:58 -0400]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `growth_stage' for 946756877:Integer

Backtrace:
Overworld_BerryPlants:229:in `initialize'
Overworld_BerryPlants:299:in `new'
Overworld_BerryPlants:299:in `block (2 levels) in <main>'
Overworld_BerryPlants:296:in `each'
Overworld_BerryPlants:296:in `block in <main>'
Event_Handlers:89:in `block in trigger'
Event_Handlers:89:in `each_value'
Event_Handlers:89:in `trigger'
Event_HandlerCollections:63:in `trigger'
Spriteset_Map:62:in `initialize'
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
598
Thank you! After updating I'm getting a different error. Not sure if I'm planting the berries wrong or something, but I'm currently just copy/pasting them from other maps where they work fine.

=================

[2025-03-17 22:41:58 -0400]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `growth_stage' for 946756877:Integer

Backtrace:
Overworld_BerryPlants:229:in `initialize'
Overworld_BerryPlants:299:in `new'
Overworld_BerryPlants:299:in `block (2 levels) in <main>'
Overworld_BerryPlants:296:in `each'
Overworld_BerryPlants:296:in `block in <main>'
Event_Handlers:89:in `block in trigger'
Event_Handlers:89:in `each_value'
Event_Handlers:89:in `trigger'
Event_HandlerCollections:63:in `trigger'
Spriteset_Map:62:in `initialize'
Probably the same thing just in an old bit of code. Somewhere on your map you have an event's variable being saved as an integer which is the cause. I thought the only thing that ever used that system was berry plants which is why I never ran into these crashes in all my development time.

I'll have to fix it later since I already logged off for the day
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
598
Alright, thanks!
Oh wait I just noticed your new crash isn't with my plugin, it's with the vanilla berry plant code.

So yeah somehow one of your events had an integer saved to its variable attribute and it's breaking things

My recommendation is to start a new save file, so the variable for all events are reset. Other than that, there is a way to check which event has the issue, but I'd have to write that up later tomorrow
 
Last edited:

colin24601

Novice
Member
Joined
Feb 21, 2025
Posts
26
Hello again,

Sorry but I'm back. I started a new save file, and it worked for a bit. But now I'm getting the crash below. I'm guessing it's something to do with when the berries are growing?


=================

[2025-03-18 22:00:37 -0400]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `+' for #<BerryPlantData>

Backtrace:
Game_Event:105:in `expired?'
Game_Event:118:in `cooledDown?'
(eval):1:in `switchIsOn?'
Game_Event:82:in `eval'
Game_Event:82:in `switchIsOn?'
Game_Event:186:in `block in refresh'
Game_Event:184:in `each'
Game_Event:184:in `refresh'
ParticleEngine:583:in `refresh'
Game_Event:28:in `initialize'
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
598
Hello again,

Sorry but I'm back. I started a new save file, and it worked for a bit. But now I'm getting the crash below. I'm guessing it's something to do with when the berries are growing?


=================

[2025-03-18 22:00:37 -0400]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Exception: NoMethodError
Message: undefined method `+' for #<BerryPlantData>

Backtrace:
Game_Event:105:in `expired?'
Game_Event:118:in `cooledDown?'
(eval):1:in `switchIsOn?'
Game_Event:82:in `eval'
Game_Event:82:in `switchIsOn?'
Game_Event:186:in `block in refresh'
Game_Event:184:in `each'
Game_Event:184:in `refresh'
ParticleEngine:583:in `refresh'
Game_Event:28:in `initialize'
Oh I see. Do you have an event that's a Berry Plant but has a cooledDown script switch condition on one of its pages? You would also have the script call pbSetEventTime somewhere in that event. I don't think those are compatible as it looks like they both use an event's variable attribute for different things (pbSetEventTime sets it to an integer, while it being a Berry Plant relies on it being a BerryPlantData object). Berry Plant events shouldn't have any cooledDown script switch in any of its pages and shouldn't use the pbSetEventTime script call anywhere.
 
Last edited:

colin24601

Novice
Member
Joined
Feb 21, 2025
Posts
26
Hm, all of my berryplant events are just copies of the example ones used in the essentials files. I started making this game back in 1.18 though, so maybe I'm still using an incredibly antiquated event. Seriously, thank you for your help.

I did just go check 1.20.2 berries and they weren't changed or anything. This is the event I'm using.

View: https://imgur.com/a/9hsoMwQ
 

colin24601

Novice
Member
Joined
Feb 21, 2025
Posts
26
Hm, all of my berryplant events are just copies of the example ones used in the essentials files. I started making this game back in 1.18 though, so maybe I'm still using an incredibly antiquated event. Seriously, thank you for your help.

I did just go check 1.20.2 berries and they weren't changed or anything. This is the event I'm using.

View: https://imgur.com/a/9hsoMwQ
 

colin24601

Novice
Member
Joined
Feb 21, 2025
Posts
26
Hm, all of my berryplant events are just copies of the example ones used in the essentials files. I started making this game back in 1.18 though, so maybe I'm still using an incredibly antiquated event. Seriously, thank you for your help.

I did just go check 1.20.2 berries and they weren't changed or anything. This is the event I'm using.

View: https://imgur.com/a/9hsoMwQ
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
598
Hm, all of my berryplant events are just copies of the example ones used in the essentials files. I started making this game back in 1.18 though, so maybe I'm still using an incredibly antiquated event. Seriously, thank you for your help.

I did just go check 1.20.2 berries and they weren't changed or anything. This is the event I'm using.

View: https://imgur.com/a/9hsoMwQ
Hmm. Does your map have any event that has that cool down condition?

I went through my code and tried to identify anywhere it sets the variable attribute to a BerryPlantData and they should all be locked behind the event having berryplant in the name and/or pbPickBerry/pbBerryPlant as a script in their page. I don't know how you have something mixing up setting the variable as an integer and then being checked if a berry plant or vice versa, but I'm 76% confident it doesn't have anything to do with my plugin. I also haven't heard of this coming up for anyone else that has used my plugin.

Since it's not obviously an issue with my plugin, it's hard for me to help troubleshoot this.

First, you can track down which events are problematic by adding the following:
In the Game_Event script in the script editor, add the following lines (you can use CTRL + SHIFT + F to search for each line)
  • after the line def variable add echoln "Reading from event " + @event.id.to_s as a new line
  • after the line def setVariable(variable) add echoln "Setting variable for " + @event.id.to_s as a new line

This will log things to the console. When the crash occurs, hopefully it helps point to what event is the problem.

If that doesn't make things obvious, you can try uninstalling my plugin, starting a new game, and seeing if the issue happens again. If it does, then that confirms that it's not my plugin. If it doesn't after a good amount of time, try reinstalling my plugin, then see if the issue all of a sudden starts happening.
 
Last edited:
Back
Top