MZ [SOLVED] [CGMZ Gathering] No Growth Image Shows, and Window screens overlap

Hi! I've run into an issue when setting up my crop using CGMZ Gathering. When I plant the crop, it doesn't show any of its' growth stages. Also, when I go to harvest the crop, it shows the "select crop" window on top of the harvesting one. How do I fix this? Thanks for the help! :LZSsmile:

While this most likely has no relevance to the issue, the plugin I'm using for placing events is PocketEvents. (I have also tested this with an event already on the map, but the issue(s) I describe still happen.)

Spoiler: CROP NODE
1744159339638.png

Spoiler: GROWTH STAGES
Stage 1:
1744159409981.png


Stage 2:
1744159430569.png

Spoiler: CROP EVENT
1744159532754.png

Here is a video of the issue(s) I'm describing:


EDIT 1: For the Window Overlap issue, I've tried just putting a Self Switch at the end of the Event (with nothing in the "Contents" section on page 2), but then I cannot harvest the plant.
Hi, for your event page, you can put the start planting plugin command inside a conditional branch with script call condition:

JavaScript:
this.CGMZ_getGatheringState() === 'none';

This is how you can differentiate which event commands run when nothing is growing vs after something has grown. For example, like this:
1744208393588.png


For your image issue, it does seem to be an issue with how the plugins interact, as [CGMZ] Gathering does not use the default event sprite for its image but rather creates its own sprite on top of it, which never gets created when the event is spawned. You can try modifying Pocket Events to add creating the CGMZ sprite as part of creating the spawned event. In my limited testing, what seemed to work was to find the function "_.PlaceItemOn" and add these lines at the bottom of it:

JavaScript:
const spriteset = SceneManager._scene._spriteset;
const sprite = new CGMZ_Sprite_GatherNode($gameMap.event(evId));
spriteset._CGMZ_gatherSprites.push(sprite);
spriteset._tilemap.addChild(sprite);
For me the function was on line 769 and I added those lines of code at line 787
@CasperGaming Ok, the first issue has been fixed. But, for the second issue (the image issue), I added the lines of code like so:


JavaScript:
  _.PlaceItemOn = function(x, y) {
    var commonEventId, dbItem, evId, itemId, marginY, uniqueId;
    evId = $gameTemp._epSpawned.eventId();
    itemId = $gameTemp._epPlacementItemId;
    dbItem = $gameSystem.pRegisterEPItem($gameMap.mapId(), itemId, x, y, evId);
    this.ActivatePlacedItem($gameMap.mapId(), itemId, evId);
    this.ChangePlacementItem(-1);
    this.CallPlacementAnimation($gameTemp._epSpawned, itemId);
    if (PKD_PocketEvents.IsNetworkGame()) {
      uniqueId = PKD_EPManager.GenerateUniqueId();
      dbItem.push(uniqueId);
      marginY = $gameTemp._epSpawned.epMY;
      PKD_EPManager.SendItemPlacedToServer(x, y, uniqueId, marginY);
    }
    commonEventId = this.ItemData(itemId).ceSpawnGood;
    if (commonEventId > 0) {
      $gameTemp.reserveCommonEvent(commonEventId);
    }
    const spriteset = SceneManager._scene._spriteset;
    const sprite = new CGMZ_Sprite_GatherNode($gameMap.event(evId));
    spriteset._CGMZ_gatherSprites.push(sprite);
    spriteset._tilemap.addChild(sprite);
    }
  };

When I run the game, I get this error:
SyntaxError Unexpected Token ';' (the debug console says it's at line 792)

EDIT: Also, I did turn off the PocketEvents plugin just to see if the images for the growth stages would appear after planting, but the images dont appear. So, how are the images supposed to be laid out? I did change to using a spritesheet, but then the images appear way above the event. Here's the video of that problem.
@CasperGaming Ok, the first issue has been fixed. But, for the second issue (the image issue), I added the lines of code like so:


JavaScript:
  _.PlaceItemOn = function(x, y) {
    var commonEventId, dbItem, evId, itemId, marginY, uniqueId;
    evId = $gameTemp._epSpawned.eventId();
    itemId = $gameTemp._epPlacementItemId;
    dbItem = $gameSystem.pRegisterEPItem($gameMap.mapId(), itemId, x, y, evId);
    this.ActivatePlacedItem($gameMap.mapId(), itemId, evId);
    this.ChangePlacementItem(-1);
    this.CallPlacementAnimation($gameTemp._epSpawned, itemId);
    if (PKD_PocketEvents.IsNetworkGame()) {
      uniqueId = PKD_EPManager.GenerateUniqueId();
      dbItem.push(uniqueId);
      marginY = $gameTemp._epSpawned.epMY;
      PKD_EPManager.SendItemPlacedToServer(x, y, uniqueId, marginY);
    }
    commonEventId = this.ItemData(itemId).ceSpawnGood;
    if (commonEventId > 0) {
      $gameTemp.reserveCommonEvent(commonEventId);
    }
    const spriteset = SceneManager._scene._spriteset;
    const sprite = new CGMZ_Sprite_GatherNode($gameMap.event(evId));
    spriteset._CGMZ_gatherSprites.push(sprite);
    spriteset._tilemap.addChild(sprite);
    }
  };

When I run the game, I get this error:
SyntaxError Unexpected Token ';' (the debug console says it's at line 792)

EDIT: Also, I did turn off the PocketEvents plugin just to see if the images for the growth stages would appear after planting, but the images dont appear. So, how are the images supposed to be laid out? I did change to using a spritesheet, but then the images appear way above the event. Here's the video of that problem.

I believe you are getting that error because you seem to have also added an extra "}":
Code:
    const spriteset = SceneManager._scene._spriteset;
    const sprite = new CGMZ_Sprite_GatherNode($gameMap.event(evId));
    spriteset._CGMZ_gatherSprites.push(sprite);
    spriteset._tilemap.addChild(sprite);
    } // <---- Remove this line
  };

It sounds like your image is a character sheet? The image should not be a full character sheet, it should just be each frame in a line like this, it allows for unlimited frames of animation:
bush_ready.png
@CasperGaming Thank you for your help so much!!! :LZSsmile: This solved my issues!

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/solved-cgmz-gathering-no-growth-image-shows-and-window-screens-overlap.176838/