Galvs Fishing mini game error Line 753

Ok, so this is a great fun script. I added a chest to the demo with add_fish(3) after I moved it in the script to x position 100. Had it call a common event that gave the player some coins. Seemed to work with my tests.

Then I added a mermaid as fish[5] and set her up in the script and she works by appearing around the chest and guarding it kinda. She only goes after keys, bait[6]. I set her up like so:

FISH[5] = [    # A mermaid!                   "fish5",     # graphic                   3,           # speed                   5,           # pull                   2,           # move type                  [0,3],        # level                   100,         # x pos                   27,           # item                  [6],    # bait type                  "",           # custom se                  [100,50],      # range                  0,            # common event                  [78,95],    # length                  [70,99],    # weight                  true,        # stats                  "Mermaid",           # custom txt              ]You have to kinda use the bait to lure her awy from the chest then cast for the chest. Everything seems to work most of the time but sometimes when I catch the chest just as I reel it in and catch it, the game crashes and this error pops up. This happens even if I catch the mermaid first.

I'm not sure what's going on or what it means by undefined method. Line 753 is

SceneManager.scene.refresh_menusAny ideas?

galv error.jpg
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Link to the script?
Try to change that line to this:

Code:
SceneManager.scene.refresh_menus if SceneManager.scene_is?(Scene_GFish)
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

Link to the script?
Opps sorry, it had ben a long night of tinkering and testing.

http://galvs-scripts.com/2013/04/20/fishing-mini-game/

I posted there and I think Galv can figure out what went wrong. I'm going to restart fresh from a new copy of his demo and add another mermaid and see if it still happens after I test his demo a bit more to see if it's a problem with his script. Probably something I did, I don't see how though.

Try to change that line to this:

SceneManager.scene.refresh_menus if SceneManager.scene_is?(Scene_GFish)
I'll see what happens. (An hour later) Ok I tested every possibility, catch mermaid, catch chest, lure mermaid, catch chest fast. Catch chest and break line 3-5 times, catch all the other fish first, etc... seems to have stopped happening. I will add some more rocks with different x positions and some fish and see if it happens again. Thanks.
The issue was not with your fish setup.


It happens when you catch a "fish" with a common event attached to it.


If a common event starts, it leaves the fishing scene and goes to map automatically, and Scene_Map does not have any method with the name 'refresh_menus' which is why it will give a NoMethod error.


Giving that condition to the method call made sure that it is not called unless the current scene is the fishing scene, so the error should never happen again.


It happened because of wrong arrangement of method calls in a method (in the 'caught_fish' method), where the common event is called before the refreshing of windows.


Anyway, you shouldn't have any issues from now on. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/galvs-fishing-mini-game-error-line-753.36678/