A downloadable RPG Maker MZ Plugin

Get this RPG Maker MZ Plugin and 1 more for $8.00 USD
View bundle
Buy Now$5.00 USD or more

Boundary System finds tiles within or on a boundary and returns tile coordinates for use in other plugins. Alone this plugin  does nothing more than returning tile coordinates but when paired with a plugin which utilizes those coordinates properly it makes for a very powerful tool.

When using this plugin alongside Ritter Ultimate Event Spawner see the help file within the Event Spawner for help using boundaries as those commands differ from the basic Boundary System commands. Please do not use the script calls below for the spawner. These script calls do not include everything needed for the spawner to function properly, use the spawners script calls instead.

These script calls are for anyone looking to utilize the boundary system in their own plugins for other purposes, as this was made to be used for more than just a spawner.

Click here to Purchase Ritter Ultimate Event Spawner & Ritter Boundary System Bundle and save!

Script Calls:

Ritter.Boundary.createBoundary(width, height, thickness, name, eventId, expandBy, centerx, centery)

  • width = the number of tiles that make up the width of the boundary.
  • height = the number of tiles that make up the height of the boundary.
  • thickness = the number of tiles thick the boundary is.
  • name = the "name" of the boundary.
  • eventId = 0 for player, eventId number for event, -1 if using centerx, centery coordinates on map.
  • expandBy = the number of tiles to expand the boundary in the direction the player is moving, this increases the probability that something will happen in front of the player instead of  same odds on side and back.
  • centerx = the x location of the boundaries center. use this only when boundary is not placed on anchor event or player.
  • centery = the y location of the boundaries center. use this only when boundary is not placed on anchor event or player.

Example:

Ritter.Boundary.createBoundary(17, 15, 1, "spawn", 0, 3)

This would create a boundary named "spawn" around the game player which is 17 tiles wide and 15 tiles high with 1 thickness that expands by 3 thickness in the direction the player is moving.

Once a boundary is created the boundary will be stored inside an object. To access the boundary after it's been created use the script call below.


Ritter.Boundary.editBoundary(boundaryName, prop, value)

  • boundaryName = The "Name" of a Boundary to Edit.
  • prop = The "Property" to Edit.
  • value = New Value for Property.

List of Valid Property Strings:

  • "width"
  • "height"
  • "thickness"
  • "expandby"

Ritter.Boundary.deleteBoundary(boundaryName)

  • boundaryName = The "Name" of a Boundary to Delete.

Deletes the Boundary Object from the Boundary Database.


Ritter.Boundary.getBoundary(boundaryName)

  • boundaryName = the "name" of a boundary you created.

This will return the boundary object you created to be stored in a variable.

 

Example: var boundary = Ritter.Boundary.getBoundary(boundaryName);

Once you have your boundary stored to a variable you can then use the following functions, you will feed these functions the boundary object you created and stored to a variable.


Ritter.Boundary.getInBoundaryTiles(boundary)

This function returns every tile by [x,y] coordinates that is INSIDE the boundary. (picture a fully colored in rectangle)


Ritter.Boundary.getOnBoundaryTiles(boundary)

This function returns every tile by [x,y] coordinates that is ON the boundary. (picture the outline of a rectangle)

Ritter.Boundary.randomRegionInBoundary(regions, boundary)

  • regions = regionId(s) to randomly select a tile from that are INSIDE the boundary. To use multiple regionIds list them as an array. [1, 2, 3]
  • boundary = the boundary object you created and stored to a variable.

This function returns one tiles coordinates that is INSIDE the boundary marked with any of the regionId(s) specified.

Example: Ritter.Boundary.randomRegionInBoundary([1, 2, 3], "spawn")

This would return one random tile that is marked with any of the regionIds 1, 2, or 3 that lies INSIDE the boundary.

 

Ritter.Boundary.randomRegionOnBoundary(regions, boundary)

  • regions = regionId(s) to randomly select a tile from that are INSIDE the boundary. To use multiple regionIds list them as an array. [1, 2, 3]
  • boundary = the boundary object you created and stored to a variable.

This function returns one tiles coordinates that is ON the boundary marked with any of the regionId(s) specified.

 

Example: Ritter.Boundary.randomRegionOnBoundary([1, 2, 3], "spawn")

This would return one random tile that is marked with any of hte regionIds 1, 2, or 3 that lies ON the boundary.



Terms of Use:

  • You are granted non-exclusive rights to use this plugin for Commercial and Non-Commercial Use in as many projects as you wish to create.
  • Do not redistribute this plugin without permission.
  • Do not take code from this plugin without permission.
  • Do not remove my name from @Author.
  • Do not take credit for creating this plugin.
  • Editing of code is allowed as long as it's within plugin file.
  • I do not offer support for any changes made to plugin code.
  • While it's not mandatory please consider crediting me in your game credits:
    • (Something similar to this would be great)
    • Boundary System Plugin
    • Craig "Ritter" Barger
StatusReleased
CategoryTool
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthornotRitter
Tagsmz, plugin, rmmz, RPG Maker, RPG Maker MZ

Purchase

Get this RPG Maker MZ Plugin and 1 more for $8.00 USD
View bundle
Buy Now$5.00 USD or more

In order to download this RPG Maker MZ Plugin you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:

Ritter_BoundarySystem.js 17 kB

Development log

Comments

Log in with itch.io to leave a comment.

After a few steps in the oasis room a crash occurs 

"TypeError

Cannot read property 'id' of undefined"


Do you have an idea what is going on?