PK8

Using RGSS3 with RPG Maker XP

58 posts in this topic

Before I begin, I'd have to say Dargor deserves the credit for a lot of this. I used his tutorial and applied most of it in the process of giving RMXP the capabilities of RGSS3.

Introduction

We will be going through the steps on how to implement RGSS3 into RPG Maker XP. Implementing it of course will give you access to a lot of RGSS3's cool features. Let us begin.

In order to do this, you will need to have RPG Maker VX Ace in hand. Here, we will use RPG Maker VX Ace's RGSS301.dll and Game.exe.

Steps

Step 1: RTP

If you are using the default RTP, export all of it into your Game's Project folder. If you don't, this will come back to bite you later on in this tutorial.

Step 2: RGSS Library and Game.exe

  1. Copy and paste RGSS301.dll to your Game's Project folder and rename it RGSS104E.dll (or whatever your DLL file might be. Look in Game.ini if you aren't sure.)
  2. Replace the Game.exe in your project's folder with RPG Maker VX Ace's Game.exe

Step 3: Scripts

  1. RPG Objects
    1. Open RPG Maker XP
    2. Open the Help Manual (F1)
    3. Open the Script Editor (F11)
    4. Copy all RPG objects from the Help Manual into the Script Editor. Make sure to put all of these scripts ABOVE everything else.
      Note that RPG::MoveCommand has an error.
      Here's how it looks in the manual:

      class MoveCommand(code = 0, parameters = [])
      def initialize
      @code = code
      @parameters = parameters
      end
      attr_accessor :code
      attr_accessor :parameters
      end
      end
      module RPG

      Here's how it should look:

      class MoveCommand
      def initialize(code = 0, parameters = [])
      @code = code
      @parameters = parameters
      end
      attr_accessor :code
      attr_accessor :parameters
      end
      end
      module RPG

    5. Other Scripts
      Some hidden classes such as Tilemap and Window have changed significantly to the point where it might not work anymore.
      1. The most important thing to update is the Tilemap. Like Dargor, I'll also recommend Poccil's Tilemap script. It still works pretty well. Since I was only able to come across a text file of it on 4shared, I will share it here.

        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 &&
        !@autotiles.changed)
        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=((@ox+@viewport.rect.width)/32)+1
        yStart=(@oy/32)-1
        yEnd=((@oy+@viewport.rect.height)/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;len=@autotileInfo.length;while i<len
        if @autotileInfo[i]
        @autotileInfo[i].dispose
        @autotileInfo[i]=nil
        end
        i+=1
        end
        i=0;len=@regularTileInfo.length;while i<len
        if @regularTileInfo[i]
        @regularTileInfo[i].dispose
        @regularTileInfo[i]=nil
        end
        i+=1
        end
        i=0;len=@tiles.length;while i<len
        @tiles[i].dispose
        @tiles[i]=nil
        i+=2
        end
        i=0;len=@autosprites.length;while i<len
        @autosprites[i].dispose
        @autosprites[i]=nil
        i+=2
        end
        if @layer0
        @layer0.bitmap.dispose if !@layer0.disposed?
        @layer0.bitmap=nil if !@layer0.disposed?
        @layer0.dispose
        @layer0=nil
        end
        if @flash
        @flash.bitmap.dispose if !@flash.disposed?
        @flash.bitmap=nil if !@flash.disposed?
        @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 0...@autotileInfo.length
        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;len=@regularTileInfo.length;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;len=@autotileInfo.length;while i<len
        if @autotileInfo[i]
        @autotileInfo[i].dispose
        @autotileInfo[i]=nil
        end
        i+=1
        end
        i=0;len=@autosprites.length;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 && ptX+@viewport.rect.width<=@flash.bitmap.width &&
        ptY>=0 && ptY+@viewport.rect.height<=@flash.bitmap.height
        @flash.ox=0
        @flash.oy=0
        @flash.src_rect.set(ptX.round,ptY.round,
        @viewport.rect.width,@viewport.rect.height)
        return
        end
        width=@flash.bitmap.width
        height=@flash.bitmap.height
        bitmap=@flash.bitmap
        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
        @oxFlash=@oxFlash.floor
        @oyFlash=@oyFlash.floor
        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 && ptX+@viewport.rect.width<=@layer0.bitmap.width &&
        ptY>=0 && ptY+@viewport.rect.height<=@layer0.bitmap.height
        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
        width=@layer0.bitmap.width
        height=@layer0.bitmap.height
        bitmap=@layer0.bitmap
        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
        @oxLayer0=@oxLayer0.floor
        @oyLayer0=@oyLayer0.floor
        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
        vpx=@viewport.rect.x
        vpy=@viewport.rect.y
        vpr=@viewport.rect.width+vpx
        vpb=@viewport.rect.height+vpy
        xsize=@map_data.xsize
        ysize=@map_data.ysize
        minX=(@ox/32)-1
        maxX=((@ox+@viewport.rect.width)/32)+1
        minY=(@oy/32)-1
        maxY=((@oy+@viewport.rect.height)/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;len=@tiles.length;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
        class CustomTilemapAutotiles
      2. As for the Window/Windowskin, there's two steps you'll have to do here.
      3. Because of the changed libraries, you're now going to need a windowskin that can work with RPG Maker VX. You could either use an RPG Maker VX windowskin or if you'd prefer to keep your RMXP Windowskin, you could use my RMXP to RMVX (Ace) windowskin converter script and add that above main.
      4. Because RGSS3 now has a padding property, windows will start to appear slightly awkward, like so:
        2nc2idz.png

        Because of this, you'll need to copy this snippet and paste it above main as well:

        # ** Window_Base
        #------------------------------------------------------------------------------
        # This class is for all in-game windows.
        #==============================================================================

        class Window_Base
        alias_method(:rmxptorgss3_initialize, :initialize)
        def initialize(*args)
        rmxptorgss3_initialize(*args)
        self.padding = 16
        end
        end
        #==============================================================================

    1. Next up, we're going to have to do a complete rewrite of main. Why? Because Game.exe shuts itself down now, that's why. Copy and paste this code onto main.

      # ** Main
      #------------------------------------------------------------------------------
      # After defining each class, actual processing begins here.
      #==============================================================================

      rgss_main {
      $DEBUG = $TEST = true # Remove this when your project is finished.
      Graphics.resize_screen(640, 480) # Resizes the screen.
      # Prepare for transition
      Graphics.freeze
      $scene = Scene_Title.new
      # Call main method as long as $scene is effective
      $scene.main while $scene != nil
      Graphics.transition(20)
      }
      #==============================================================================

    2. Bringing back print
      This is optional, but for those who liked print... here's a quick snippet to bring that back.

      # ** Kernel
      #------------------------------------------------------------------------------
      # A module defining the methods that can be referred to by all classes.
      # Object classes are included in this module
      #==============================================================================

      module Kernel
      def print(*args)
      msgbox(*args)
      end
      end
      #==============================================================================





      Step 4: Fonts
      Because it's now using the RGSS3 Library and VX Ace's Game.exe, your project will now look for a font named VL Gothic.
      1. You should find the Fonts folder in C:\Program Files (x86)\Common Files\Enterbrain\RGSS3\RPGVXAce.
      2. Copy the folder and paste it into your project's folder.

FAQ / Issues

  • Q: I'm getting a Failed to Load Scripts error.
    A: Rename Game.rgssad to Game.rgss3a
  • Q: I'm getting a Failed to Load Archive error when trying to run an encrypted game.
    A: I hate to not have any good news, but I'm clueless as to how to fix it.

Demo

Coming soon.

Edited by α PK8

Share this post


Link to post
Share on other sites

Seems awesome!

I really wonder if I can use Chinese characters in my Game?

Share this post


Link to post
Share on other sites

Holy cow! Does this mean I will be able to use VX Ace scripts in XP? *Looks at VX Ace with scorn*

Update: It werks! Wow for me this shines a new light on the vxace vs xp debate...

Edited by Mako

Share this post


Link to post
Share on other sites

WITCHCRAFT! PURE WITCHCRAFT!

I've always thought of doing something similar to this but never actually expected it to work. Nice to know it does :P

Share this post


Link to post
Share on other sites

Interesting, though I have to wonder. Would this go against EB's EULA?

Share this post


Link to post
Share on other sites

Awesome. Guess there's no reason to keep using Ace.

Interesting, though I have to wonder. Would this go against EB's EULA?

What part of the EULA does it go against?

Share this post


Link to post
Share on other sites

Awesome. Guess there's no reason to keep using Ace.

What part of the EULA does it go against?

I'm guessing it's the DLL. RGSS3 dll without owning Ace means you can't distribute it.

Share this post


Link to post
Share on other sites

...

While interesting, this does have one large problem: The XP database isn't made to interact with RGSS3.

Also, just as a quick note: You would need to own both Ace and XP for this, as I don't believe you could distribute a game made this way with RGSS3 without owning Ace for the license.

PK8 likes this

Share this post


Link to post
Share on other sites

Could someone post exactly what I would be losing by using this script? opposed to using vxace? At a glance only minor tweaks to the UI. =/ I love the mapping system in XP.

EDIT: I own both...

Edited by Mako

Share this post


Link to post
Share on other sites

I'm guessing it's the DLL. RGSS3 dll without owning Ace means you can't distribute it.

But you're not modifying the DLL by doing this. And if you do own Ace, then there wouldn't be a problem.

...

While interesting, this does have one large problem: The XP database isn't made to interact with RGSS3.

Also, just as a quick note: You would need to own both Ace and XP for this, as I don't believe you could distribute a game made this way with RGSS3 without owning Ace for the license.

That is the real problem. It's probably not hard to make a converter, though.

Share this post


Link to post
Share on other sites

Could someone post exactly what I would be losing by using this script? opposed to using vxace? At a glance only minor tweaks to the UI. =/ I love the mapping system in XP.

EDIT: I own both...

Off the top of my head:

Database stuff that you would instead have to do through scripts or just don't exist: Traits, Noteboxes, custom damage formulas, custom attack and guard skill. (actually it might still pull the first two skills for guard and attack, not sure how it would deal with the lack of damage formulas in XP though).

Maps: Regions.

Also, I would be interested in seeing how many small bugs appear from the event commands not being positioned the same in the event editor, or not necessarily even having the same options even if they do, and how many bugs will there be from just the database info not matching up either.

On a final note though: Hey, as a representative of Degica, I fully support anyone who wants to buy both XP and Ace to make this work :P.

Share this post


Link to post
Share on other sites
Off the top of my head:

Database stuff that you would instead have to do through scripts or just don't exist: Traits, Noteboxes, custom damage formulas, custom attack and guard skill. (actually it might still pull the first two skills for guard and attack, not sure how it would deal with the lack of damage formulas in XP though).

Maps: Regions.

Also, I would be interested in seeing how many small bugs appear from the event commands not being positioned the same in the event editor, or not necessarily even having the same options even if they do, and how many bugs will there be from just the database info not matching up either.

@_@ That's allot of crap.... bah forget it. Ace isn't THAT bad. LOL

Share this post


Link to post
Share on other sites

You're justing using RGSS3 library instead of RGSS1 so any features (traits, map regions, etc) won't be usable. Still, great job since RGSS3 adds a bunch of neat features.

Share this post


Link to post
Share on other sites

How is the performance compared to RGSS1? Has anyone benchmarked it?

Edited by Tsukihime

Share this post


Link to post
Share on other sites

You're justing using RGSS3 library instead of RGSS1 so any features (traits, map regions, etc) won't be usable. Still, great job since RGSS3 adds a bunch of neat features.

They're still usable, there's just no way of editing them in the RMXP database. You could use Ace to manipulate the traits/regions/etc and then copy and paste the rvdata over.

Share this post


Link to post
Share on other sites

Bad news. Not sure if anybody caught the edit of my first post but it turns out you'll run into an issue that just can't be fixed when encrypting your project. I tried encrypting a project just to see if it'd work, but when I tried to run Game.exe, I ended up getting a Failed to Load Archive error. I'm not sure how that can be fixed.

Share this post


Link to post
Share on other sites

Bad news. Not sure if anybody caught the edit of my first post but it turns out you'll run into an issue that just can't be fixed when encrypting your project. I tried encrypting a project just to see if it'd work, but when I tried to run Game.exe, I ended up getting a Failed to Load Archive error. I'm not sure how that can be fixed.

Wow I guess that ends that... I can see how that would be an issue. LOL

Share this post


Link to post
Share on other sites

Just don't use XP's default encryption and just roll your own.

I don't know if it's because the decryption algorithm is stored in the rgss dll or not, but maybe someone can test this by using rgss2 in XP. It uses the exact same encryption algorithm after all.

In any case, if people just want to be able to use features and regions, just copy those particular methods over. No need for the dll for that.

They're still usable, there's just no way of editing them in the RMXP database. You could use Ace to manipulate the traits/regions/etc and then copy and paste the rvdata over.

I'm kind of curious why not just use Ace in that case if someone's going to build pretty much their whole project in Ace editor, and then copy them over to XP.

And it's not like using RGSS3 is somehow getting the best of both worlds. Layer data in XP is not captured in rgss3, for example.

I guess one could consider combining methods from both libraries and write out custom rxdata files so that layer information the way XP expects it and region information the way Ace expects it is both there (and in XP's case, each layer would have their own regions?)

But someone needs to verify that it will actually work.

Edited by Tsukihime
Oriceles likes this

Share this post


Link to post
Share on other sites

but the good thing is that if the rpg maker developers in japan are planning to make a new rpg maker program they could make it compact-able with old rgss so that way all rgss from the newest and the oldest can use rpg maker vx ace script and rpg maker xp script in that new rpg maker program (if they have plan to develop it!)

you should be working at enterbrain because of what you did! lol.

Edited by jomarcenter

Share this post


Link to post
Share on other sites

but the good thing is that if the rpg maker developers in japan are planning to make a new rpg maker program they could make it compact-able with old rgss so that way all rgss from the newest and the oldest can use rpg maker vx ace script and rpg maker xp script in that new rpg maker program (if they have plan to develop it!)

you should be working at enterbrain because of what you did! lol.

Really? Sounds increditable!

Have an URL? Wanna see details!

I just like Art Style of XP~~~

Share this post


Link to post
Share on other sites

but the good thing is that if the rpg maker developers in japan are planning to make a new rpg maker program they could make it compact-able with old rgss so that way all rgss from the newest and the oldest can use rpg maker vx ace script and rpg maker xp script in that new rpg maker program (if they have plan to develop it!)

you should be working at enterbrain because of what you did! lol.

I just don't see how that is possible considering how the classes for rgss and rgss3 are completely different, and because the scripts we write are based on the existing classes, you're not going to be able to just grab an XP script and plug it into VX project and expect the class names, methods, and variables to all exist.

But maybe it's because they came up with a way to do it that they're working at EB.

I mean, if there's a way to write our scripts such that we can expect compatibility with both XP, VX, and Ace, then we would be doing that ourselves so everyone can enjoy the same script without having to re-write it 3 times.

Edited by Tsukihime
Oriceles likes this

Share this post


Link to post
Share on other sites

When you're switching the DLL and the Game.exe to the RGSS3 DLL with Ace's Game.exe or even the RGSS2 DLL with VX's Game.exe, all you're really inheriting are RGSS3's (or RGSS2's) built in classes and modules along with the new RPG classes.

BUT copying and pasting all of RPG Maker XP's RPG classes from the help manual onto the script editor pretty much renders the other makers' RPG classes kind of useless. Sure, a class from Ace like RPG::UsableItem would still be around but it's pretty much just sitting there.

Speaking of those RPG classes, if you're still looking to use RGSS3 with RMXP despite the "Failed to Load Archive" flaw being around when you encrypt your games and finding yourself wanting to get rid of RGSS3's RPG classes, copy and paste this script by IceDragon above everything.

# // Created By IceDragon
# // Date Created : 03/19/2012
# // Date Modified : 03/19/2012
# // Cheat trick
# // Because everytime you save your game with rmvx it changes the dll to rgss2*.dll
# // You should just rename the rgss3*.dll to the equavilent 2
module RPGRGSS3
# // Remap all the RGSS3 classes to the current module
RPG.constants.each { |c| const_set(c,RPG.const_get(c)) }
end
module RPG
# // Store all the constants
c = constants.to_a
# // REMOVE the RGSS3 classes from this module
c.each { |c| remove_const(c) }
end

Edited by α PK8

Share this post


Link to post
Share on other sites

but i have a point since it possible for newer version of rgss to be used in older version of rpg maker than it possible to make it the next version of rgss to be compact-able with older version of rgss you just need to code the correct thing.

i mean if i was a programmer i will try to make the newer version of rgss which it can be compact-able with older version of rgss or maybe even in other game engine (i know this is against the enterbrain EULA {i think} but i just talking about that coding doesn't have limitation and have the possibility to make an newer version of rgss that can use the same script from older rgss system) i not a programmer and i know it possible. it like saving time from making the same scripts over and over again every time a newer version of rpg maker released.

Edited by jomarcenter

Share this post


Link to post
Share on other sites

It's not as easy as it sounds. Yes, you can make anything running off of the same interpreter (in this case Ruby) "compatible" so to speak, but it doesn't mean their classes will comingle with each other. They could include the other libraries (RGSS, RGSS2, and RGSS3), but you'd have to pick one or the other, otherwise you'd run into repeat classes with different coding. Just like, since RGSS has a different map layering system, a map made in an RGSS game wouldn't be able to run in the same game using the RGSS3 engine and vice versa. So really, all you'd be able to do is make a maker that the user is able to choose which version of the RGSS library they'd want to use. It'd just be easier for them to make RGSS4 where it uses a little bit of each system's classes, or entirely revamped classes that use a map system like RGSS, but has the improvements of RGSS3.

Oriceles likes this

Share this post


Link to post
Share on other sites

i mean if i was a programmer i will try to make the newer version of rgss which it can be compact-able with older version of rgss or maybe even in other game engine (i know this is against the enterbrain EULA {i think} but i just talking about that coding doesn't have limitation and have the possibility to make an newer version of rgss that can use the same script from older rgss system) i not a programmer and i know it possible. it like saving time from making the same scripts over and over again every time a newer version of rpg maker released.

Yes, I would also like to save the effort of having to write the same script multiple times, but because I've written a couple scripts I feel that there's just no way to do that under the current circumstances.

It's possible if you consider an infinite number of possibilities in the future with an infinite supply of ideas, but if you were a programmer that wrote scripts for RM, you'd probably find that no matter what you do, you couldn't write a single script - efficiently - that will work with all 3 engines. Or even two.

Some people build in conditional branches to check whether you're using XP or VX and load the appropriate class, but that's not a real solution it's just combining two scripts into a single one.

Don't even think about providing compatibility with other game engines if you can't even provide compatibility with two very similar engines with pretty much the same code base.

It's not as easy as it sounds. Yes, you can make anything running off of the same interpreter (in this case Ruby) "compatible" so to speak, but it doesn't mean their classes will comingle with each other.

How about writing a custom RM interpreter that takes "RM code" and translates it to the underlying library? (RGSS, 2, 3).

It would take the code you write, figure out what you're trying to do, and then re-write the code to do the exact same thing, except with the expected classes!

But of course, that's black magic and doesn't seem like something computers can handle trivially.

Maybe provide an interface using a functional language so that we just declare what we want it to do, and then this RM interpreter decides how to do it given the underlying libraries.

Then we don't have to expect the classes to work together. We just need to make them happy with what they have.

If someone really wants to write a script in Ace that uses Ace-only features and expects it to work in XP, sorry XP is going to remove those features and do what it can do.

This would force all scripters to forget ruby and go learn a new language (ie: the RM language), but if executed properly we can have scripts that are compatible with all three engines without having to re-write them for each.

The RM language could be procedural I guess, but being procedural probably makes it harder to implement such an idea.

Edited by Tsukihime

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.