Galv's Simple Crops + Galv's Tools = Farming

I don't see how the code you provided would do what you describe.

Galv.CROP.update() references $gameMap.events() (that is, the events on the current map) regardless of whether you add a second layer to call that function or not.

The code you added does absolutely nothing different than directly calling Galv.CROP.update(mapID), which, in turn, does nothing different than just calling Galv.CROP.update() without the ID.

From my understanding, the script updates crops only on the map the player is currently on. It doesn't directly affect crops on other maps.

Here's how it achieves this:

  1. Game System Storage:
    • The plugin stores crop data within the $gameSystem object, which is specific to the current game session.
    • Each map's crop information is stored under $gameSystem._crops with map IDs as keys.
  2. Map-Specific Updates:
    • The Galv.CROPS.update() function, which is used to refresh crop graphics, takes a mapId parameter.
    • This function only iterates through and updates crops that belong to the specified map.
  3. Scene and Event Handling:
    • Crop updates are primarily triggered within the Scene_Map and Game_Event classes, which inherently operate within the context of the current map.
    • This ensures that updates are focused on crops that are visible and relevant to the player's current location.
Given this, a Common Event to update crops would do nothing if the player was exploring a Cave with map ID 3 when the switch was triggered, it would update map ID 3 not Map ID 2 were the farm is located.
From my understanding, the script updates crops only on the map the player is currently on. It doesn't directly affect crops on other maps.

Here's how it achieves this:

  1. Game System Storage:
    • The plugin stores crop data within the $gameSystem object, which is specific to the current game session.
    • Each map's crop information is stored under $gameSystem._crops with map IDs as keys.
  2. Map-Specific Updates:
    • The Galv.CROPS.update() function, which is used to refresh crop graphics, takes a mapId parameter.
    • This function only iterates through and updates crops that belong to the specified map.
  3. Scene and Event Handling:
    • Crop updates are primarily triggered within the Scene_Map and Game_Event classes, which inherently operate within the context of the current map.
    • This ensures that updates are focused on crops that are visible and relevant to the player's current location.
Given this, a Common Event to update crops would do nothing if the player was exploring a Cave with map ID 3 when the switch was triggered, it would update map ID 3 not Map ID 2 were the farm is located.
If you're going to let AI do your talking for you, maybe you should at least shell out the money for GPT-4, because this is pretty bad. You're contradicting yourself multiple times within this post, and as ATT_Turan already pointed out, the code in your previous post didn't make any sense either.
This function only iterates through and updates crops that belong to the specified map.
No - as I already pointed out (and as anyone with even a cursory knowledge of MV's code can easily see) that is incorrect.

I'm not even going to get into the rest of your post as, as @Arthran says, it makes no sense.
I don't know how Galv might have missed it, but the mapId parameter is totally useless there. It'll never update any other map's events. And as Turan told you, your wrapper makes no difference at all.

JavaScript:
Galv.CROPS.update = function(mapId) {
	var events = $gameMap.events();
	for (var e in events) {
		if (events[e].event().meta.crop) events[e].updateCrop();
	}
};
I don't know how Galv might have missed it, but the mapId parameter is totally useless there. It'll never update any other map's events.
My guess is that he originally intended to make it able to update crops on whichever map you like.

But MV only has event data for the currently loaded map file, so in order to actually do that you would have to write an entire section of code to load a second map, store its events, then do whatever to manipulate them.

So I suspect he scrapped the idea and just never bothered to delete the mapId argument.
The irony of this conversation is the code does indeed work, at least in my project :shrugs:
It doesn't "work" because it never added any new feature to the plugin at all. Honestly, telling people to use wrappers when then could call the function directly isn't worth the effort. If people end up feeling kind of scammed or fooled, they'd be right. It's a joke. I wanna think you didn't do it on purpose, but you should truly stop making false claims if you want to be taken seriously on any board.
It works, as shown in this video. Admittedly ran into a glitch were the crops grew too much when testing it via this method (the function was previously tested by staying in the cave from 5-13, as the morning switch only triggers from 6-12) but it definitely works despite that glitch and all the naysayers on here.
it definitely works despite that glitch and all the naysayers on here.
There are no naysayers, just people who are competent enough to read code. It is impossible for the event and code you posted to do what you described.

Your video "proves" nothing, it's you wandering around various maps for 5 minutes - it shows nothing about the various events and plugins you may have configured to try to achieve what you're going for.

I really don't care about how you got stuff to work in your project, but I do care about the spread of misinformation for other people trying to use the plugin.
I appreciate the feedback on my recent post, but I'm disappointed by the tone and dismissiveness of some of the responses. I'd like to clarify a few points:

1. I'm not claiming to be an expert.
I'm simply sharing my experience with a solution that worked for me. I'm always open to learning more, and I'm happy to discuss the technical details with anyone who's interested.


2. I understand that this approach may not be conventional or widely known. However, I've personally tested it and can confirm that it's functional. I'm not sure why some people are so quick to dismiss it without considering the possibility that it might work.


3. I'm not here to argue or engage in personal attacks. I'm here to share knowledge and help others who might be facing similar challenges. If you're not interested in a constructive discussion, that's fine, but please refrain from disrespectful comments.

I'm happy to provide more details about the specific modifications I made and how I achieved the desired results. I'm also open to suggestions for alternative approaches. Let's keep this conversation focused on problem-solving and mutual respect.
There are no naysayers, just people who are competent enough to read code. It is impossible for the event and code you posted to do what you described.

Your video "proves" nothing, it's you wandering around various maps for 5 minutes - it shows nothing about the various events and plugins you may have configured to try to achieve what you're going for.

I really don't care about how you got stuff to work in your project, but I do care about the spread of misinformation for other people trying to use the plugin.

The common event (and GameTime plugin used to manage the switches) is shown in my original post were I shared the modified function.
I'm happy to discuss the technical details with anyone who's interested.
You're clearly not. The technical details are readily visible in the code of Galv's plugin, and the relevant code was even pasted several posts above by kyonides.

2. I understand that this approach may not be conventional or widely known. However, I've personally tested it and can confirm that it's functional. I'm not sure why some people are so quick to dismiss it without considering the possibility that it might work.
Because it can't. I just don't know what else to say.

I'm flummoxed as to whether you honestly believe that the code you posted does what you say. But if you know any basics of JavaScript, you would know it can't. This is not a personal attack, it is fundamental in that the first lesson or tutorial you took that covers calling functions would demonstrate it.

The Galv.CROPS.update() method accepts a mapId, but it really clearly and obviously does not use it. You need to know zero coding, you only need to be able to read to look at the next three lines and see that mapId is never referenced.

You making another function that does absolutely nothing except call the update() method can not change the code inside of it. No matter what you do, calling update() is always going to do the exact same thing.

I don't know how else to say it or how someone who knows JavaScript as basically as how to write a function could think otherwise.

You have posted absolutely nothing to indicate you have any technical knowledge - what you're doing is not unconventional, it's nonfunctional. The one post where you attempted to explain yourself completely contradicted itself as well as your first post, leading me (and others) to believe you generated it and don't actually know what you're talking about.

The only way to modify the crops on another map would be to completely rewrite the contents of the CROPS.update() method, not just make a dummy function that calls it normally.

If you were concerned about respect, this should be taken out of the thread Galv made to discuss his plugin and its actual, coded functionality.
1. You're now hijacking another forumer's thread to post your "addition" (even if it's just a wrapper).
You know, you could have started your own thread instead.
Guess what? Turan had already told you that your so called plugin mod does not belong here.

2. You've NEVER posted any real code that could have altered Galv's plugin default behavior in any significant way.
You just defined a wrapper function. That's all it is.

3. You posted a link to a Russian webpage where we're supposed to download the official version of the DK_GameTime plugin. It's only supposed to control switches based on your own words.

4. What we can see on the video is how Galv's plugin actually works plus some bugs you've mentioned on one of your previous posts.

So the big questions here are why you insist on having published a non existing code and why you keep defending it when it's self evident that you haven't provided forumers with anything but a weird description of a "new" feature that never existed.

You had exposed yourself from the very beginning, we just pointed out what was extremely obvious from day 1. Did you forget to add your custom code? Not those 3 lines you posted before, I'm talking about the actual code. And if you ever wanna publish it on the board, please open your own thread.
I appreciate the feedback on my recent post, but I'm disappointed by the tone and dismissiveness of some of the responses. I'd like to clarify a few points:

1. I'm not claiming to be an expert.
I'm simply sharing my experience with a solution that worked for me. I'm always open to learning more, and I'm happy to discuss the technical details with anyone who's interested.


2. I understand that this approach may not be conventional or widely known. However, I've personally tested it and can confirm that it's functional. I'm not sure why some people are so quick to dismiss it without considering the possibility that it might work.


3. I'm not here to argue or engage in personal attacks. I'm here to share knowledge and help others who might be facing similar challenges. If you're not interested in a constructive discussion, that's fine, but please refrain from disrespectful comments.

I'm happy to provide more details about the specific modifications I made and how I achieved the desired results. I'm also open to suggestions for alternative approaches. Let's keep this conversation focused on problem-solving and mutual respect.


The common event (and GameTime plugin used to manage the switches) is shown in my original post were I shared the modified function.
So the thing is, you were the one who was dismissive first. ATT_Turan explained to you exactly why your code couldn't possibly do what you claim it does, and instead of giving him a serious response, you simply copied and pasted a response from an AI, without even bothering to read it first. In my book, that's not particularly demonstrative of a desire to be respectful or to solve problems.

Your own AI generated response actually contradicted the point that you were trying to make:
From my understanding, the script updates crops only on the map the player is currently on. It doesn't directly affect crops on other maps.
Given this, a Common Event to update crops would do nothing if the player was exploring a Cave with map ID 3 when the switch was triggered, it would update map ID 3 not Map ID 2 were the farm is located.
As you can see, in two places, "you" directly stated that it's only possible to update crops on the current map--which is the exact opposite of what you were trying to claim.

My post may have seemed flippant, but my advice to you was legitimate. If you're going to allow an AI to represent your view, you should at least be using GPT-4, because whatever you used was really bad, and I'd be embarrassed to put my name on the statements that it outputted. 1/3 of the post was unrelated babble, and 1/3 of it directly contradicted the remaining 1/3. Though truthfully, it would be better if you just did your own thinking and talking, instead of relying on AI.

The reason that everyone is telling you that your code doesn't work has nothing to do with being dismissive, nor does it have anything to do with personal attacks. To put it bluntly, it's obvious at a glance that it won't work.

All your code does is creates a brand new function that does nothing other than calling an existing function, which is pointless (because you could just call the existing function directly). And it's trying to supply a map ID argument to that function, which doesn't actually do anything. The function was defined with a mapId parameter, which is what is confusing your AI, but the function doesn't actually use that mapId parameter, so it serves no purpose.
Doing my best here, so my bad if I “do a dumb” but I think if I were Galv I’d be pretty bummed out if the entire last page of my resource thread was, this… So. Let’s put a pin in this conversation. I think it’d at least be prudent to check with the resource author before posting anything angled as a modification or improvement it in their thread (or elsewhere for that matter) as well.

Original thread: https://forums.rpgmakerweb.com/threads/galvs-simple-crops-galvs-tools-farming.72280/