Jump to content
Rpg²S Forum
  • 0

Risoluzione mappe


PrinceEndymion88
 Share

Question

Ho trovato uno script che permette di far diventare le mappe 50x50 anzichè 20x15 in questo modo sia i tileset che i pg si vedono molto più piccoli visto che la risoluzione viene cambiata. Io vorrei sapere se esiste uno script per fare la cosa opposta ovvero diminuire la dimensione delle mappe anzichè 20x15 per esempio 10x8 così che i personaggi e tile vengono resi più grandi è possibile?

Ecco lo script per rendere le mappe 50x50

#======================================================================
# ■ Resolution
# By: Near Fantastica
# Date: 16.09.05
# Version: 2
#
# NOTE :: Add the following in the Main after begin
# Resolution.Maximize
#
#============================================================================

class Resolution
#--------------------------------------------------------------------------
# ● define constant
#--------------------------------------------------------------------------
GAME_INI_FILE = ".\\Game.ini" # define "Game.ini" file
HWND_TOPMOST = 0 # window always active
HWND_TOP = -1 # window active when used only
SWP_NOMOVE = 0 # window pos and sizes can be changed
SW_MAXIMIZE = 3
#--------------------------------------------------------------------------
# ● Resolution.GetPrivateProfileString // check your game title in Game.ini
#--------------------------------------------------------------------------
def Resolution.GetPrivateProfileString(section, key)
val = "\\"*256
gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
gps.call(section, key, "", val, 256, GAME_INI_FILE)
val.delete! ("\\")
return val
end
#--------------------------------------------------------------------------
# ● Resolution.client_size // check the window width and height
#--------------------------------------------------------------------------
def Resolution.client_size
title = Resolution.GetPrivateProfileString("Game", "Title")
findwindow = Win32API.new('user32', 'FindWindow', %w(p p), 'l')
hwnd = findwindow.call("RGSS Player", title)
rect = [0, 0, 0, 0].pack('l4')
Win32API.new('user32', 'GetClientRect', %w(l p), 'i').call(hwnd, rect)
width, height = rect.unpack('l4')[2..3]
return width, height
end
#--------------------------------------------------------------------------
# ● Resolution.client_grid // check the window width and height as grid
#--------------------------------------------------------------------------
def Resolution.client_grid
width, height = Resolution.client_size
width /= 32
height /= 32
return width, height
end
#--------------------------------------------------------------------------
# ● Resolution.maximize // Maximize Window
#--------------------------------------------------------------------------
def Resolution.maximize
# Setup
findwindow = Win32API.new('user32', 'FindWindow', %w(p p), 'l')
max = Win32API.new('user32', 'ShowWindow', 'LL', 'L')
title = Resolution.GetPrivateProfileString("Game", "Title")
hwnd = findwindow.call("RGSS Player", title)
max.call(hwnd, SW_MAXIMIZE)
end
end

#============================================================================
# ■ Game_Map
#============================================================================

class Game_Map
#--------------------------------------------------------------------------
def scroll_down(distance)
width, height = Resolution.client_grid
@display_y = [@display_y + distance, (self.height - height) * 128].min
end
#--------------------------------------------------------------------------
def scroll_right(distance)
width, height = Resolution.client_grid
@display_x = [@display_x + distance, (self.width - width) * 128].min
end
end

#============================================================================
# ■ Game_Player
#============================================================================

class Game_Player
#--------------------------------------------------------------------------
def center(x, y)
width, height = Resolution.client_grid
max_x = ($game_map.width - width) * 128
max_y = ($game_map.height - height) * 128
$game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
end
end

#============================================================================
# ■ Tilemap
#============================================================================

class Tilemap
#--------------------------------------------------------------------------
attr_accessor :tileset
attr_accessor :tileset
attr_accessor :autotiles
attr_accessor :map_data
attr_accessor :flash_data
attr_accessor :priorities
attr_accessor :visible
attr_accessor ohmy.gifx
attr_accessor ohmy.gify
#--------------------------------------------------------------------------
def initialize(viewport)
@map = []
width, height = $game_map.width * 32, $game_map.height * 32
for p in 0..2
@map[p] = Sprite.new(viewport)
@map[p].bitmap = Bitmap.new(width , height)
end
@map[0].z = 0
@map[1].z = 50
@map[2].z = 1100
@tileset_tile_width = 32
@tileset_tile_height = 32
@tileset = nil
@autotiles = []
@autotiles2 = []
@map_data = nil
@data = nil
@flash_data = nil
@priorities = nil
@visible = true
@ox = 0
@oy = 0
@offset = [0,0]
end
#--------------------------------------------------------------------------
def update
if @data != @map_data
refresh
end
if @offset != [@ox, @oy]
draw_left if @offset[0] > @ox
draw_right if @offset[0] < @ox
draw_up if @offset[1] > @oy
draw_down if @offset[1] < @oy
@offset = [@ox, @oy]
for p in 0..2
@map[p].ox, @map[p].oy = @ox, @oy
end
end
end
#--------------------------------------------------------------------------
def draw_left
x = $game_map.display_x / 128
sy = $game_map.display_y / 128
w, h = Resolution.client_grid
ey = sy + h + 1
for p in 0..5
for z in 0...@map_data.zsize
for y in sy...ey
id = @map_data[x,y,z]
next if id == nil
next if @priorities[id] != p
next if id < 48
refresh_autotiles(x,y,p,id) if id < 384
refresh_tileset(x,y,p,id) if id >= 384
end
end
end
end
#--------------------------------------------------------------------------
def draw_right
sy = $game_map.display_y / 128
w, h = Resolution.client_grid
x = $game_map.display_x / 128 + w
ey = sy + h + 1
for p in 0..5
for z in 0...@map_data.zsize
for y in sy...ey
id = @map_data[x,y,z]
next if id == nil
next if @priorities[id] != p
next if id < 48
refresh_autotiles(x,y,p,id) if id < 384
refresh_tileset(x,y,p,id) if id >= 384
end
end
end
end
#--------------------------------------------------------------------------
def draw_up
sx = $game_map.display_x / 128
w, h = Resolution.client_grid
y = $game_map.display_y / 128
ex = sx + w + 1
for p in 0..5
for z in 0...@map_data.zsize
for x in sx...ex
id = @map_data[x,y,z]
next if id == nil
next if @priorities[id] != p
next if id < 48
refresh_autotiles(x,y,p,id) if id < 384
refresh_tileset(x,y,p,id) if id >= 384
end
end
end
end
#--------------------------------------------------------------------------
def draw_down
sx = $game_map.display_x / 128
w, h = Resolution.client_grid
y = $game_map.display_y / 128 + h
ex = sx + w + 1
for p in 0..5
for z in 0...@map_data.zsize
for x in sx...ex
id = @map_data[x,y,z]
next if id == nil
next if @priorities[id] != p
next if id < 48
refresh_autotiles(x,y,p,id) if id < 384
refresh_tileset(x,y,p,id) if id >= 384
end
end
end
end
#--------------------------------------------------------------------------
def refresh
generate_autotiles2
@data = @map_data
sx = $game_map.display_x / 128
sy = $game_map.display_y / 128
w, h = Resolution.client_grid
ex = sx + w
ey = sy + h
for p in 0..5
for z in 0...@map_data.zsize
for x in sx...ex
for y in sy...ey
id = @map_data[x,y,z]
next if id == nil
next if @priorities[id] != p
next if id < 48
refresh_autotiles(x,y,p,id) if id < 384
refresh_tileset(x,y,p,id) if id >= 384
end
end
end
end
end
#--------------------------------------------------------------------------
def refresh_autotiles(x,y,p,id)
p = 2 if p > 2
if id >= 48 and id <= 95
sy = id - 48
sx = id - 48
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[0], src_rect)
elsif id >= 96 and id <= 143
sy = id - 96
sx = id - 96
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[1], src_rect)
elsif id >= 144 and id <= 191
sy = id - 144
sx = id - 144
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[2], src_rect)
elsif id >= 192 and id <= 239
sy = id - 192
sx = id - 192
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[3], src_rect)
elsif id >= 240 and id <= 287
sy = id - 240
sx = id - 240
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[4], src_rect)
elsif id >= 288 and id <= 335
sy = id - 288
sx = id - 288
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[5], src_rect)
elsif id >= 336 and id <= 383
sy = id - 336
sx = id - 336
sy /= 8
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @autotiles2[6], src_rect)
end
end
#--------------------------------------------------------------------------
def refresh_tileset(x,y,p,id)
p = 2 if p > 2
sy = id - 384
sy /= 8
sx = id - 384
sx = sx - (8 * sy)
src_rect = Rect.new(sx*32, sy*32, 32, 32)
@map[p].bitmap.blt(x*32, y*32, @tileset, src_rect)
end
#--------------------------------------------------------------------------
def dispose
for p in 0..2
@map[p].bitmap.dispose
end
end
#==========================================================================

# ■ Generates Autotiles
# By: Fuso
# Generates the tiles used by the game (can be seen in the editor by
# doubleclicking an autotile field), from the images given as
# resources.
#==========================================================================
def generate_autotiles2(ats = @autotiles, frame_id = 0)
h = @tileset_tile_height
w = @tileset_tile_width
for at in 0..6
@autotiles2[at] = Bitmap.new(@tileset_tile_width * 8, @tileset_tile_height * 6) if @autotiles2[at].nil?

break if at >= @autotiles.size
# Generate the 16 tiles containing water and a number of corners.
# Each bit in i will represent whether or not a certain corner will be filled in.
for i in 0...16
@autotiles2[at].blt(i % 8 * w, i / 8 * h, ats[at], Rect.new(frame_id * 3 * w + w, 2 * h, w, h)) if i < 15

@autotiles2[at].blt(i % 8 * w, i / 8 * h, ats[at], Rect.new(frame_id * 3 * w + 2 * w, 0, w / 2, h / 2)) if i & 0x1 == 0x1
@autotiles2[at].blt(i % 8 * w + w / 2, i / 8 * h, ats[at], Rect.new(frame_id * 3 * w + 5 * w / 2, 0, w / 2, h / 2)) if i & 0x2 == 0x2
@autotiles2[at].blt(i % 8 * w + w / 2, i / 8 * h + h / 2, ats[at], Rect.new(frame_id * 3 * w + 5 * w / 2, h / 2, w / 2, h / 2)) if i & 0x4 == 0x4
@autotiles2[at].blt(i % 8 * w, i / 8 * h + h / 2, ats[at], Rect.new(frame_id * 3 * w + 2 * w, h / 2, w / 2, h / 2)) if i & 0x8 == 0x8
end

# Generate the 16 tiles containing a certain whole strip + up to 2 corners.
# The two most signifant bits will hold the direction of the strip and the other
# two bits whether or not the remaining 2 corners will be filled in.
for i in 0...16
d = i / 4
# The strip.
#@autotiles2[at].blt(i % 8 * w + (d==3 ? w / 2 : 0), 2 * h + i / 8 * h + (d==4 ? h / 2 : 0), ats[at],
# Rect.new(d == 0 ? 0 : d == 2 ? 5 * d / 4 : d, d == 1 ? h : d == 3 ? 7 * h / 4 : 2 * h,
# (d&3 + 1) * w / 2, (4 - d&3) * h / 2))
@autotiles2[at].blt(i % 8 * w, (2 + i / 8) * h, ats[at], Rect.new(frame_id * 3 * w + d == 0 ? 0 : d == 2 ? 2 * w : w, d == 1 ? h : d == 3 ? 3 * h : 2 * h, w, h))
l1 = (d + 1)%4
l2 = (d + 2)%4
x1 = (l1 == 1 or l1 == 2) ? w / 2 : 0
x2 = (l2 == 1 or l2 == 2) ? w / 2 : 0
y1 = l1/2 * h / 2
y2 = l2/2 * h / 2
@autotiles2[at].blt(i % 8 * w + x1, (2 + i / 8) * h + y1, ats[at], Rect.new(frame_id * 3 * w + 2 * w + x1, y1, w / 2, h / 2)) if i & 0x1 == 0x1
@autotiles2[at].blt(i % 8 * w + x2, (2 + i / 8) * h + y2, ats[at], Rect.new(frame_id * 3 * w + 2 * w + x2, y2, w / 2, h / 2)) if i & 0x2 == 0x2
end

# The "double-strip" tiles.
@autotiles2[at].blt(0, 4 * h, ats[at], Rect.new(frame_id * 3 * w + 0, 2 * h, w, h))
@autotiles2[at].blt(w / 2, 4 * h, ats[at], Rect.new(frame_id * 3 * w + 5 * w / 2, 2 * h, w / 2, h))
@autotiles2[at].blt(w, 4 * h, ats[at], Rect.new(frame_id * 3 * w + w, h, w, h))
@autotiles2[at].blt(w, 4 * h + h /2, ats[at], Rect.new(frame_id * 3 * w + w, 3 * h + h / 2, w, h / 2))

for i in 0...4
@autotiles2[at].blt((2 + 2 * i)%8 * w, (4 + i/3) * h, ats[at], Rect.new(frame_id * 3 * w + ((i == 1 or i == 2) ? 2 * w : 0), ((i&2) + 1) * h, w, h))
@autotiles2[at].blt((3 + 2 * i)%8 * w, (4 + i/3) * h, ats[at], Rect.new(frame_id * 3 * w + ((i == 1 or i == 2) ? 2 * w : 0), ((i&2) + 1) * h, w, h))
l = (i + 2)%4
x = (l == 1 or l == 2) ? w / 2 : 0
y = l/2 * h / 2
@autotiles2[at].blt((3 + 2 * i)%8 * w + x, (4 + i/3) * h + y, ats[at], Rect.new(frame_id * 3 * w + 2 * w + x, y, w / 2, h / 2))
end

for i in 0...4
@autotiles2[at].blt((i + 2) * w, 5 * h, ats[at], Rect.new(frame_id * 3 * w + i/2 * 2 * w, (i == 1 or i == 2) ? 3 * h : h, w, h))
l = (i + 3) % 4
dx = (l == 3 ? w / 2 : 0)
dy = (l == 2 ? h / 2 : 0)
tx = (l < 2 ? 0 : 2 * w)
ty = (l == 0 ? 0 : l == 3 ? 0 : 2 * h)
@autotiles2[at].blt((i + 2) * w + dx, 5 * h + dy, ats[at], Rect.new(frame_id * 3 * w + tx + dx, h + ty + dy, w - l%2 * w / 2, h / 2 + l%2 * h / 2))
end

# The final two squares which is simply the upper left one and possiby a merge of the
# inner corners, we'll make them both the first tile for now.
@autotiles2[at].blt(6 * w, 5 * h, ats[at], Rect.new(0, 0, w, h))
@autotiles2[at].blt(7 * w, 5 * h, ats[at], Rect.new(0, 0, w, h))
end
end
end

#============================================================================
# ■ Spriteset_Map
#============================================================================

class Spriteset_Map
#--------------------------------------------------------------------------
def initialize
width, height = Resolution.client_size
@viewport1 = Viewport.new(0, 0, width, height)
@viewport2 = Viewport.new(0, 0, width, height)
@viewport3 = Viewport.new(0, 0, width, height)
@viewport2.z = 200
@viewport3.z = 5000
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
@fog = Plane.new(@viewport1)
@fog.z = 3000
@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))
@weather = RPG::Weather.new(@viewport1)
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
@timer_sprite = Sprite_Timer.new
update
end
end

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

non funziona neanche a me.

ho modificato 2 cosette ma continua a non funzionare.

avvio il gioco e mi si blocca subito con una finestrella popup del tipo: "il programma ha fatto una cosa che non doveva fare!" (il mio computer l'ha programmato "Don Calogero" :D)

Link to comment
Share on other sites

  • 0
hai per caso la rgss100J.dll con la versione 1.01?

Script!

 

Roba scritta, guide:

 

Applicazioni:

 

Progetti!

http://img69.imageshack.us/img69/2143/userbarctaf.png http://img641.imageshack.us/img641/5227/userbartemplateb.pnghttp://i46.tinypic.com/ac6id0.png

Link to comment
Share on other sites

  • 0

si, praticamente la prima versione della 100j (quella inclusa con il 1.01) non supporta le chiamate alle API e alle dll esterne (quindi risoluzione, schermo intero, mode07 avanzato, gioco in rete e script del genere e con file .dll nella cartella del progetto non funzionano).

 

ti conviene scaricare un altra versione della dll oppure se riesci a trovarla la nuova versione della 100j stessa perchè con altri rilasci del programma hanno sistemato questo problema ^^

 

se non funziona ancora allora il problema sta nello script

Script!

 

Roba scritta, guide:

 

Applicazioni:

 

Progetti!

http://img69.imageshack.us/img69/2143/userbarctaf.png http://img641.imageshack.us/img641/5227/userbartemplateb.pnghttp://i46.tinypic.com/ac6id0.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...