|
| [SOLVED] map | |
| | Pengirim | Message |
---|
stefen Newbie
Posts : 2 Thanked : 0 Engine : RMVX Skill : Beginner Type : Mapper
| Subyek: [SOLVED] map 2010-12-03, 07:19 | |
| senior senior saya mau tanya nih,,saya sudah buat map di rpgxp,dan kalo saya mau ambil gambar map itu gmn??masa harus di print screen??apa nda ada cara buat ambil gambar map secara penuh yah,,
mohon bantuannya,, thx
| |
| | | eve Loli Mecha Mesum Musume
Posts : 1620 Thanked : 30 Engine : Other Skill : Beginner Type : Writer
Trophies
Awards:
| Subyek: Re: [SOLVED] map 2010-12-03, 07:32 | |
| via script sepertinya bisa (referensi dari script nya gubids).,., tapi wa juga kurang tau apa ada yg bikin scriptnya atau nda.,.,
untuk sekarang printscreen aja. | |
| | | stefen Newbie
Posts : 2 Thanked : 0 Engine : RMVX Skill : Beginner Type : Mapper
| Subyek: Re: [SOLVED] map 2010-12-03, 07:38 | |
| oke thx kk atas bantuannya hohohoh,, | |
| | | eve Loli Mecha Mesum Musume
Posts : 1620 Thanked : 30 Engine : Other Skill : Beginner Type : Writer
Trophies
Awards:
| Subyek: Re: [SOLVED] map 2010-12-03, 07:40 | |
| sepertinya ada script buat yg kaya gini.,., si chika kayaknya pegang tuh script.,., tunggu dia aja | |
| | | shikami Member 1000 Konsep
Posts : 3744 Thanked : 31 Engine : Multi-Engine User Skill : Beginner Type : Developer
Trophies
Awards:
| Subyek: Re: [SOLVED] map 2010-12-03, 07:45 | |
| - Spoiler:
- Code:
-
#======================================================================
# ** Map Screenshot Maker #------------------------------------------------------------------------------ # SephirothSpawn # Version 1.1 # 2007-07-21 # SDK : Version 2.0+, Part I #------------------------------------------------------------------------------ # * Version History : # # Version 1 ---------------------------------------------------- (2007-07-20) # Version 1.1 ------------------------------------------------- (2007-07-21) # - Update : Made it so it saves multiple png files for bigger maps. # Version 1.1.1 -Brew -------------------- (25Mar08) # - Fixed sprite position. Added 'Q' button option with autoname # 'mapname'.png, removed SDK dependence. #------------------------------------------------------------------------------ # * Requirements : # # Method & Class Library (2.1+) #------------------------------------------------------------------------------ # * Description : # # This script was designed to allow you to make a single screenshot of your # entire map. In constructions a still image of the tilemap, panorama, fog, # event and player sprites, weather, picture sprites and the timer. It then # exports the files to a filename you specify, and saves it in PNG format. #------------------------------------------------------------------------------ # * Instructions : # # Place The Script Below Scene_Debug and Above Main. # # To make a screenshot, use: MapScreenshotMaker.take(filename) # Or hit the 'Q' button while on a map. # #------------------------------------------------------------------------------ # * Syntax : # # Taking Map Screenshot # - MapScreenshotMaker.take(filename, dir) # # You do not need to specify filename, as it defaults to a 'Test.png' # You do not need to specify dir, as it defaults to 'Graphics/Saved Images' # The extension .png does not need to be included in the filename. #------------------------------------------------------------------------------ # * Special Thanks : # # Prexus, for requesting and beta testing #==============================================================================
#------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ #SDK.log('Map Screenshot Maker', 'SephirothSpawn', 1.1, '2007-07-21') #SDK.check_requirements(2.0, [], {'Method & Class Library' => 2.1})
#------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ #if SDK.enabled?('Map Screenshot Maker')
#============================================================================== # ** Spriteset_Map #==============================================================================
class Spriteset_Map #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :tilemap attr_reader :panorama attr_reader :fog attr_reader :character_sprites attr_reader :weather attr_reader :picture_sprites attr_reader :timer_sprite end
#============================================================================== # ** Scene_Map #==============================================================================
class Scene_Map #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :spriteset
alias screenshot_update update
def initialize $data_mapinfo = load_data("Data/MapInfos.rxdata") end
def update if Input.trigger?(Input::L) #make filename from map name filename = $data_mapinfo[$game_map.map_id].name #take the shot MapScreenshotMaker.take(filename) #show message that it finished print "Saved " + filename + ".png" end screenshot_update end end
#============================================================================== # ** RPG::Weather #==============================================================================
class RPG::Weather #-------------------------------------------------------------------------- # * Bitmap #-------------------------------------------------------------------------- def bitmap # Create Bitmap bitmap = Bitmap.new(640, 480) # Pass Through @sprites @sprites.each do |sprite| next unless sprite.visible next if sprite.bitmap.nil? bitmap.blt(sprite.x, sprite.y, sprite.bitmap, sprite.bitmap.rect) end # Return Bitmap return bitmap end end
#============================================================================== # ** MapScreenshotMaker #==============================================================================
module MapScreenshotMaker #-------------------------------------------------------------------------- # * Max Image Size #-------------------------------------------------------------------------- Max_Image_Size = nil #-------------------------------------------------------------------------- # * Take #-------------------------------------------------------------------------- # def self.take(filename = 'Map Screenshot', dir = 'Graphics/Saved Images/') def self.take(filename = 'Map Screenshot', dir = '') # Return If Not Map Scene return unless $scene.is_a?(Scene_Map) # Gets Spriteset spriteset = $scene.spriteset # Create Bitmap bitmap = Bitmap.new($game_map.width * 32, $game_map.height * 32) # Draw Chracter Sprites self.draw_character_sprites(bitmap, spriteset, 'sprite.z >= -1000') # Draw Panorama if spriteset.panorama.visible if spriteset.panorama.bitmap != nil b = spriteset.panorama.bitmap opacity = spriteset.panorama.opacity x_times = (bitmap.rect.width / b.rect.width.to_f) x_times = x_times.ceil == x_times.to_i ? x_times.to_i : x_times.to_i + 1 y_times = (bitmap.rect.width / b.rect.width.to_f) y_times = y_times.ceil == y_times.to_i ? y_times.to_i : y_times.to_i + 1 self.tile_bitmap(bitmap, b, x_times, y_times, opacity) end end # Draw Chracter Sprites c = '!sprite.z.between?(-1000, -1)' self.draw_character_sprites(bitmap, spriteset, c) # Draw Layer 1 self.draw_tilemap_layer(bitmap, spriteset, 0) # Draw Chracter Sprites c = '!sprite.z.between?(0, 149)' self.draw_character_sprites(bitmap, spriteset, c) # Draw Layer 2 self.draw_tilemap_layer(bitmap, spriteset, 1) # Draw Chracter Sprites c = '!sprite.z.between?(150, 299)' self.draw_character_sprites(bitmap, spriteset, c) # Draw Layer 3 self.draw_tilemap_layer(bitmap, spriteset, 2) # Draw Chracter Sprites c = '!sprite.z.between?(300, 999)' self.draw_character_sprites(bitmap, spriteset, c) # Draw Weather Sprite x_times = (bitmap.rect.width / 640.0) x_times = x_times.ceil == x_times.to_i ? x_times.to_i : x_times.to_i + 1 y_times = (bitmap.rect.width / 480.0) y_times = y_times.ceil == y_times.to_i ? y_times.to_i : y_times.to_i + 1 self.tile_bitmap(bitmap, spriteset.weather.bitmap, x_times, y_times) # Draw Chracter Sprites c = '!sprite.z.between?(1000, 2999)' self.draw_character_sprites(bitmap, spriteset, c) # Draw Fog Sprite if spriteset.fog.visible if spriteset.fog.bitmap != nil b = spriteset.fog.bitmap opacity = spriteset.fog.opacity x_times = (bitmap.rect.width / b.rect.width.to_f) x_times = x_times.ceil == x_times.to_i ? x_times.to_i : x_times.to_i + 1 y_times = (bitmap.rect.width / b.rect.width.to_f) y_times = y_times.ceil == y_times.to_i ? y_times.to_i : y_times.to_i + 1 self.tile_bitmap(bitmap, b, x_times, y_times, opacity) end end # Draw Chracter Sprites self.draw_character_sprites(bitmap, spriteset, 'sprite.z < 3000') # Draw Picture Sprites self.draw_picture_sprites(bitmap, spriteset, 'sprite.z >= 500') # Draw Sprite Timer if spriteset.timer_sprite.visible if spriteset.timer_sprite.bitmap != nil self.blt(spriteset.timer_sprite.x, spriteset.timer_sprite.y, spriteset.timer_sprite.bitmap, spriteset.timer_sprite.opacity) end end # Draw Picture Sprite self.draw_picture_sprites(bitmap, spriteset, 'sprite.z < 500') # Save Bitmap if Max_Image_Size != nil && (bitmap.rect.width > Max_Image_Size || bitmap.rect.height > Max_Image_Size) # Gets X & Y Max Times x_times = (bitmap.rect.width / Max_Image_Size.to_f) x_times = x_times.ceil == x_times.to_i ? x_times.to_i : x_times.to_i + 1 y_times = (bitmap.rect.width / Max_Image_Size.to_f) y_times = y_times.ceil == y_times.to_i ? y_times.to_i : y_times.to_i + 1 # Split Up Bitmap Into Sections for x in 0...x_times for y in 0...y_times # Get src rect src_rect = Rect.new(x * Max_Image_Size, y * Max_Image_Size, [bitmap.rect.width - x * Max_Image_Size, Max_Image_Size].min, [bitmap.rect.height - y * Max_Image_Size, Max_Image_Size].min) # Creates New Bitmap b = Bitmap.new(src_rect.width, src_rect.height) b.blt(0, 0, bitmap, src_rect) # Saves Bitmap b.make_png("#{filename}_#{x}-#{y}", dir) # Update Graphics Module Graphics.update end end # If Within Max Size else # Saves Bitmap bitmap.make_png(filename, dir) end end #-------------------------------------------------------------------------- # * Tile Bitmap #-------------------------------------------------------------------------- def self.tile_bitmap(main, sub, x_times, y_times, a = 255) for x in 0...x_times for y in 0...y_times main.blt(x * sub.rect.width, y * sub.rect.height, sub, sub.rect, a) end end end #-------------------------------------------------------------------------- # * Draw Character Sprites #-------------------------------------------------------------------------- def self.draw_character_sprites(bitmap, spriteset, c) # Pass Through Character Sprites spriteset.character_sprites.each do |sprite| # Skip If Not Visible or Nil Bitmap next if sprite.visible == false || sprite.bitmap.nil? # Skip If Condition next if (eval c) # Draw Sprite On Bitmap xoff = sprite.bitmap.width / 8 - ($game_map.display_x / 4) yoff = sprite.bitmap.height / 4 - ($game_map.display_y / 4) bitmap.blt(sprite.x - xoff, sprite.y - yoff, sprite.bitmap, sprite.src_rect, sprite.opacity) end end #-------------------------------------------------------------------------- # * Draw Picture Sprites #-------------------------------------------------------------------------- def self.draw_picture_sprites(bitmap, spriteset, c) # Pass Through Character Sprites spriteset.picture_sprites.each do |sprite| # Skip If Not Visible or Nil Bitmap next if sprite.visible == false || sprite.bitmap.nil? # Skip If Condition next if (eval c) # Draw Sprite On Bitmap bitmap.blt(sprite.x, sprite.y, sprite.bitmap, sprite.src_rect, sprite.opacity) end end #-------------------------------------------------------------------------- # * Draw Tilemap Layer #-------------------------------------------------------------------------- def self.draw_tilemap_layer(bitmap, spriteset, layer) # Get Map Data & Priorities map_data = $game_map.data priorities = $game_map.priorities tileset = $game_map.tileset_name autotiles = $game_map.autotile_names # Passes Through Layers for z in 0...map_data.zsize # Passes Through X Coordinates for x in 0...map_data.xsize # Passes Through Z Coordinates for y in 0...map_data.ysize # Collects Tile ID id = map_data[x, y, z] # Skip if 0 tile next if id == 0 # Get Tile Priority p = priorities[id] # Cap Priority to Layer 3 p = 2 if p = 2 # Next If P isn't layer id next if p != layer # Draw Tile if id < 384 # Gets Autotile Filename filename = autotiles[id / 48 - 1] # Reconfigure Tile ID id %= 48 # Gets Generated Autotile Bitmap Section b = RPG::Cache.autotile_tile(filename, id, 0) # Draw Tile bitmap.blt(x * 32, y * 32, b, Rect.new(0, 0, 32, 32)) # Draw Normal Tile else # Gets Tile Bitmap b = RPG::Cache.tile(tileset, id, 0) # Draws Tile bitmap.blt(x * 32, y * 32, b, Rect.new(0, 0, 32, 32)) end end end end end end
class Bitmap #------------------------------------------------------------------------- # * Name : Make PNG # Info : Saves Bitmap to File # Author : ??? - http://www.66rpg.com/htm/news624.htm # Call Info : Zero to Three Arguments # Name : Name of filenam # Path : Directory in Game Folder # Mode : Mode of Writing #------------------------------------------------------------------------- def make_png(name = 'like', path = '', mode = 0) # Dir.make_dir(path) if path != '' Zlib::Png_File.open('temp.gz') { |gz| gz.make_png(self, mode) } Zlib::GzipReader.open('temp.gz') { |gz| $read = gz.read } f = File.open(path + name + '.png', 'wb') f.write($read) f.close File.delete('temp.gz') end end
#============================================================================== # ** Modules.Zlib #------------------------------------------------------------------------------ # Description: # ------------ # Adds PNG_File class to save Bitmap's to PNG Files # # Class List: # ----------- # Png_File #============================================================================== module Zlib #============================================================================ # ** Png_File #============================================================================
class Png_File < GzipWriter #-------------------------------------------------------------------------- # * Make PNG #-------------------------------------------------------------------------- def make_png(bitmap, mode = 0) # Save Bitmap & Mode @bitmap, @mode = bitmap, mode # Create & Save PNG self.write(make_header) self.write(make_ihdr) self.write(make_idat) self.write(make_iend) end #-------------------------------------------------------------------------- # * Make Header #-------------------------------------------------------------------------- def make_header return [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a].pack('C*') end #-------------------------------------------------------------------------- # * Make IHDR #-------------------------------------------------------------------------- def make_ihdr ih_size = [13].pack("N") ih_sign = 'IHDR' ih_width = [@bitmap.width].pack('N') ih_height = [@bitmap.height].pack('N') ih_bit_depth = [8].pack('C') ih_color_type = [6].pack('C') ih_compression_method = [0].pack('C') ih_filter_method = [0].pack('C') ih_interlace_method = [0].pack('C') string = ih_sign + ih_width + ih_height + ih_bit_depth + ih_color_type + ih_compression_method + ih_filter_method + ih_interlace_method ih_crc = [Zlib.crc32(string)].pack('N') return ih_size + string + ih_crc end #-------------------------------------------------------------------------- # * Make IDAT #-------------------------------------------------------------------------- def make_idat header = "\x49\x44\x41\x54" data = @mode == 0 ? make_bitmap_data0 : make_bitmap_data1 data = Zlib::Deflate.deflate(data, 8) crc = [Zlib.crc32(header + data)].pack('N') size = [data.length].pack('N') return size + header + data + crc end #-------------------------------------------------------------------------- # * Make Bitmap Data 0 #-------------------------------------------------------------------------- def make_bitmap_data0 gz = Zlib::GzipWriter.open('hoge.gz') t_Fx = 0 w = @bitmap.width h = @bitmap.height data = [] for y in 0...h data.push(0) for x in 0...w t_Fx += 1 if t_Fx % 10000 == 0 Graphics.update end if t_Fx % 100000 == 0 s = data.pack("C*") gz.write(s) data.clear end color = @bitmap.get_pixel(x, y) red = color.red green = color.green blue = color.blue alpha = color.alpha data.push(red) data.push(green) data.push(blue) data.push(alpha) end end s = data.pack("C*") gz.write(s) gz.close data.clear gz = Zlib::GzipReader.open('hoge.gz') data = gz.read gz.close File.delete('hoge.gz') return data end #-------------------------------------------------------------------------- # * Make Bitmap Data Mode 1 #-------------------------------------------------------------------------- def make_bitmap_data1 w = @bitmap.width h = @bitmap.height data = [] for y in 0...h data.push(0) for x in 0...w color = @bitmap.get_pixel(x, y) red = color.red green = color.green blue = color.blue alpha = color.alpha data.push(red) data.push(green) data.push(blue) data.push(alpha) end end return data.pack("C*") end #-------------------------------------------------------------------------- # * Make IEND #-------------------------------------------------------------------------- def make_iend ie_size = [0].pack('N') ie_sign = 'IEND' ie_crc = [Zlib.crc32(ie_sign)].pack('N') return ie_size + ie_sign + ie_crc end end end
#============================================================================== # ** RPG::Cache #==============================================================================
module RPG::Cache #-------------------------------------------------------------------------- # * Auto-Tiles #-------------------------------------------------------------------------- Autotiles = [ [[27, 28, 33, 34], [ 5, 28, 33, 34], [27, 6, 33, 34], [ 5, 6, 33, 34], [27, 28, 33, 12], [ 5, 28, 33, 12], [27, 6, 33, 12], [ 5, 6, 33, 12]], [[27, 28, 11, 34], [ 5, 28, 11, 34], [27, 6, 11, 34], [ 5, 6, 11, 34], [27, 28, 11, 12], [ 5, 28, 11, 12], [27, 6, 11, 12], [ 5, 6, 11, 12]], [[25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12]], [[29, 30, 35, 36], [29, 30, 11, 36], [ 5, 30, 35, 36], [ 5, 30, 11, 36], [39, 40, 45, 46], [ 5, 40, 45, 46], [39, 6, 45, 46], [ 5, 6, 45, 46]], [[25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [ 5, 42, 47, 48]], [[37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [ 1, 2, 7, 8]] ] #-------------------------------------------------------------------------- # * Autotile Cache # # @autotile_cache = { # filename => { [autotile_id, frame_id, hue] => bitmap, ... }, # ... # } #-------------------------------------------------------------------------- @autotile_cache = {} #-------------------------------------------------------------------------- # * Autotile Tile #-------------------------------------------------------------------------- def self.autotile_tile(filename, tile_id, hue = 0, frame_id = nil) # Gets Autotile Bitmap autotile = self.autotile(filename) # Configures Frame ID if not specified if frame_id.nil? # Animated Tiles frames = autotile.width / 96 # Configures Animation Offset fc = Graphics.frame_count / 16 frame_id = (fc) % frames * 96 end # Creates list if already not created @autotile_cache[filename] = {} unless @autotile_cache.has_key?(filename) # Gets Key key = [tile_id, frame_id, hue] # If Key Not Found unless @autotile_cache[filename].has_key?(key) # Reconfigure Tile ID tile_id %= 48 # Creates Bitmap bitmap = Bitmap.new(32, 32) # Collects Auto-Tile Tile Layout tiles = Autotiles[tile_id / 8][tile_id % 8] # Draws Auto-Tile Rects for i in 0...4 tile_position = tiles[i] - 1 src_rect = Rect.new(tile_position % 6 * 16 + frame_id, tile_position / 6 * 16, 16, 16) bitmap.blt(i % 2 * 16, i / 2 * 16, autotile, src_rect) end # Saves Autotile to Cache @autotile_cache[filename][key] = bitmap # Change Hue @autotile_cache[filename][key].hue_change(hue) end # Return Autotile return @autotile_cache[filename][key] end #------------------------------------------------------------------------- # * Name : Gradient # Info : Loads A Gradient Bar # Author : Trickster # Call Info : One to Two Arguments # String filename of Bar to load # Integer hue - hue displacement # Comment : Files are to be located in Graphics/Gradients #------------------------------------------------------------------------- def self.gradient(filename, hue = 0) self.load_bitmap("Graphics/Gradients/", filename, hue) end end #-------------------------------------------------------------------------- # * End SDK Enable Test #------------------------------------------------------
scriptnya sih ada... ( credit :sephirotspawn) cuma banyak yg ngeluh ..krn error atau gimana lah | |
| | | Vsio Xutix Xox
Posts : 2377 Thanked : 18 Engine : Multi-Engine User Skill : Advanced Type : Developer
| Subyek: Re: [SOLVED] map 2010-12-10, 21:19 | |
| Locked since solved. Contact if any unanswered related question occurs. | |
| | | Sponsored content
| Subyek: Re: [SOLVED] map | |
| |
| | | | [SOLVED] map | |
|
Similar topics | |
|
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
| Latest topics | » [Web Novel] Gloria Infidelis by LightNightKnight 2016-11-17, 21:27
» [Announcement] Forum baru untuk RMID by TheoAllen 2016-08-25, 16:39
» Where I'm Wrong ? by ReydVires 2016-07-24, 16:10
» flakeheartnet's Resources part III by flakeheartnet 2016-07-08, 14:30
» Keira's Art Warehouse by KeiraBlaze 2016-06-28, 19:27
» Theo Core Time System + Bingung by Lockin 2016-06-27, 16:24
» Error Script, Maybe ? by Lockin 2016-06-27, 16:20
» Nusaimoe @ RMID Lounge by Jihad Bagas 2016-06-21, 05:02
» Call Random Battle by Lockin 2016-06-15, 17:04
» Flakeheartnet Resources Part II [come back gift] by flakeheartnet 2016-06-07, 15:51
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|