I'm making my game where you clean houses, and you can upgrade the tools you use. Lets use the mop as an example. Eventually you can upgrade it so that it automatically cleans around you in a 3x3 grid with the player in the center. But I'm running into a problem.
So far in order to "clean" something you interact with the event and that flicks a self switch on the event. However I don't know how to scale that and make other events interactable even if you're not directly touching them.
Is there a way for events to check if the player is near and performing an action without them being a parallel event? Or is there another way I should be going about it?
You'd like need to see some sort of plugin to avoid using parallel events.
However, off the top of my head, one thing you can consider is condensing many parallel events into a single large parallel event.
How often down the parallel event ~really~ need to check what's around the player? Probably not any faster than the player can move between tiles. Anything faster than that and the parallel event is checking the same tiles multiple times, which is just unnecessary overhead.
What I recommend doing is consolidating your parallel events down to either 1, 2, or 3 parallel common events.
These would not be specific parallel events for individual actions, but instead priority events.
1 common event would update information less frequently - something like once a second.
The second common event would update more frequently - something like 15 frames (about the number of frames it takes on normal speed for a player to move from one tile to the next)
I really would avoid the third common event if possible, but it would act as a high speed common event. More than likely anything that would be put here might be better as just a map-based parallel event, and not one tied to a common event.
These parallel events should be turned on or off whenever necessary.
For example, in my own game, nearly all variables being processed in the second (15 wait frame) common event are only necessary when exploring outside of towns. So whenever the player enters or leaves town, this common event gets turned on or off.
additional tip:
consider how often the event needs to be checked and add wait-states to reduce lag.
usually something like this needs only to be checked a few times per second, so a wait(10) or wait(20) might help a lot.
However you need to experiment to find the best wait number, because it depends on the event and what else is on the map - too many waits and the event doesn't react in time, too few waits and you still have unnecessary processing adding to lag.