ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,303
Reaction score
2,462
First Language
Dutch
Primarily Uses
RMMV
PluginName: ShadowDragon_DR (Dynamic Regions)
Author: ShadowDragon


TERMS OF USE:
Credit ShadowDragon
You are allowed to use it in Non-commercial and commercial games when credits are given.
Do NOT redistribute the plugin, but link back to this thread.

Do not remove the header!

A tiny plugin to use regions to block players and unblock it to make it passable
by using a switch and block again if needed.

I dont know if it would be usefull to many or by some.

it seems to be compitable by MZ as well, so I added a "@target MZ MV" lable to it.

Please note that this doesn't work for events, just the player.
as I just share it here as a small plugin, ping me if you find any bugs/incompability,
as i dont always get notified.

I hope I can get 1 small thing in return, if you use it, "how" you used, as I'm curious how
some creative people make use for it :)

UPDATE HISTORY:
22-03-2022: small update that could break potential movement.
20-6-2022: fixed array problem with other JSON parsers to get typeErrors.
 

Attachments

  • ShadowDragon_DR.js
    13.9 KB · Views: 11
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,303
Reaction score
2,462
First Language
Dutch
Primarily Uses
RMMV
small update, that it can break potentional movement,
if set below others with the functions, this is now aliased
and re-coded so it wont collide with other plugins.

if you downloaded it before, please re-download and replace it.
everything should work as before :)
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,303
Reaction score
2,462
First Language
Dutch
Primarily Uses
RMMV
small update, changed json parser that breaks it with MZ plugins
or MV that use array.remove function, this is fixed in this version.
 

ephesus

Veteran
Veteran
Joined
Dec 10, 2015
Messages
165
Reaction score
87
Primarily Uses
Thank you!

Useful plugin, especially for a Region enthusiast!

Question/request: Would it be possible to set up more than one region? Like as many as wanted even? Overlapping multiple regions is the only way to get the most out of them.

example: Region w/SDDRP=region1, Region with damage floor+SDDRP=region2, Region w/common event+SDDRP=Region3, etc..
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,523
Reaction score
3,591
First Language
English
Primarily Uses
RMMV
Question/request: Would it be possible to set up more than one region? Like as many as wanted even? Overlapping multiple regions is the only way to get the most out of them.
The trick is that regions are a specific layer of the map data. Adding more layers to accommodate the storage of multiple regions (or turning it into an array) would require the careful modification of every piece of code that interacts with map layers or tiles.

And then there would be no way to put it into the editor, you'd have to be manually setting these lists of multiple regions via notetags in the maps.

It seems like it would be easier to just use whatever means of interacting with regions you already are and account for it on your end.
 

ephesus

Veteran
Veteran
Joined
Dec 10, 2015
Messages
165
Reaction score
87
Primarily Uses
That's not necessarily what I meant. The plugin allows for one on/off region. I just wanted to know if we could get more than one one region to do on/off with a seperate switches. I assume I could easily do this if I knew JS but as of now I don't. like one map has region 1 set to this plugin, and another map (or the same) has another region set to this plugin and just on a seperate switch.

I don't want multiple regions on the same tile. (well I do but that's another thing). And I have already put multiple plugins using the same tiles like, passability plugin, common event plugin, show name tag plugin, and region effects plugin all using the same region.

Oh, check this out. Plugin layers. (I just dunno if I want to go to this amount of setup and execution): https://eric-the-funny-baron.itch.io/region-id-layers-plugin
 

ephesus

Veteran
Veteran
Joined
Dec 10, 2015
Messages
165
Reaction score
87
Primarily Uses
Oh wait, I have just discovered that you can, actually. The plugin totally allows you to add as many as you want. Um... I don't now how I missed that. I swear I specifically looked to see if you could add more region/region switches and... Well, thank you now even more Shadow Dragon! I was actually wondering how you could have decided not to allow that.

Thanks for trying to help Turan. I have wasted your valuable time.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,303
Reaction score
2,462
First Language
Dutch
Primarily Uses
RMMV
@ephesus you can set many regions to block player/unblock paths.
for any kind, the link is you placed is more for tiled, but if you want
region or temp region for dmg, and common event to run, you can
look into [Red_setRegionId] as mine doesn't have that purpose, other
than block/unblock the player (once I got time, I see what I can do for
the Events as well, so they can block when a switch is ON.

but nothing is impossible, but some things are impossible for me,
but not for advance coders ^^

I'm glad you got it to work, but read helpfile before asking questions,
the request you asked is something out of purpose of this plugin feature.

@ATT_Turan thank you for the nice explanation of layers :)
 

ephesus

Veteran
Veteran
Joined
Dec 10, 2015
Messages
165
Reaction score
87
Primarily Uses
Adding multiple instances was exactly what I was looking for. So, now I'm very happy and feel silly for asking when it was already there.

The plugin you linked is something I'll use for sure, thanks! Can you help me with this however?:
"To change a tile range, use the function "$gameMap.setTileSquareId(x, x2, y, y2, r)""

I've neve heard of tile range and also am not sure how to use x, x2, y ,y2. (r is the region id I'm pretty sure.) Is x2 and y2 the size we want x and y expanded to?
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,303
Reaction score
2,462
First Language
Dutch
Primarily Uses
RMMV
I didn't use that on my own, but I think the following: (its best to try).

x = 3
x2 = 10 (so tiles 3 through 10 is covered)
y = 1
y = 5 (so y 1 through 5 is covered)
r = regionId.

but I dont know if it goes like left to right and up and down or a square part.
test to see the effect, make a simple text message or grass/sand area and
see if it triggers with the numbers inputted, otherwise I dont know.

I use that plugin more as a sensor plugin for hidden items :)
but if you really want help, make a new thread, or it goes far off topic than the
purpose of the plugin feature.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've never felt prouder of my little game!! *o*
DamageEvil_2.png added!
index.php

Forum statistics

Threads
125,672
Messages
1,172,712
Members
164,799
Latest member
PurpleClouds
Top