Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Region Codes for Map Transitions. (Map Recycler)

Save-Point

Full Version: Region Codes for Map Transitions. (Map Recycler)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, so here's the request. I want to be able to reuse/recycle maps, under LOCATION codes and variables, so that for instance, map 39 in one location may have wolves and a halway going to the north to Map 40, but in another location, it has bandit thiefs, and the hallway goes to Map 42.

Basically, would like to simply have a notation of Location on like a game variable or something, so that I can reference it completely. Not sure if the Regions from MapLinks 2.0 can accomplish all this for me, as it would appear that it map links directly from one to the other. with no way to 'change' a region code, at least that I could see.

If someone wanted to take a look at the save-point.org Map Links Script, I think it could be set up to allow for the same maps to be used over and over again, with different and seperate REGION codes. If anyone of you has any ideas on a good quick (and somewhat easy way to do this, please let me know)
JayRay? Had you been using normal 'teleport' events, you could just do it this way as a complex script isn't really necessary.

Content Hidden

BUT, I take it you mean to use Icarus's system. Hm... that's gonna need a little more work... likely to institute an addition to his setup method shown below:
Code:
#--------------------------------------------------------------------------
  # * Setup Regional Data
  #--------------------------------------------------------------------------
  def setup
    # Region['Field']
    maps = Object_Table.new(4, 4)
    maps[0,0], maps[1,0], maps[2,0], maps[3,0] =  1,  2,  3,  4
    maps[0,1], maps[1,1], maps[2,1], maps[3,1] =  5,  6,  6,  7
    maps[0,2], maps[1,2], maps[2,2], maps[3,2] =  8,  6,  6,  9
    maps[0,3], maps[1,3], maps[2,3], maps[3,3] = 10, 10, 10, 10
    Region.new('Field', maps, [15])
    # Region['Name']
    # etc.
    update
  end
If it is here where it places you within the maps (as designated by the map IDs from 1 to 10), then it would be here I would set some sort of feature to recognize some sort of optional event affecting variable.

RUDIMENTARY CHANGES to MapLinks script:
Code:
#--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @region_flag_map = {}
    @coordinates = []
    @dimentions = []
    @regions = {}
    @region = nil
  end
* Added @region_flag_map == {} to make a cheapo hash array

Code:
def setup
    # Region['Field']
    maps = Object_Table.new(4, 4)
    
    maps[0,0], maps[1,0], maps[2,0], maps[3,0] =  1,  2,  3,  4
    maps[0,1], maps[1,1], maps[2,1], maps[3,1] =  5,  6,  6,  7
    maps[0,2], maps[1,2], maps[2,2], maps[3,2] =  8,  6,  6,  9
    maps[0,3], maps[1,3], maps[2,3], maps[3,3] = 10, 10, 10, 10
    Region.new('Field', maps, [15])
    # Region['Name']
    # etc.
    
    # Set variable to 1 for map [1,1].  MUST use a string for the hash key.
    @region_flag_map["[1,1]"] = 1
    
    update
  end
* Added the @region_map_flag value for the map [1,1]. It assumes that when you exit this map, you have a region flag of '1' that is turned on. It's a simple thing, and doesn't care which direction you head. This can be later touched up by getting the player's direction I guess. Winking Any maps that are not set up here are assumed to have no (or 'nil') values.

Code:
#--------------------------------------------------------------------------
  # * Maplink Transfer
  #--------------------------------------------------------------------------
  def transfer
    key = "["+@region.grid[0].to_s+","+@region.grid[1].to_s+"]"
    variable_sucker = @region_flag_map[key]
    $game_variables[1] = 0
    $game_variables[1] = variable_sucker if variable_sucker != nil
    
    $game_temp.maplink = false
    $game_temp.player_transferring = true
    # If region is set to fade between maps
    if @region.fade
      # Prepare for Transition
      Graphics.freeze
      $game_temp.transition_processing = true
      $game_temp.transition_name = ""
    end
  end
Okay, I had to read the actual map you were leaving (@region.grid), and convert it into a string so it could be used as a 'key' for the @region_flag_map hash. Once read, it looks to see that it is a valid value and pushes it into a $game_variables value. If there isn't any, it assumes the value is '0' so no crashing occurs.

That may be useful as a start. I know you like to tweak things on your own. Winking with a tongue sticking out

*EDIT*
I also added an event in map 10. It is a simple event with a 'save crystal' graphic, and has a condition: Variable: 001:RegionFlag is '1' or above.

This graphic only shows when the variable of 'RegionFlag' is set to 1. If you come from the map with the grid setting of [1,1] 'down' into it, the variable is turned on and the event will show. But if you enter from another map into map 10, the variable will be set to '0' and the event will not show.