07-13-2013, 04:16 AM
Think of it as an alarm or sensor system.
Place an event on your map and make it... oh, I dunno... a rock. Make the 'trigger' for that rock to be a parallel process so it runs constantly. In the 'Event List' window on the right, you insert a script call command. A script call is where you can run an RGSS script (like view range) instead of your typical move-event/show-text commands. Now with that view range command, you set up a few values like the event's own id, a range and a switch that is turned on.
This example assumes that you are checking a circular range around event #12... for a distance of 5 tiles around it. And if the player is detected in this range, RMXP's switch #3 is turned on.
Oh... and there's a cool system to change audio volumes when you get closer or further from a source.
What you do when Switch #3 is turned on is up to you. You can make a guard ticked off.... a gate closes behind the player... the planet Krypton blows up... etc.
Place an event on your map and make it... oh, I dunno... a rock. Make the 'trigger' for that rock to be a parallel process so it runs constantly. In the 'Event List' window on the right, you insert a script call command. A script call is where you can run an RGSS script (like view range) instead of your typical move-event/show-text commands. Now with that view range command, you set up a few values like the event's own id, a range and a switch that is turned on.
$view_range.event_view(12, 5, 3)
This example assumes that you are checking a circular range around event #12... for a distance of 5 tiles around it. And if the player is detected in this range, RMXP's switch #3 is turned on.
Oh... and there's a cool system to change audio volumes when you get closer or further from a source.
What you do when Switch #3 is turned on is up to you. You can make a guard ticked off.... a gate closes behind the player... the planet Krypton blows up... etc.