赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 11 |
经验 | 3139 |
最后登录 | 2017-8-24 |
在线时间 | 226 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1085
- 在线时间
- 226 小时
- 注册时间
- 2010-4-16
- 帖子
- 87
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 as853484572 于 2011-7-7 17:45 编辑
现有RPGXP专案改用RGSS2运行库的方法
2008年08月26日 20:10
引用通告[英文]: http://rmxp.org/forums/index.php?topic=34903.0
本教程只适合RPGXP1.02a英文版,如果你用的是别的版本的话,下文有专门的说明
本文作者Dargor,我只是翻译而已,适当地插入了一些本人的主观语句。
------------------------------------------------------------------------------------------
首先,你需要手头拥有RPG MAKER VX才行。
RGSS2是RGSS第一代的增强版本,用于RPG MAKER VX。
[快去汉化新世纪下载RPGVX汉化版吧(注意版本是1.02.0824)。]
你希望用RPGXP做出的游戏能达到完美流畅的60fps且不卡机不提示脚本备份么?
你希望直接随心所欲在640*480范围内自定义显示分辨率而不用龙蛇混杂的API么?
你希望在RPGXP中用上RPGVX全新的Graphics模块的功能么?
你希望在RPGXP中实现图像模糊、波形等特效而不用专门用长篇脚本拖慢CPU么?
你还可望在RPGXP上实现别的RGSS2特有的功能么?
本教程专门为你量身定做,
你只需把现有的游戏专案按照下面的几个步骤处理即可。
第一步 - RTP
若你用到了默认的RTP素材,请将这些素材全部拷贝到你的游戏专案目录中。
第二步 - Game.exe可执行文件 和 RGSS2运行库
一)把你的默认的Game.exe换成RPGVX所用的Game.exe
二)把RGSS2运行库RGSS202E.dll拷贝到你的游戏专案文件夹下并重命名为RGSS102E.dll
[RPGXP的娱乐通版和莫尼卡1.02版、1.02日文零售版的用户请重命名为RGSS102J.dll]
[RPGXP的莫尼卡1.03版、1.03日文零售版的用户请重命名为RGSS103J.dll]
第三步 - 脚本
由于RGSS运行库被替换成了RGSS2运行库,所以一切RPGXP的内建类/方法需要重新建立/定义。
一)打开 RPG MAKER XP
二)打开帮助文档 (F1)
三)打开 Script Editor (脚本编辑器)(F11),在所有脚本页之前新建一个脚本页
四)从 RGSS Reference Manual (RGSS脚本参考)复制所有RPG模块的脚本定义至脚本编辑器的方才新建的脚本页中。(确保该脚本页被放在所有默认脚本页的前面)
要紧的废话一句:
英文、日文、日译帮助文档中关于RPG::MoveCommand的脚本定义有误[原RGSS1运行库中的实际定义没有这个错误]。
被写成了这样:- module RPG
- class MoveCommand(code = 0, parameters = [])
- def initialize
- @code = code
- @parameters = parameters
- end
- attr_accessor :code
- attr_accessor :parameters
- end
- end
复制代码 实际上是这样[注意initialize字段]:- module RPG
- class MoveCommand
- def initialize(code = 0, parameters = [])
- @code = code
- @parameters = parameters
- end
- attr_accessor :code
- attr_accessor :parameters
- end
- end
复制代码 看来Enterbrain在RPGXP的马虎方面丝毫不逊色于RPGVX,纯引用某人的话:真该打PP。
五)在脚本编辑器中按Ctrl+Shift+F,搜索“$DEBUG”,全部替换为“$TEST”,严格区分大小写。
六)重定义TILEMAP。
由于帮助文档里关于TILEMAP没有任何代码说明,所以这里借用一下外国网站上的重定义的优化的TILEMAP脚本。
[注意,这里用的是Poccil写的脚本,不要用SephirothSpawn写的脚本,因为RGSS2无法操控大于2048*2048像素的Bitmap对象,这里用SephirothSpawn写的脚本会出现规格大于64*64的地图无法正常加载的问题,而用Poccil的脚本则恰好解决了这个问题]
把下面的脚本插入于之前重定义的RPG对象所在的脚本页之后、Game_Temp脚本页之前。
[原文说的是插入于main脚本之前(中间不间隔任何脚本页),当然按照我说的方法也可以]
- class CustomTilemapAutotiles
- attr_accessor :changed
- def initialize
- @changed=true
- @tiles=[nil,nil,nil,nil,nil,nil,nil]
- end
- def []=(i,value)
- @tiles[i]=value
- @changed=true
- end
- def [](i)
- return @tiles[i]
- end
- end
- class Tilemap
- Animated_Autotiles_Frames = 15
- 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] ]
- ]
- FlashOpacity=[100,90,80,70,80,90]
- attr_reader :tileset
- attr_reader :autotiles
- attr_reader :map_data
- attr_accessor :flash_data
- attr_accessor :priorities
- attr_reader :visible
- attr_accessor :ox
- attr_accessor :oy
- attr_reader :viewport
- def initialize(viewport)
- @tileset = nil # Refers to Map Tileset Name
- @autotiles = CustomTilemapAutotiles.new
- @map_data = nil # Refers to 3D Array Of Tile Settings
- @flash_data = nil # Refers to 3D Array of Tile Flashdata
- @priorities = nil # Refers to Tileset Priorities
- @visible = true # Refers to Tileset Visibleness
- @ox = 0 # Bitmap Offsets
- @oy = 0 # bitmap Offsets
- @plane = false
- @selfviewport=Viewport.new(0,0,640,480)
- @viewport=viewport ? viewport : @selfviewport
- @tiles=[]
- @autotileInfo=[]
- @regularTileInfo=[]
- @oldOx=0
- @oldOy=0
- @layer0=Sprite.new(viewport)
- @layer0.visible=true
- @nowshown=false
- @layer0.bitmap=Bitmap.new(@viewport.rect.width*2,@viewport.rect.height*2)
- @flash=nil
- @layer0.ox=0
- @layer0.oy=0
- @oxLayer0=0
- @oyLayer0=0
- @oxFlash=0
- @oyFlash=0
- @layer0.z=0
- @priotiles=[]
- @prioautotiles=[]
- @autosprites=[]
- @framecount=[]
- @tilesetChanged=true
- @flashChanged=false
- @firsttime=true
- @disposed=false
- @usedsprites=false
- @layer0clip=true
- @firsttimeflash=true
- @fullyrefreshed=false
- @fullyrefreshedautos=false
- end
- def disposed?
- return @disposed
- end
- def flash_data=(value)
- @flash_data=value
- @flashChanged=true
- end
- def update
- if @autotiles.changed
- refresh_autotiles
- repaintAutotiles
- end
- if @flashChanged
- refresh_flash
- end
- if @tilesetChanged
- refresh_tileset
- end
- if @flash
- @flash.opacity=FlashOpacity[(Graphics.frame_count/2) % 6]
- end
- if !(@oldOx==@ox && @oldOy==@oy &&
- !@tilesetChanged &&
- [email protected])
- refresh
- end
- if (Graphics.frame_count % Animated_Autotiles_Frames == 0) || @nowshown
- repaintAutotiles
- refresh(true)
- end
- @nowshown=false
- @autotiles.changed=false
- @tilesetChanged=false
- end
- def priorities=(value)
- @priorities=value
- @tilesetChanged=true
- end
- def tileset=(value)
- @tileset=value
- @tilesetChanged=true
- end
- def shown?
- return false if !@visible
- ysize=@map_data.ysize
- xsize=@map_data.xsize
- xStart=(@ox/32)-1
- xEnd=((@[email protected])/32)+1
- yStart=(@oy/32)-1
- yEnd=((@[email protected])/32)+1
- xStart=0 if xStart<0
- xStart=xsize-1 if xStart>=xsize
- xEnd=0 if xEnd<0
- xEnd=xsize-1 if xEnd>=xsize
- yStart=0 if yStart<0
- yStart=ysize-1 if yStart>=ysize
- yEnd=0 if yEnd<0
- yEnd=ysize-1 if yEnd>=ysize
- return (xStart<xEnd && yStart<yEnd)
- end
- def dispose
- return if disposed?
- @help.dispose if @help
- @help=nil
- i=0;[email protected];while i<len
- if @autotileInfo[i]
- @autotileInfo[i].dispose
- @autotileInfo[i]=nil
- end
- i+=1
- end
- i=0;[email protected];while i<len
- if @regularTileInfo[i]
- @regularTileInfo[i].dispose
- @regularTileInfo[i]=nil
- end
- i+=1
- end
- i=0;[email protected];while i<len
- @tiles[i].dispose
- @tiles[i]=nil
- i+=2
- end
- i=0;[email protected];while i<len
- @autosprites[i].dispose
- @autosprites[i]=nil
- i+=2
- end
- if @layer0
- @layer0.bitmap.dispose if [email protected]?
- @layer0.bitmap=nil if [email protected]?
- @layer0.dispose
- @layer0=nil
- end
- if @flash
- @flash.bitmap.dispose if [email protected]?
- @flash.bitmap=nil if [email protected]?
- @flash.dispose
- @flash=nil
- end
- for i in 0...7
- self.autotiles[i]=nil
- end
- @tiles.clear
- @autosprites.clear
- @autotileInfo.clear
- @regularTileInfo.clear
- @tilemap=nil
- @tileset=nil
- @priorities=nil
- @selfviewport.dispose
- @selfviewport=nil
- @disposed=true
- end
- def bltAutotile(bitmap,x,y,id,frame)
- return if frame<0
- autotile=@autotiles[id/48-1]
- return if !autotile
- if autotile.height==32
- anim=frame*32
- src_rect=Rect.new(anim,0,32,32)
- bitmap.blt(x,y,autotile,src_rect)
- else
- anim=frame*96
- id%=48
- tiles = Autotiles[id>>3][id&7]
- src=Rect.new(0,0,0,0)
- for i in 0...4
- tile_position = tiles[i] - 1
- src.set(tile_position % 6 * 16 + anim,
- tile_position / 6 * 16, 16, 16)
- bitmap.blt(i%2*16+x,i/2*16+y, autotile, src)
- end
- end
- end
- def autotileNumFrames(id)
- autotile=@autotiles[id/48-1]
- return 0 if !autotile || autotile.disposed?
- frames=1
- if autotile.height==32
- frames=autotile.width/32
- else
- frames=autotile.width/96
- end
- return frames
- end
- def autotileFrame(id)
- autotile=@autotiles[id/48-1]
- return -1 if !autotile || autotile.disposed?
- frames=1
- if autotile.height==32
- frames=autotile.width/32
- else
- frames=autotile.width/96
- end
- return (Graphics.frame_count/Animated_Autotiles_Frames)%frames
- end
- def repaintAutotiles
- for i in [email protected]
- next if !@autotileInfo[i]
- frame=autotileFrame(i)
- bltAutotile(@autotileInfo[i],0,0,i,frame)
- end
- end
- def getAutotile(sprite,id)
- anim=autotileFrame(id)
- return if anim<0
- bitmap=@autotileInfo[id]
- if !bitmap
- bitmap=Bitmap.new(32,32)
- bltAutotile(bitmap,0,0,id,anim)
- @autotileInfo[id]=bitmap
- end
- sprite.bitmap=bitmap if !sprite.equal?(bitmap) || sprite.bitmap!=bitmap
- end
- def getRegularTile(sprite,id)
- if false
- sprite.bitmap=@tileset if !sprite.equal?(@tileset) || sprite.bitmap!=@tileset
- sprite.src_rect.set((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32)
- else
- bitmap=@regularTileInfo[id]
- if !bitmap
- bitmap=Bitmap.new(32,32)
- rect=Rect.new((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32)
- bitmap.blt(0,0,@tileset,rect)
- @regularTileInfo[id]=bitmap
- end
- sprite.bitmap=bitmap if !sprite.equal?(bitmap) || sprite.bitmap!=bitmap
- end
- end
- def addTile(tiles,count,xpos,ypos,id)
- if id>=384
- if count>=tiles.length
- sprite=Sprite.new(@viewport)
- tiles.push(sprite,0)
- else
- sprite=tiles[count]
- tiles[count+1]=0
- end
- sprite.visible=@visible
- sprite.x=xpos
- sprite.y=ypos
- getRegularTile(sprite,id)
- spriteZ=(@priorities[id]==0||!@priorities[id]) ? 0 : ypos+@priorities[id]*32+32
- sprite.z=spriteZ
- count+=2
- else
- if count>=tiles.length
- sprite=Sprite.new(@viewport)
- tiles.push(sprite,1)
- else
- sprite=tiles[count]
- tiles[count+1]=1
- end
- sprite.visible=@visible
- sprite.x=xpos
- sprite.y=ypos
- getAutotile(sprite,id)
- spriteZ=(@priorities[id]==0||!@priorities[id]) ? 0 : ypos+@priorities[id]*32+32
- sprite.z=spriteZ
- count+=2
- end
- return count
- end
- def refresh_tileset
- i=0;[email protected];while i<len
- if @regularTileInfo[i]
- @regularTileInfo[i].dispose
- @regularTileInfo[i]=nil
- end
- i+=1
- end
- @regularTileInfo.clear
- @priotiles.clear
- ysize=@map_data.ysize
- xsize=@map_data.xsize
- zsize=@map_data.zsize
- if xsize>100 || ysize>100
- @fullyrefreshed=false
- else
- for z in 0...zsize
- for y in 0...ysize
- for x in 0...xsize
- id = @map_data[x, y, z]
- next if id==0 || !@priorities[id]
- next if @priorities[id]==0
- @priotiles.push([x,y,z,id])
- end
- end
- end
- @fullyrefreshed=true
- end
- end
- def refresh_flash
- if @flash_data && !@flash
- @flash=Sprite.new(viewport)
- @flash.visible=true
- @flash.z=1
- @flash.blend_type=1
- @flash.bitmap=Bitmap.new(@viewport.rect.width*2,@viewport.rect.height*2)
- @firsttimeflash=true
- elsif !@flash_data && @flash
- @flash.bitmap.dispose if @flash.bitmap
- @flash.dispose
- @flash=nil
- @firsttimeflash=false
- end
- end
- def refresh_autotiles
- i=0;[email protected];while i<len
- if @autotileInfo[i]
- @autotileInfo[i].dispose
- @autotileInfo[i]=nil
- end
- i+=1
- end
- i=0;[email protected];while i<len
- if @autosprites[i]
- @autosprites[i].dispose
- @autosprites[i]=nil
- end
- i+=2
- end
- @autosprites.clear
- @autotileInfo.clear
- @prioautotiles.clear
- hasanimated=false
- for i in 0...7
- numframes=autotileNumFrames(48*(i+1))
- hasanimated=true if numframes>=2
- @framecount[i]=numframes
- end
- if hasanimated
- ysize=@map_data.ysize
- xsize=@map_data.xsize
- zsize=@map_data.zsize
- if xsize>100 || ysize>100
- @fullyrefreshedautos=false
- else
- for y in 0...ysize
- for x in 0...xsize
- haveautotile=false
- for z in 0...zsize
- id = @map_data[x, y, z]
- next if id==0 || id>=384 || @priorities[id]!=0 || !@priorities[id]
- next if @framecount[id/48-1]<2
- haveautotile=true
- break
- end
- @prioautotiles.push([x,y]) if haveautotile
- end
- end
- @fullyrefreshedautos=true
- end
- else
- @fullyrefreshedautos=true
- end
- end
- def map_data=(value)
- @map_data=value
- @tilesetChanged=true
- end
- def refreshFlashSprite
- return if !@flash || @flash_data.nil?
- ptX=@ox-@oxFlash
- ptY=@oy-@oyFlash
- if !@firsttimeflash && !@usedsprites &&
- ptX>=0 && [email protected]<[email protected] &&
- ptY>=0 && [email protected]<[email protected]
- @flash.ox=0
- @flash.oy=0
- @flash.src_rect.set(ptX.round,ptY.round,
- @viewport.rect.width,@viewport.rect.height)
- return
- end
- [email protected]
- [email protected]
- [email protected]
- ysize=@map_data.ysize
- xsize=@map_data.xsize
- zsize=@map_data.zsize
- @firsttimeflash=false
- @oxFlash=@ox-(width>>2)
- @oyFlash=@oy-(height>>2)
- @flash.ox=0
- @flash.oy=0
- @flash.src_rect.set(width>>2,height>>2,
- @viewport.rect.width,@viewport.rect.height)
- @flash.bitmap.clear
- @[email protected]
- @[email protected]
- xStart=(@oxFlash>>5)
- xStart=0 if xStart<0
- yStart=(@oyFlash>>5)
- yStart=0 if yStart<0
- xEnd=xStart+(width>>5)+1
- yEnd=yStart+(height>>5)+1
- xEnd=xsize if xEnd>=xsize
- yEnd=ysize if yEnd>=ysize
- if xStart<xEnd && yStart<yEnd
- yrange=yStart...yEnd
- xrange=xStart...xEnd
- tmpcolor=Color.new(0,0,0,0)
- for y in yrange
- ypos=(y<<5)-@oyFlash
- for x in xrange
- xpos=(x<<5)-@oxFlash
- id = @flash_data[x, y, 0]
- r=(id>>8)&15
- g=(id>>4)&15
- b=(id)&15
- tmpcolor.set(r*16,g*16,b*16)
- bitmap.fill_rect(xpos,ypos,32,32,tmpcolor)
- end
- end
- end
- end
- def refreshLayer0(autotiles=false)
- ptX=@ox-@oxLayer0
- ptY=@oy-@oyLayer0
- if !autotiles && !@firsttime && !@usedsprites &&
- ptX>=0 && [email protected]<[email protected] &&
- ptY>=0 && [email protected]<[email protected]
- if @layer0clip
- @layer0.ox=0
- @layer0.oy=0
- @layer0.src_rect.set(ptX.round,ptY.round,
- @viewport.rect.width,@viewport.rect.height)
- else
- @layer0.ox=ptX.round
- @layer0.oy=ptY.round
- @layer0.src_rect.set(0,0,@layer0.bitmap.width,@layer0.bitmap.height)
- end
- return true
- end
- [email protected]
- [email protected]
- [email protected]
- ysize=@map_data.ysize
- xsize=@map_data.xsize
- zsize=@map_data.zsize
- if autotiles
- return true if @fullyrefreshedautos && @prioautotiles.length==0
- return true if !shown?
- xStart=(@oxLayer0>>5)
- xStart=0 if xStart<0
- yStart=(@oyLayer0>>5)
- yStart=0 if yStart<0
- xEnd=xStart+(width>>5)+1
- yEnd=yStart+(height>>5)+1
- xEnd=xsize if xEnd>xsize
- yEnd=ysize if yEnd>ysize
- return true if xStart>=xEnd || yStart>=yEnd
- trans=Color.new(0,0,0,0)
- temprect=Rect.new(0,0,0,0)
- tilerect=Rect.new(0,0,32,32)
- range=0...zsize
- overallcount=0
- count=0
- if !@fullyrefreshedautos
- for y in yStart..yEnd
- for x in xStart..xEnd
- haveautotile=false
- for z in range
- id = @map_data[x, y, z]
- next if id<48 || id>=384 || @priorities[id]!=0 || !@priorities[id]
- next if @framecount[id/48-1]<2
- haveautotile=true
- break
- end
- next if !haveautotile
- overallcount+=1
- xpos=(x<<5)-@oxLayer0
- ypos=(y<<5)-@oyLayer0
- bitmap.fill_rect(xpos,ypos,0,0,trans) if overallcount<=2000
- for z in range
- id = @map_data[x,y,z]
- next if id<48 || @priorities[id]!=0 || !@priorities[id]
- if overallcount>2000
- count=addTile(@autosprites,count,xpos,ypos,id)
- next
- elsif id>=384
- temprect.set((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32)
- bitmap.blt(xpos,ypos,@tileset,temprect)
- else
- tilebitmap=@autotileInfo[id]
- if !tilebitmap
- anim=autotileFrame(id)
- next if anim<0
- tilebitmap=Bitmap.new(32,32)
- bltAutotile(tilebitmap,0,0,id,anim)
- @autotileInfo[id]=tilebitmap
- end
- bitmap.blt(xpos,ypos,tilebitmap,tilerect)
- end
- end
- end
- end
- else
- for tile in @prioautotiles
- x=tile[0]
- y=tile[1]
- next if x<xStart||x>xEnd
- next if y<yStart||y>yEnd
- overallcount+=1
- xpos=(x<<5)-@oxLayer0
- ypos=(y<<5)-@oyLayer0
- bitmap.fill_rect(xpos,ypos,0,0,trans) if overallcount<=2000
- for z in range
- id = @map_data[x,y,z]
- next if id<48 || @priorities[id]!=0 || !@priorities[id]
- if overallcount>2000
- count=addTile(@autosprites,count,xpos,ypos,id)
- next
- elsif id>=384
- temprect.set((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32)
- bitmap.blt(xpos,ypos,@tileset,temprect)
- else
- tilebitmap=@autotileInfo[id]
- if !tilebitmap
- anim=autotileFrame(id)
- next if anim<0
- tilebitmap=Bitmap.new(32,32)
- bltAutotile(tilebitmap,0,0,id,anim)
- @autotileInfo[id]=tilebitmap
- end
- bitmap.blt(xpos,ypos,tilebitmap,tilerect)
- end
- end
- end
- end
- Graphics.frame_reset if overallcount>2000
- @usedsprites=false
- return true
- end
- return false if @usedsprites
- @firsttime=false
- @oxLayer0=@ox-(width>>2)
- @oyLayer0=@oy-(height>>2)
- if @layer0clip
- @layer0.ox=0
- @layer0.oy=0
- @layer0.src_rect.set(width>>2,height>>2,
- @viewport.rect.width,@viewport.rect.height)
- else
- @layer0.ox=(width>>2)
- @layer0.oy=(height>>2)
- end
- @layer0.bitmap.clear
- @[email protected]
- @[email protected]
- xStart=(@oxLayer0>>5)
- xStart=0 if xStart<0
- yStart=(@oyLayer0>>5)
- yStart=0 if yStart<0
- xEnd=xStart+(width>>5)+1
- yEnd=yStart+(height>>5)+1
- xEnd=xsize if xEnd>=xsize
- yEnd=ysize if yEnd>=ysize
- if xStart<xEnd && yStart<yEnd
- tmprect=Rect.new(0,0,0,0)
- yrange=yStart...yEnd
- xrange=xStart...xEnd
- for z in 0...zsize
- for y in yrange
- ypos=(y<<5)-@oyLayer0
- for x in xrange
- xpos=(x<<5)-@oxLayer0
- id = @map_data[x, y, z]
- next if id==0 || @priorities[id]!=0 || !@priorities[id]
- if id>=384
- tmprect.set((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32)
- bitmap.blt(xpos,ypos,@tileset,tmprect)
- else
- frame=autotileFrame(id)
- bltAutotile(bitmap,xpos,ypos,id,frame)
- end
- end
- end
- end
- Graphics.frame_reset
- end
- return true
- end
- def getResizeFactor
- return $ResizeFactor ? $ResizeFactor : 1.0
- end
- def ox=(val)
- val=(val*getResizeFactor).to_i
- val=(val/getResizeFactor).to_i
- wasshown=self.shown?
- @ox=val.floor
- @nowshown=(!wasshown && self.shown?)
- end
- def oy=(val)
- val=(val*getResizeFactor).to_i
- val=(val/getResizeFactor).to_i
- wasshown=self.shown?
- @oy=val.floor
- @nowshown=(!wasshown && self.shown?)
- end
- def visible=(val)
- wasshown=@visible
- @visible=val
- @nowshown=(!wasshown && val)
- end
- def refresh(autotiles=false)
- @oldOx=@ox
- @oldOy=@oy
- usesprites=false
- if @layer0
- @layer0.visible=@visible
- usesprites=!refreshLayer0(autotiles)
- if autotiles && !usesprites
- return
- end
- else
- usesprites=true
- end
- refreshFlashSprite
- [email protected]
- [email protected]
- [email protected]+vpx
- [email protected]+vpy
- xsize=@map_data.xsize
- ysize=@map_data.ysize
- minX=(@ox/32)-1
- maxX=((@[email protected])/32)+1
- minY=(@oy/32)-1
- maxY=((@[email protected])/32)+1
- minX=0 if minX<0
- minX=xsize-1 if minX>=xsize
- maxX=0 if maxX<0
- maxX=xsize-1 if maxX>=xsize
- minY=0 if minY<0
- minY=ysize-1 if minY>=ysize
- maxY=0 if maxY<0
- maxY=ysize-1 if maxY>=ysize
- count=0
- if minX<maxX && minY<maxY
- @usedsprites=usesprites || @usedsprites
- if @layer0
- @layer0.visible=false if usesprites
- end
- if @fullyrefreshed
- for prio in @priotiles
- next if prio[0]<minX||prio[0]>maxX
- next if prio[1]<minY||prio[1]>maxY
- id=prio[3]
- xpos=(prio[0]<<5)-@ox
- ypos=(prio[1]<<5)-@oy
- count=addTile(@tiles,count,xpos,ypos,id)
- end
- else
- for z in 0...@map_data.zsize
- for y in minY..maxY
- for x in minX..maxX
- id = @map_data[x, y, z]
- next if id==0 || !@priorities[id]
- next if @priorities[id]==0
- xpos=(x<<5)-@ox
- ypos=(y<<5)-@oy
- count=addTile(@tiles,count,xpos,ypos,id)
- end
- end
- end
- end
- end
- if count<@tiles.length
- bigchange=(count<=(@tiles.length*2/3)) && (@tiles.length*2/3)>25
- j=count;[email protected];while j<len
- sprite=@tiles[j]
- @tiles[j+1]=-1
- if bigchange
- sprite.dispose
- @tiles[j]=nil
- @tiles[j+1]=nil
- elsif !@tiles[j].disposed?
- sprite.visible=false if sprite.visible
- end
- j+=2
- end
- @tiles.compact! if bigchange
- end
- end
- end
- 七)打开Arrow_Base脚本页,把全部内容替换成这个脚本:
- #==============================================================================
- # ■ Arrow_Base
- #==============================================================================
- class Arrow_Base < Sprite
- attr_reader :index
- attr_reader :help_window
- def initialize(viewport)
- super(viewport)
- self.bitmap = RPG::Cache.windowskin($game_system.windowskin_name)
- self.ox = 16
- self.oy = 64
- self.z = 2500
- @blink_count = 0
- @index = 0
- @help_window = nil
- update
- end
- def index=(index)
- @index = index
- update
- end
- def help_window=(help_window)
- @help_window = help_window
- if @help_window != nil
- update_help
- end
- end
- def update
- @blink_count = (@blink_count + 1) % 8
- if @blink_count < 4
- self.src_rect.set(0, 128, 32, 32) #RPGEX
- else
- self.src_rect.set(32, 128, 32, 32) #RPGEX
- end
- if @help_window != nil
- update_help
- end
- end
- end
复制代码 八)在Game_Player脚本页与Sprite_Character脚本页之间插入新脚本页,输入下面的脚本:
[或者你把Game_Player脚本自己参照这个脚本DIY即可,不过本人不推荐不精通脚本的人使用该方法]
- #==============================================================================
- # ** Game_Player
- #------------------------------------------------------------------------------
- # This class handles the player. Its functions include event starting
- # determinants and map scrolling. Refer to "$game_player" for the one
- # instance of this class.
- #==============================================================================
- class Game_Player < Game_Character
- alias dargor_vx_player_update update
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- if Input.press?(Input::CTRL) and $TEST
- @through = true
- else
- @through = false
- end
- dargor_vx_player_update
- end
- end
复制代码 九)在main脚本页的所有内容之前插入这两句:- Graphics.resize_screen(640, 480) # 设置分辨率
- Font.default_shadow = false # 禁用全局文字阴影效果(这个自己随便,插入不插入无所谓)
复制代码 如果原main脚本没有定义默认字体的话再在上面所说的位置之后插入这句:
[简体中文用户]- Font.default_name = ["SimHei", "黑体", "DFKai-SB", "標楷體"]
复制代码 [繁体中文用户]- Font.default_name = ["DFKai-SB", "標楷體", "SimHei", "黑体"]
复制代码第四步 - 善后处理
经过上文所述的处理后,原有的RPGXP格式的Windowskin不能用了,直接在RPGVX格式的Windowskin基础上改做成下面这个格式即可:
如何加密?这个简单,直接用RPGXP加密即可,然后再把游戏安装包解开后把game.rgssad改名为game.rgss2a。
[RGSS2运行库向下兼容旧版加密格式]
额,听起来不错
不过还是不懂啊那位大大看懂了可以发个范例啊!
|
|