RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Mode 07 Script (Resolved)

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
A good eventer and story creator.
    I have a few things to ask

    All concerning RMXP (Postality Knights) latest edition.


  • Anyone know how to make the looped panorama scroll the other way.
  • Does anyone know how to stop the 3rd layer being visible after this script is installed?



I don't know anything about scripting, so if someone could pretty please post the script answer, i'd be very grateful (oh and where to insert it in)

Thanks for listening.

Ja ne![/list]
« Last Edit: January 17, 2007, 05:43:04 PM by Ravenshade »
Harmony before Justice,
Balance before Peace,
Order before Finality

Family Motto.

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Here is the fix for the panorama. Put it either in a new script over Main or just add it at the end of the Mode 7 script code.

Code: [Select]
#===============================================================================
# Spriteset_Map
#===============================================================================

class Spriteset_Map
 
  # alias old method
  alias upd_mode07_later update
  # redefine original method
  def update
    # execute old method
    upd_mode07_later
    # panorama moves up if player moves down/down if player moves up
    @panorama.oy = 480 - $game_map.display_y / 8
  end
 
end

NOW it will scroll correct. ::)

You want to disable the third layer? If I am not wrong you can do that by just going through the entire script and changing anywhere where you find

Code: [Select]
0..2

to either

Code: [Select]
0...2

or

Code: [Select]
0..1
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

*****
Rep:
Level 89
I'm back again. Again.
How do you know so much about scripting?

***
Rep:
Level 88
A good eventer and story creator.
Thanks muchly Blizzard, but...the second part I don't think you get (or at least, I don't get your answer)

After I did the mode07, even maps not affected by it (or shouldn't be) are affected.

---------------

I have an event on my first map that causes the screen to tint, yet everything that is on the 3rd layer shows through the tint as if it weren't even there.
Harmony before Justice,
Balance before Peace,
Order before Finality

Family Motto.

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
True, it shouldn't happen. Try this code:

Code: [Select]
=begin

Mode07 on the Map!
Includes:
    Mode07 v0.6
    Overworld Sprite Resize
  Written by mewsterus

Special Thanks:
  Fanha Giang (for a reverse engineered Tilemap class)
--------------------------------------------------------------------------------
Instructions:
--------------------------------------------------------------------------------
To install, just insert this in a descriptive code slot right above Main.
 This is different than previous instructions; please read the next paragraph.

If you had a previous install of this script and need an original version of
 Spriteset_Map, one can be found at:
 http://www.rpg-palace.com/scripts/spriteset_map.txt

To activate Mode07, add [#XX] to the map's name, replacing XX with the
 percentage of Mode07 to apply.  Greater numbers will result in a more slanted
 world.
 
To activate overworld sprite resize, add [OV] to the map's name.  This will make
 sprites smaller on that map.

For the purposes of location scripts, these identifiers will not appear.


Examples:

"Overworld[#40]" will result in a slant identical to the second screenshot.
"Underworld[OV]" will resize only the player character to a small size, as if
                 seen from high above.
"Atthelevelworld[OV][#12]" will result in the player being resized, and a modest
                           slant of 12%
"JustPlainWorld" will result in the same old map you've always seen.

To add a sky, simply use the panorama with the tileset.  Also, events will not
 be drawn flat with the map.  Any vertical objects such as trees should be put
 in events and displayed that way.

You can also add a sky by adding a fog.  If you add this, you can make it look
 like the first screenshot.

A note on the $strip_size variable; the default value is 8, however there is
 extremely minimal, almost nonexistant lag with 16. The screen is extremely
 smooth with 4, or even 2. If you're having major problems with lag, you may
 need to use 32, but it won't look too pretty.
--------------------------------------------------------------------------------
* Draw_Tilemap v1.72-0.6
Fanha Giang, 02/12/2006 (mm/dd/yyyy)
Edited for Mode07 by mewsterus 08/08/2006 (mm/dd/yyyy)
=end
#===============================================================================
$width = 640    # Screen width        (will not change resolution,
$height = 480   # Screen height        here for compatibility)
$ov_zoom = 0.6  # Overworld zoom multiplier
$strip_size = 32 # Size of each strip of the map.  Higher numbers will lag less.
                #  Recommended that this number be a power of 2.
                #  Do not make higher than 64.
$curve = true   # Whether the map is curled, for overworlds (old method)
$data_map = load_data("Data/MapInfos.rxdata")
#===============================================================================
class RPG::MapInfo
  def name # Definition prevents location scripts from reading anything within
    return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
  end
  #-----------------------------------------------------------------------------
  def original_name
    return @name
  end
  #-----------------------------------------------------------------------------
  def overworld?
    return @name.scan(/[OV]/).size > 0
  end
  #-----------------------------------------------------------------------------
  def pitch
    @name =~ /\[#[ ]*([00-99]+)\]/i
    return $1
  end
end
#===============================================================================
class Draw_Tilemap # This class controls a set of sprites, with different Z
                   #  values, arranged into horizontal bars
                   
  attr_accessor :tileset
  attr_accessor :map_data
  attr_accessor :priorities
  attr_accessor :autotiles
  attr_accessor :bitmaps
  attr_accessor :pitch
  attr_accessor :ox
  attr_accessor :oy
  attr_accessor :plus_y
  INDEX = # Autotile definitions
  [
  26, 27, 32, 33, 4,  27, 32, 33, 26, 5,  32, 33, 4,  5,  32, 33,
  26, 27, 32, 11, 4,  27, 32, 11, 26, 5,  32, 11, 4,  5,  32, 11,
  26, 27, 10, 33, 4,  27, 10, 33, 26, 5,  10, 33, 4,  5,  10, 33,
  26, 27, 10, 11, 4,  27, 10, 11, 26, 5,  10, 11, 4,  5,  10, 11,
  24, 25, 30, 31, 24, 5,  30, 31, 24, 25, 30, 11, 24, 5,  30, 11,
  14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
  28, 29, 34, 35, 28, 29, 10, 35, 4,  29, 34, 35, 4,  29, 10, 35,
  38, 39, 44, 45, 4,  39, 44, 45, 38, 5,  44, 45, 4,  5,  44, 45,
  24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
  16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4,  41, 46, 47,
  36, 37, 42, 43, 36, 5,  42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
  36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0,  1,  6,  7
  ]
  X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
  Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing;   up,    up, down,  down
  #-----------------------------------------------------------------------------
  def initialize
  # Get initial data from Game_Map
    @tileset = RPG::Cache.tileset($game_map.tileset_name)
    @map_data = $game_map.data
    @priorities = $game_map.priorities
    @autotiles = []
    for i in 0..6
      @autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
    end
  # Provide blank data in proper object form
    @ox = 0
    @oy = 0
  # Bitmaps used for each priority's drawing.  Priorities 2-5 are combined.
    @bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
                Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
                Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
  # Generate blank sprites
    @sprites = [[], [], []]
    for i in 0..2 # For each layer
      for j in 0..$game_map.height * (32 / $strip_size) - 1
      # For each horizontal strip of $strip_size height, make a blank sprite
        @sprites[i].push(Sprite.new)
        @sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
        @sprites[i][j].x = $width / 2
        @sprites[i][j].y = -64
        @sprites[i][j].z = -5 + (i * 10)
      end
    end
    @disposed = false
    draw
  end
  #-----------------------------------------------------------------------------
  def update
  # Retrieve variable values for slant drawing; these values accesible by event
    @pitch = $game_map.pitch.to_f
    @plus_y = $game_map.plus_y
    for i in 0..2 # For each layer
      for j in [0, (($height / 2) - (($height * 60) /
                @pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
                (@oy + $height) / $strip_size].min.to_i
      # For each strip within the visible screen, update OX/Y
        @sprites[i][j].x = $width / 2
        @sprites[i][j].y = j * $strip_size - @oy
        unless @pitch == 0 # Apply X Zoom
          @sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
                                  (@pitch / ($height * 25)) + 1
          if $curve # Zoom Y values same as X, and compensate
            @sprites[i][j].zoom_y = @sprites[i][j].zoom_x
            @sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
                                ((1 - @sprites[i][j].zoom_y) /
                                (2 * ((@pitch / 100) /
                                      ($height / ($strip_size * 2)))) + 0.5)
          end
       
        end
        @sprites[i][j].ox = @ox + $width / 2
      # Add plus_y value; used in airship script
        @sprites[i][j].y += @plus_y
      end
    end
  end
  #-----------------------------------------------------------------------------
  def dispose
  # Dispose all sprites
    for i in 0..2
      for j in @sprites[i]
        j.bitmap.dispose
        j.dispose
      end
    end
    for i in @bitmaps
      i.dispose
    end
    @tileset.dispose
    for i in 0..6
      @autotiles[i].dispose
    end
    @disposed = true
  end
  #-----------------------------------------------------------------------------
  def disposed?
    return @disposed
  end
  #-----------------------------------------------------------------------------
  def draw
  # Draw each individual position by XY value
    for x in 0...@map_data.xsize
      for y in 0...@map_data.ysize
        draw_position(x, y)
      end
    end
    for i in 0..2 # For each priority
      for j in 0..@sprites[i].size - 1
      # For each horizontal strip, transfer the bitmap appropriately
        @sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
            Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
      end
    end
  end
  #-----------------------------------------------------------------------------
  def draw_position(x, y)
    for layer in 0..2
      pos = @map_data[x, y, layer]
      @priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
      if pos >= 384 # If it is a tile
      # src_rect = 32x32 Rect on the tileset for source bitmap
        src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
      # Transfer source bitmap on the tileset to the current map tile
        @bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
      elsif pos >= 48 and pos < 384 # If it is an autotile
        id = pos / 48 - 1 # Which autotile is used (0-6)
      # plus_x is in development for animated autotiles
        plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
        for corner in 0..3
          h = 4 * (pos % 48) + corner # Used to access INDEX
        # src_rect = 16x16 Rect on the autotile for source bitmap
          src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
        # Transfer source bitmap on the autotile to the current 16x16 tile
          @bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
                                          @autotiles[id], src_rect)
        end
      end
    end
  end
end
#===============================================================================
class Game_Map
  attr_accessor :pitch
  attr_accessor :plus_y
  #-----------------------------------------------------------------------------
  alias setup_or :setup
  def setup(map_id)
    setup_or(map_id)
    @pitch = $data_map[$game_map.map_id].pitch
    @plus_y = 0
  end
  #-----------------------------------------------------------------------------
  def name
    return $data_map[@map_id].name
  end
end
#===============================================================================
class Sprite_Character < RPG::Sprite
  attr_accessor :character
  #-----------------------------------------------------------------------------
  def initialize(character = nil)
    super()
    @character = character
    update
  end
  #-----------------------------------------------------------------------------
  alias update_or :update
  def update
    update_or
  # Update pitch value, and update zoom values to match
    @pitch = $data_map[$game_map.map_id].pitch.to_f
    self.zoom_x =
    self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
                  (@pitch / ($height * 25)) + 1
  # Set sprite coordinates.  X value is multiplied by zoom value from the center
    self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
    self.y = @character.screen_y
  # Add Y value for zoom compensation while in curve mode
    if $curve and @pitch != 0
      self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
                (2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
    end
  # Add plus_y value; used in airship script
    self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
    self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
    if $data_map[$game_map.map_id].overworld? and
       @character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
      self.zoom_x *= $ov_zoom        #  the map is marked with [OV] and event
      self.zoom_y *= $ov_zoom        #  is a Game_Player
    end
  end
end
#===============================================================================
class Spriteset_Map
  def initialize
  # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 2000
    @viewport3.z = 5000
  # Make tilemap
    @tilemap = Draw_Tilemap.new
  # Make panorama plane
    @panorama = Plane.new
    @panorama.z = -2000
  # Make fog plane
    @fog = Plane.new
    @fog.z = 3000
  # Make character sprites
    @character_sprites = []
    for i in $game_map.events.keys.sort
      sprite = Sprite_Character.new($game_map.events[i])
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new($game_player))
  # Make weather
    @weather = RPG::Weather.new(@viewport1)
  # Make picture sprites
    @picture_sprites = []
    for i in 1..50
      @picture_sprites.push(Sprite_Picture.new(@viewport2,
                                               $game_screen.pictures[i]))
    end
  # Make timer sprite
    @timer_sprite = Sprite_Timer.new
  # Frame update
    update
  end
  #-----------------------------------------------------------------------------
  def dispose
  # Dispose of tilemap
    @tilemap.dispose
  # Dispose of panorama plane
    @panorama.dispose
  # Dispose of fog plane
    @fog.dispose
  # Dispose of character sprites
    for sprite in @character_sprites
      sprite.dispose
    end
  # Dispose of weather
    @weather.dispose
  # Dispose of picture sprites
    for sprite in @picture_sprites
      sprite.dispose
    end
  # Dispose of timer sprite
    @timer_sprite.dispose
  # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
  end
end

Only maps where you add that [#X] should be affected, not the others.

@nevfx: Many reasons:

1. I wanted to program games, since I was a kid.
2. I'm on a kind of programmer college.
3. I scripted a lot of RGSS, so I learned a lot.
4. I tried to decrease the lag from the Mode 7 script and I am familiar with it totally.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
A good eventer and story creator.
Nah same problem, i'll send over a screen shot...



Here we can see the effect quite clearly, as the screen is supposed to be tinted




This is where it is coming out of the tint.

« Last Edit: January 17, 2007, 05:03:57 PM by Ravenshade »
Harmony before Justice,
Balance before Peace,
Order before Finality

Family Motto.

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Ok, I fixed the bug and improved the code. It includes the fix I posted above already.

Code: [Select]
=begin

Mode07 on the Map!
Includes:
    Mode07 v0.61
    Overworld Sprite Resize
  Written by mewsterus
 
  bugs fixed Blizzard (v0.6 to v0.61):
  - panorama scroll correction
  - tint screen does work on events again
 
Special Thanks:
  Fanha Giang (for a reverse engineered Tilemap class)
--------------------------------------------------------------------------------
Instructions:
--------------------------------------------------------------------------------
To install, just insert this in a descriptive code slot right above Main.
 This is different than previous instructions; please read the next paragraph.

If you had a previous install of this script and need an original version of
 Spriteset_Map, one can be found at:
 http://www.rpg-palace.com/scripts/spriteset_map.txt

To activate Mode07, add [#XX] to the map's name, replacing XX with the
 percentage of Mode07 to apply.  Greater numbers will result in a more slanted
 world.
 
To activate overworld sprite resize, add [OV] to the map's name.  This will make
 sprites smaller on that map.

For the purposes of location scripts, these identifiers will not appear.


Examples:

"Overworld[#40]" will result in a slant identical to the second screenshot.
"Underworld[OV]" will resize only the player character to a small size, as if
                 seen from high above.
"Atthelevelworld[OV][#12]" will result in the player being resized, and a modest
                           slant of 12%
"JustPlainWorld" will result in the same old map you've always seen.

To add a sky, simply use the panorama with the tileset.  Also, events will not
 be drawn flat with the map.  Any vertical objects such as trees should be put
 in events and displayed that way.

You can also add a sky by adding a fog.  If you add this, you can make it look
 like the first screenshot.

A note on the $strip_size variable; the default value is 8, however there is
 extremely minimal, almost nonexistant lag with 16. The screen is extremely
 smooth with 4, or even 2. If you're having major problems with lag, you may
 need to use 32, but it won't look too pretty.
--------------------------------------------------------------------------------
* Draw_Tilemap v1.72-0.6
Fanha Giang, 02/12/2006 (mm/dd/yyyy)
Edited for Mode07 by mewsterus 08/08/2006 (mm/dd/yyyy)
=end
#===============================================================================
$width = 640    # Screen width        (will not change resolution,
$height = 480   # Screen height        here for compatibility)
$ov_zoom = 0.6  # Overworld zoom multiplier
$strip_size = 32 # Size of each strip of the map.  Higher numbers will lag less.
                #  Recommended that this number be a power of 2.
                #  Do not make higher than 64.
$curve = true   # Whether the map is curled, for overworlds (old method)
$data_map = load_data("Data/MapInfos.rxdata")
#===============================================================================
class RPG::MapInfo
  def name # Definition prevents location scripts from reading anything within
    return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
  end
  #-----------------------------------------------------------------------------
  def original_name
    return @name
  end
  #-----------------------------------------------------------------------------
  def overworld?
    return @name.scan(/[OV]/).size > 0
  end
  #-----------------------------------------------------------------------------
  def pitch
    @name =~ /\[#[ ]*([00-99]+)\]/i
    return $1
  end
end
#===============================================================================
class Draw_Tilemap # This class controls a set of sprites, with different Z
                   #  values, arranged into horizontal bars
                   
  attr_accessor :tileset
  attr_accessor :map_data
  attr_accessor :priorities
  attr_accessor :autotiles
  attr_accessor :bitmaps
  attr_accessor :pitch
  attr_accessor :ox
  attr_accessor :oy
  attr_accessor :plus_y
  INDEX = # Autotile definitions
  [
  26, 27, 32, 33, 4,  27, 32, 33, 26, 5,  32, 33, 4,  5,  32, 33,
  26, 27, 32, 11, 4,  27, 32, 11, 26, 5,  32, 11, 4,  5,  32, 11,
  26, 27, 10, 33, 4,  27, 10, 33, 26, 5,  10, 33, 4,  5,  10, 33,
  26, 27, 10, 11, 4,  27, 10, 11, 26, 5,  10, 11, 4,  5,  10, 11,
  24, 25, 30, 31, 24, 5,  30, 31, 24, 25, 30, 11, 24, 5,  30, 11,
  14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
  28, 29, 34, 35, 28, 29, 10, 35, 4,  29, 34, 35, 4,  29, 10, 35,
  38, 39, 44, 45, 4,  39, 44, 45, 38, 5,  44, 45, 4,  5,  44, 45,
  24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
  16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4,  41, 46, 47,
  36, 37, 42, 43, 36, 5,  42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
  36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0,  1,  6,  7
  ]
  X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
  Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing;   up,    up, down,  down
  #-----------------------------------------------------------------------------
  def initialize(viewport)
  # Get initial data from Game_Map
    @tileset = RPG::Cache.tileset($game_map.tileset_name)
    @map_data = $game_map.data
    @priorities = $game_map.priorities
    @autotiles = []
    for i in 0..6
      @autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
    end
  # Provide blank data in proper object form
    @ox = 0
    @oy = 0
  # Bitmaps used for each priority's drawing.  Priorities 2-5 are combined.
    @bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
                Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
                Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
  # Generate blank sprites
    @sprites = [[], [], []]
    for i in 0..2 # For each layer
      for j in 0..$game_map.height * (32 / $strip_size) - 1
      # For each horizontal strip of $strip_size height, make a blank sprite
        @sprites[i].push(Sprite.new(viewport))
        @sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
        @sprites[i][j].x = $width / 2
        @sprites[i][j].y = -64
        @sprites[i][j].z = -5 + (i * 10)
      end
    end
    @disposed = false
    draw
  end
  #-----------------------------------------------------------------------------
  def update
  # Retrieve variable values for slant drawing; these values accesible by event
    @pitch = $game_map.pitch.to_f
    @plus_y = $game_map.plus_y
    for i in 0..2 # For each layer
      for j in [0, (($height / 2) - (($height * 60) /
                @pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
                (@oy + $height) / $strip_size].min.to_i
      # For each strip within the visible screen, update OX/Y
        @sprites[i][j].x = $width / 2
        @sprites[i][j].y = j * $strip_size - @oy
        unless @pitch == 0 # Apply X Zoom
          @sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
                                  (@pitch / ($height * 25)) + 1
          if $curve # Zoom Y values same as X, and compensate
            @sprites[i][j].zoom_y = @sprites[i][j].zoom_x
            @sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
                                ((1 - @sprites[i][j].zoom_y) /
                                (2 * ((@pitch / 100) /
                                      ($height / ($strip_size * 2)))) + 0.5)
          end
       
        end
        @sprites[i][j].ox = @ox + $width / 2
      # Add plus_y value; used in airship script
        @sprites[i][j].y += @plus_y
      end
    end
  end
  #-----------------------------------------------------------------------------
  def dispose
  # Dispose all sprites
    for i in 0..2
      for j in @sprites[i]
        j.bitmap.dispose
        j.dispose
      end
    end
    for i in @bitmaps
      i.dispose
    end
    @tileset.dispose
    for i in 0..6
      @autotiles[i].dispose
    end
    @disposed = true
  end
  #-----------------------------------------------------------------------------
  def disposed?
    return @disposed
  end
  #-----------------------------------------------------------------------------
  def draw
  # Draw each individual position by XY value
    for x in 0...@map_data.xsize
      for y in 0...@map_data.ysize
        draw_position(x, y)
      end
    end
    for i in 0..2 # For each priority
      for j in 0..@sprites[i].size - 1
      # For each horizontal strip, transfer the bitmap appropriately
        @sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
            Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
      end
    end
  end
  #-----------------------------------------------------------------------------
  def draw_position(x, y)
    for layer in 0..2
      pos = @map_data[x, y, layer]
      @priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
      if pos >= 384 # If it is a tile
      # src_rect = 32x32 Rect on the tileset for source bitmap
        src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
      # Transfer source bitmap on the tileset to the current map tile
        @bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
      elsif pos >= 48 and pos < 384 # If it is an autotile
        id = pos / 48 - 1 # Which autotile is used (0-6)
      # plus_x is in development for animated autotiles
        plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
        for corner in 0..3
          h = 4 * (pos % 48) + corner # Used to access INDEX
        # src_rect = 16x16 Rect on the autotile for source bitmap
          src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
        # Transfer source bitmap on the autotile to the current 16x16 tile
          @bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
                                          @autotiles[id], src_rect)
        end
      end
    end
  end
end
#===============================================================================
class Game_Map
  attr_accessor :pitch
  attr_accessor :plus_y
  #-----------------------------------------------------------------------------
  alias setup_or :setup
  def setup(map_id)
    setup_or(map_id)
    @pitch = $data_map[$game_map.map_id].pitch
    @plus_y = 0
  end
  #-----------------------------------------------------------------------------
  def name
    return $data_map[@map_id].name
  end
end
#===============================================================================
class Sprite_Character < RPG::Sprite
  attr_accessor :character
=begin
  #-----------------------------------------------------------------------------
  def initialize(character = nil)
    super()
    @character = character
    update
  end
=end
  #-----------------------------------------------------------------------------
  alias update_or :update
  def update
    update_or
  # Update pitch value, and update zoom values to match
    @pitch = $data_map[$game_map.map_id].pitch.to_f
    self.zoom_x =
    self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
                  (@pitch / ($height * 25)) + 1
  # Set sprite coordinates.  X value is multiplied by zoom value from the center
    self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
    self.y = @character.screen_y
  # Add Y value for zoom compensation while in curve mode
    if $curve and @pitch != 0
      self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
                (2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
    end
  # Add plus_y value; used in airship script
    self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
    self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
    if $data_map[$game_map.map_id].overworld? and
       @character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
      self.zoom_x *= $ov_zoom        #  the map is marked with [OV] and event
      self.zoom_y *= $ov_zoom        #  is a Game_Player
    end
  end
end
#===============================================================================
class Spriteset_Map
 
  def initialize
  # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 2000
    @viewport3.z = 5000
  # Make tilemap
    @tilemap = Draw_Tilemap.new(@viewport1)
  # Make panorama plane
    @panorama = Plane.new
    @panorama.z = -2000
  # Make fog plane
    @fog = Plane.new
    @fog.z = 3000
  # Make character sprites
    @character_sprites = []
    for i in $game_map.events.keys.sort
      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  # Make weather
    @weather = RPG::Weather.new(@viewport1)
  # Make picture sprites
    @picture_sprites = []
    for i in 1..50
      @picture_sprites.push(Sprite_Picture.new(@viewport2,
                                               $game_screen.pictures[i]))
    end
  # Make timer sprite
    @timer_sprite = Sprite_Timer.new
  # Frame update
    update
  end
  #-----------------------------------------------------------------------------
  def dispose
  # Dispose of tilemap
    @tilemap.dispose
  # Dispose of panorama plane
    @panorama.dispose
  # Dispose of fog plane
    @fog.dispose
  # Dispose of character sprites
    for sprite in @character_sprites
      sprite.dispose
    end
  # Dispose of weather
    @weather.dispose
  # Dispose of picture sprites
    for sprite in @picture_sprites
      sprite.dispose
    end
  # Dispose of timer sprite
    @timer_sprite.dispose
  # Dispose of viewports
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
  end
 
  # alias old method
  alias upd_mode07_later update
  # redefine original method
  def update
    # execute old method
    upd_mode07_later
    # panorama moves up if player moves down/down if player moves up
    @panorama.oy = 480 - $game_map.display_y / 8
  end
 
end
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
A good eventer and story creator.
Awesome!

Time to mark as resolved. Thankyou very much Blizzard, you've been a great help!
Harmony before Justice,
Balance before Peace,
Order before Finality

Family Motto.