This script implements Areas (or Regions) in RPG maker XP, so they work the same way as in more modern RPG maker versions.
They work in parallel with terrain tags without changing anything on them, and the way to check them via script is also very similar.
To set them, execute your game in Debug mode and press F8. The option of placing the areas directly along the map using the mouse will be activated. To change the area index, press Q / W (or Page Down / Page Up) and use the directional arrows to scroll across the map. The changes will be saved in real time.
Spoiler: Side notes
If you're using the Grid-Free Doodads script I made some years ago, it has Area Support already integrated.
If you are using another Mouse script in your game, you can remove the Glitchfinder Key and Mouse and use the one you are already using (the methods in the Setup Mode script will have to be adapted).
Author: Wecoc
First Release: September 2016
Last Version: October 2018
Credits
Wecoc (Area implementation)
Glitchfinder (Keyboard & Mouse modules)
Terms of use
- Please give credits to everyone on the list above.
- You can repost this code.
- You can edit this code freely, and distribute the edits as well.
- This code can be used on commercial games.
Spoiler: Screen
[/quote]
Instructions
Download the demo and copy the four scripts on your game: Key Input, Mouse, Area Base and Area Setup.
There's not much to it apart from that.
You can define areas that are always passable or non-passable on the start of Area Base, and you can change the debug button (F8) on Area Setup.
return true if @passable_areas[$game_map.area(new_x, new_y)] == true
areas_pass?(x, y, d)
end
end
复制代码
For example:
$game_map.events[Event ID].set_passable(Area ID)
$game_player.set_passable(Area ID)
You can use set_passable, set_no_passable, clear_passable and clear_no_passable.
Spoiler: Addon - Area Helper
This little script allows to define some descriptions on certain areas that will display when setting them, so you won't have to remember which IDs you had to use.