Is there any way to break the 64-region limit?

Status
Not open for further replies.

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I need about 80 regions for a script on a large 250x200 map...
 

ImmortalDreams

Reality's Stranger
Veteran
Joined
Feb 1, 2013
Messages
99
Reaction score
26
First Language
English
Primarily Uses
I'm not sure. Maybe you could look for some scripts, or you could try using events. Also, you might find this tutorial I made useful for your map. You could apply it to x and y position detection via events.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
One thing I would consider is to simply store the regions externally and write a tool that allows you to manage regions visually.


Another option is to combine the terrain tag with the region ID, but that will result in you needing to use duplicate tiles just to have extended regions.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
No, not with the same functionality.


As said, you can provide additional data for the map, but that data cannot be entered by the editor, and it cannot be entered into regionID (which is limited to 6-Bit (= 0 to 63).


What exactly do you want to set by the region ID?


There are a lot of different ways to code data (Tsukihime gave one example with the terrain tag), and if we know what you're planning to do we might be able to guide you to a better coding - I had a lot of ideas how to use region IDs myself, but even with multiple functions in a single game that wouldn't use more than half the available ID numbers...
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I take it that there is no real solution nor any existing script then. I use those regions for controlling traffic lights. Using regular events is not something that I'd consider for that task because it would most likely be a huge performance killer.

I could indeed somehow create the regions bigger than 64 by code when the map loads. But they won't be visible in the editor. Or maybe my script sucks when I need more than 64 regions. But a T-intersection = 3 regions and a crossroads = 4 regions. That adds up pretty fast.

To assign a region at runtime, all I have to do is this right?:

$game_map.data[13,3,3] = 94 * 256 # assigns region 94 to tile [13,3].So I could create a script for it now. But this somehow feels like a dirty workaround...

EDIT (got ninja-ed):

I have a custom script (It might be a bad script but it's the best I could do so far for creating traffic lights) that flips a variable. Each region is tied to that variable and will block cars (=autonomous events that are marked with a special comment-tag) depending on the variable value (1-4). But every intersection needs 4 regions (1 for each direction). See attachment.

Edit2:

Maybe I could re-use regions... I mean, who cares that the intersection at the topleft of the map is synched with the traffic light near the bottom right...

Solution:

Reuse of regions combined with the script below to increase the amount of regions to 127 while still having the first 64 visible in the editor (obviously).

#==============================================================================# Region Limit Breaker# Version 1.00# By Napoleon## About:# Allows you to assign extra regions to a map up to 127.# Meant for advanced users.## Instructions:# - Place below "▼ Materials" but above "▼ Main Process".# - Edit the Settings part to your needs.# - Optional: use the new "assign_region(x, y, region_id=0)" command.## Requires:# - RPG Maker VX Ace## Terms of Use:# - Attribution 3.0 Unported (CC BY 3.0)# http://creativecommons.org/licenses/by/3.0/# - Attribution is not required. This overrules what's stated in the above# license.## Version History:# 1.00 (09 December 2013)# - First Release#-------------------------------------------------------------------------------# Settings# Note: Do NOT add values > 127 or you will get weird values.#-------------------------------------------------------------------------------NAP_MAPS_LB = { 1 => { # 1 will apply this ONLY to the map with map_id == 1 [4,4] => 127, # Will assign region #127 to tile [4,4] [0,0] => 89, # Will assign region #98 to tile [0,0] (most top left tile) }}#-------------------------------------------------------------------------------class Game_Map alias nap_region_lb_setup setup def setup(map_id) nap_region_lb_setup(map_id) return if NAP_MAPS_LB[map_id].nil? NAP_MAPS_LB[map_id].each_pair do |k,v| $game_map.data[k[0], k[1], 3] = v * 256 end end # setupend # Game_Mapclass Game_Interpreter def assign_region(x, y, region_id=0) $game_map.data[x, y, 3] = region_id * 256 endend#===============================================================================## End of File##===============================================================================
sample.png
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
But every intersection needs 4 regions (1 for each direction). See attachment.


Edit2:


Maybe I could re-use regions... I mean, who cares that the intersection at the topleft of the map is synched with the traffic light near the bottom right...
Not only re-use regions, you usually need only two codes per intersection, unless your game world has some really strange traffic laws...
Both sides of a street can usually move at the same time, that's why there are two lanes in most streets.


In your example you would use region code 10 four times for vertical movement (Up AND down) and code 11 for horizontal movement (right AND left), because in all countries I know of the to lanes of a single road are allowed to move counter to each other at the same time...
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I got it working now.

Nah I still need 4 per intersection (because they can turn and the cars would get stuck in one another... Yes.. My traffic-light script is not so well-written...
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top