I'm planning on having where in my forest thing "Guards" that'll walk around and they spot the player they will chase them, How would that be done or is there a script for that?
I don't know about scripts, but you can do this with events. Set your guard event to random movement under autonomous movement and make it a parallel process event with no trigger so it continuously runs. In the event commands use Control Variables/Game Data to set this event and player coordinates to variables.
Control Variables:
[Player:X] = Game Data/Player's Map X
[Player:Y] = Game Data/Player's Map Y
[Guard:X] = Game Data/This Event's Map X
[Guard:Y] = Game Data/This Event's Map Y
Then you can create proximity variables based on this data. I'll give a quick example:
Control Variables:
[Guard:Y+2] = [Guard:Y]
[Guard:Y+2] += 2
Just in case this is confusing - all you did was add 2 to the Y coordinates of your guard and save it to a variable. That way you can tell when the player is standing two squares down from the guard. Then set up a condition that flips on a switch when the player is on that tile.
Conditional Branch: [Player:x] = [Guard:X]
Conditional Branch: [Player:Y] = [Guard:Y+2]
Turn ON Chase Switch
Branch End
Branch End
This checked to see if the player was standing two tiles down from the guard and activates the switch if that's the case. You can broaden the attack radius of your guard as much as you like. Just create new variables and conditions like I showed you that correspond with new tiles around the Guard.
Then add a new page to your Guard and set the condition to Chase Switch is On. Change the autonomous movement option to
approach and the guard will chase the player.