Short version:
I need a way of getting the x and y of the closets regional id numbered 3.
Fully-explained:
So I'm building my game, and I've designated tiles as hiding spots like trees and boxes as Danger Spots, and I gave them an ID of 3 (I chose based on color...)
I then have regional IDs (set to ID1) around that Danger Spot to designate that hiding spots area of effect (Danger Area).
(so visually the tree here are the danger, but the spots around it are the actual bits which trigger events)
I've got the parallel event to check when a player walks onto a Danger Area to randomise and trigger an event if they are unlucky; however, I want there to be a short Autorun event where a figure jumps out from the Danger Spot at the player. It's not efficient to make an event for each spot, so I was hoping to get a solution here.
My current plan is to have 1 event. When the player steps on a Danger Area the parallel function triggers an 'Event Set Location' command, and then script call to trigger the self-switch of the moved event to start.
The issue I have is finding a way to get the x and y of a regional tile (Id 3) that is closest to the player.
Any thoughts on this super-specific scenario I got myself in.
I need a way of getting the x and y of the closets regional id numbered 3.
Fully-explained:
So I'm building my game, and I've designated tiles as hiding spots like trees and boxes as Danger Spots, and I gave them an ID of 3 (I chose based on color...)
I then have regional IDs (set to ID1) around that Danger Spot to designate that hiding spots area of effect (Danger Area).
(so visually the tree here are the danger, but the spots around it are the actual bits which trigger events)
I've got the parallel event to check when a player walks onto a Danger Area to randomise and trigger an event if they are unlucky; however, I want there to be a short Autorun event where a figure jumps out from the Danger Spot at the player. It's not efficient to make an event for each spot, so I was hoping to get a solution here.
My current plan is to have 1 event. When the player steps on a Danger Area the parallel function triggers an 'Event Set Location' command, and then script call to trigger the self-switch of the moved event to start.
The issue I have is finding a way to get the x and y of a regional tile (Id 3) that is closest to the player.
Any thoughts on this super-specific scenario I got myself in.