Trying to make a complicated on map skill. Any idea how to do this?

So I'm making a short game with a character who has an "artify" skill. The way I want it to work is, if you walk up to an object and you use the action button, the character just comments on it, but once they unlock this artify skill, if the character hits a different button, it unleashes a little radius of around 3 tiles and any events that can be "transformed" in the radius of this have a switch or self switch turned on which transforms the event. (Image changes, secret passages open up, talking to objects that were previously inanimate, that kind of thing)

Some of this I figured out. I can use Yanfly's button common events to bind the common event to a given key, we'll say "t" for transform.

I know that I can use maybe a parallax map event to track the player's location and compare it to the event location... somehow. Can probably figure that out with a little trial and error?

What I'm having trouble is figuring out how to make the individual events switch on.

Like let's say I get a conditional that checks something like: if tile distance between player and event a < 3 turn on switch 1. And then the switch transforms the event.

The thing is, there's going to be multiple events triggered by this ability, so is there any way to do this other than having the common event check for each and possible event that could be in its proximity and turning on a different switch for each?

Like say I want to use this ability and 20-30 events are effected by this, do I just need to build a condition to check each individual event and flip a different switch or is there a better way?
I know that I can use maybe a parallax map event to track the player's location and compare it to the event location... somehow. Can probably figure that out with a little trial and error?
I think you mean parallel, but there's no reason for anything you're describing to use a parallel event.

Simply use Control Variables in the common event you activate with T to check the character's current coordinates.

However, even this isn't necessary - see below.

The thing is, there's going to be multiple events triggered by this ability, so is there any way to do this other than having the common event check for each and possible event that could be in its proximity and turning on a different switch for each?
You can use code that checks every event and turns on a switch if it's in proximity.

Code:
$gameMap.events().forEach(event =>
{
    if (!event)
        return;

    let x = $gamePlayer._realX - event._realX;
    let y = $gamePlayer._realY - event._realY;
    if (Math.sqrt(x * x + y * y) <= 3)
        $gameSelfSwitches.setValue([$gameMap.mapId(), event.eventId(), "A"], true);
});

That will turn on self switch A of every event within 3 tiles of the character.
I think you mean parallel, but there's no reason for anything you're describing to use a parallel event.

Simply use Control Variables in the common event you activate with T to check the character's current coordinates.

However, even this isn't necessary - see below.


You can use code that checks every event and turns on a switch if it's in proximity.

Code:
$gameMap.events().forEach(event =>
{
    if (!event)
        return;

    let x = $gamePlayer._realX - event._realX;
    let y = $gamePlayer._realY - event._realY;
    if (Math.sqrt(x * x + y * y) <= 3)
        $gameSelfSwitches.setValue([$gameMap.mapId(), event.eventId(), "A"], true);
});

That will turn on self switch A of every event within 3 tiles of the character.
Well that would almost work, except there's some events I don't want to trigger, so it needs to have an impact on a decent number of events but not every single event. Is there a way to mark the ones I don't want to trigger or mark the ones I do? If so I could nest another if statement to check for that and that could work.

*Edit* actually I could probably work with this. I could have self switch D reserved specifically for these kinds of events. If a particular event isn't impacted by the button then I just don't make a page d for it. Thanks for the help,Turan. Appreciate you.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-a-complicated-on-map-skill-any-idea-how-to-do-this.171630/