How to use RGSS2 or RGSS3 with RPG Maker XP

You write :
#==============================================================================
# ** 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
Expand to see the code.


Can't you simply use :
$TEST = $DEBUG
Expand to see the code.

Easier ?
so is this more like vx merged with xp type of thing?....
or xp feeling like vx? -.-
o.o
platipus wrote:
so is this more like vx merged with xp type of thing?....
or xp feeling like vx? -.-
o.o

xp like vx .
it looks a little strange 
Interesting to know that this can be done.

Any known ways to stop the blur-i-fication of the sprites and tilemap and suchlike? It looks pretty awful with the XP sets, as they're supposed to look sharp and clear (since VX has bigger lines)
Example:
http://img.photobucket.com/albums/v487/ ... S2Blur.jpg[/img]
Blah...Blurry for teh loss and fail.

Still, the 60Fps is pretty awesome. Never seen it that smooth before. I also take it that there isn't an english rgss dll floating around yet. Naturally, this one sets the options screen to Japanese. Ouch. I was also initially confused at the sudden change of the default keys that RGSS2 apparently implements (Its now Z for pressing C...which is unnatural for me, though I suppose it might be useful for left handed people)
I don't know what you're doing because mine isn't blurry at all (unless, of course, you use one of the VX blur effects).
Nope, this is just the downloaded demo with the tilemap changed to poccils, and the 640x480 viewport fix added in. (I added a couple of trees, to see if they would be affected, and as you can see from the shot, they are)

An standard XP game run isn't affected by this; so I figured its an RGSS2 issue.
Dargor wrote:
Step 2 - Game.exe and DLL
[...]
b) Copy/paste RGSS200J.dll in your game folder and rename it RGSS102E.dll

seems wrong, why not just alter the Library=RGSS102E.dll line in your Game.ini so it reads Library=RGSS200J.dll
alexanderpas wrote:
Dargor wrote:
Step 2 - Game.exe and DLL
[...]
b) Copy/paste RGSS200J.dll in your game folder and rename it RGSS102E.dll

seems wrong, why not just alter the Library=RGSS102E.dll line in your Game.ini so it reads Library=RGSS200J.dll

I'm thinking that might not be a good plan, because your Copy of RMXP is probably expecting to find RGSS102E. Changing the .ini might work for the final edition of the game; but I don't know if you could edit it. I could be wrong though, you'd just have to try it.
eharper256 wrote:
alexanderpas wrote:
Dargor wrote:
Step 2 - Game.exe and DLL
[...]
b) Copy/paste RGSS200J.dll in your game folder and rename it RGSS102E.dll

seems wrong, why not just alter the Library=RGSS102E.dll line in your Game.ini so it reads Library=RGSS200J.dll

I'm thinking that might not be a good plan, because your Copy of RMXP is probably expecting to find RGSS102E. Changing the .ini might work for the final edition of the game; but I don't know if you could edit it. I could be wrong though, you'd just have to try it.


I tested the .ini method and it works exactly the same as the rename method. And yes, you can still edit it.

Also, I had problems with poccil's tilemap and now use RTH's. It doesn't give me errors when i make 500x500 maps

rth's tilemap Show
#==============================================================================
# Tilemap
#------------------------------------------------------------------------------
# Author of THIS VERSION: RTH
#==============================================================================

class Tilemap
 
  # Autotile Update Rate
  AUTOTILE_UPDATE = 10
 
  # Autotiles Index (Dont Change these numbers)
  INDEX = [
     [ [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] ]
  ]
 
  attr_accessor :ox
  attr_accessor :oy
  attr_accessor :tileset
  attr_accessor :autotiles
  attr_accessor :priorities
  attr_accessor :map_data
 
  def initialize(viewport)
     @viewport = viewport
     @swidth = (@viewport.rect.width / 32)
     @sheight = (@viewport.rect.height / 32)
     @data = nil
     @data_priorities = nil
     @priorities = nil
     @map_data = nil
     @tileset = nil
     @autotiles = []
     @sprites = {}
     @bitmaps = {}
     @cache = {}
     @need_counters = []
     @counter = []
     @max_counters = []
     @ox = 0
     @oy = 0
     @time_counter = 1
     @need_refresh = false
  end
 
  def refresh
     @need_refresh = false
     @table = Table.new(384)
     @size = 0
     @data = @map_data
     @data_priorities = @priorities
     min_x = [@ox / 32 - 1, 0].max
     min_y = [@oy / 32 - 1, 0].max
     max_x = [min_x + @swidth + 1 * 2, @data.xsize - 1].min
     max_y = [min_y + @sheight + 1 * 2, @data.ysize - 1].min
     (min_x..max_x).each {|x|
        (min_y..max_y).each {|y|
           (0..2).each {|z|
              tile_id = @data[x, y, z]
              next if tile_id == 0
              priority = @priorities[tile_id]
              key = [x, y, z, priority]
              @sprites[key] = Sprite.new(@viewport)
              @sprites[key].x = x * 32 - @ox
              @sprites[key].y = y * 32 - @oy
              @sprites[key].z = (y * 32 - @oy) + ((priority + 1) * 32)
              if tile_id < 384
                 tile = get_autotile(tile_id)
              else
                 tile = get_tile(tile_id)
              end
              @sprites[key].bitmap = tile
           }
        }
     }
  end
 
  def get_autotile(tile_id)
     if tile_id >= 384
        return get_tile(tile_id)
     end
     autotile = @autotiles[(tile_id/48) - 1]
     n = (autotile.width / 96)
     if @bitmaps[tile_id].nil?
        @bitmaps[tile_id] = []
     end
     if n > 1
        if @table[tile_id] == 0
           @counter[tile_id] = 0
           @max_counters[tile_id] = n
           @table[tile_id] = 1
           @size += 1
        end
     end
     for i in 0...n
        @bitmaps[tile_id][i] = get_tile(tile_id, i)
     end
     if @counter[tile_id].nil?
        return @bitmaps[tile_id][0]
     end
     return @bitmaps[tile_id][@counter[tile_id]]
  end
 
  def get_tile(tile_id, c=0)
     key = [tile_id, c]
     if @cache[key].nil?
        @cache[key] = Bitmap.new(32, 32)
        if tile_id < 384
           anim = c * 96
           id = tile_id % 48
           tiles = INDEX[id >> 3][id % 8]
           autotile = @autotiles[(tile_id/48) - 1]
           for i in 0...4
              tile_position = tiles[i] - 1
              rect = Rect.new(tile_position % 6 * 16 + anim, tile_position / 6 * 16, 16, 16)
              @cache[key].blt((i%2) * 16, (i/2) * 16, autotile, rect)
           end
        else
           @cache[key].blt(0, 0, @tileset, Rect.new((tile_id - 384) % 8 * 32, (tile_id - 384) / 8 * 32, 32, 32))
        end
     end
     return @cache[key]
  end
 
  def tileset=(valor)
     for v in @cache.values
        v.dispose
     end
     @cache = {}
     @tileset = valor
     @need_refresh = true
  end
 
  def dispose
     @cache.values.each {|v| v.dispose }
     @cache = {}
     @bitmaps.values.each {|a|
        next if a.nil?
        a.each {|v|
           next if v.nil?
           v.dispose unless v.disposed?
        }
     }
     @sprites.values.each {|sprite|
        next if sprite.nil?
        sprite.dispose
     }
     @sprites = {}
  end
 
  def update
     if @data != @map_data or @priorities != @data_priorities or @need_refresh
        refresh
        return
     end
     min_x = [@ox / 32 - 1, 0].max
     min_y = [@oy / 32 - 1, 0].max
     max_x = [min_x + @swidth + 1 * 2, @data.xsize - 1].min
     max_y = [min_y + @sheight + 1 * 2, @data.ysize - 1].min
     if AUTOTILE_UPDATE > 0
        @time_counter = (@time_counter + 1) % AUTOTILE_UPDATE
     end
     checked = []
     for x in min_x..max_x
        rx = ((x * 32) - @ox)
        cx = (rx < 0 or rx > (@swidth - 32))
        ax = (((rx + 32) < 0) or (rx > @viewport.rect.width))
        for y in min_y..max_y
           ry = ((y * 32) - @oy)
           cy = (ry < 0 or ry > (@sheight - 32))
           ay = (((ry + 32) < 0) or (ry > @viewport.rect.height))
           for z in 0..2
              tile_id = @data[x, y, z]
              next if tile_id == 0
              priority = @priorities[tile_id]
              key = [x, y, z, priority]
              if ay or ax
                 if @sprites[key] != nil
                    @sprites[key].dispose
                    @sprites[key] = nil
                 end
                 next
              end
              if @sprites[key].nil?
                 @sprites[key] = Sprite.new(@viewport)
                 @sprites[key].x = rx
                 @sprites[key].y = ry
                 @sprites[key].z = ry + ((priority + 1) * 32)
                 if tile_id < 384
                    tile = get_autotile(tile_id)
                 else
                    tile = get_tile(tile_id)
                 end
                 @sprites[key].bitmap = tile
                 next
              end
              if @changed_ox or cy
                 if @sprites[key].x != rx
                    @sprites[key].x = rx
                 end
              end
              if @changed_oy or cx
                 if @sprites[key].y != ry
                    @sprites[key].y = ry
                    @sprites[key].z = ry + ((priority + 1) * 32)
                 end
              end
              next if (@time_counter != 0)
              if @table[tile_id] == 1
                 if checked[tile_id] != true
                    @counter[tile_id] = (@counter[tile_id] + 1) % @max_counters[tile_id]
                    checked[tile_id] = true
                 end
                 @sprites[key].bitmap = @bitmaps[tile_id][@counter[tile_id]]
              end
           end
        end
     end
     if @changed_ox
        @changed_ox = false
     end
     if @changed_oy
        @changed_oy = false
     end
  end
 
  def ox=(valor)
     return if @ox == valor
     @ox = valor
     @changed_ox = true
  end
 
  def oy=(valor)
     return if @oy == valor
     @oy = valor
     @changed_oy = true
  end
 
end
Expand to see the code.


oh, I've made my own template already patched for screen resizing, and 500x500 tilemaps, and it uses RGSS 2.0.2.1 so it has newer patches. I don't think its illegal to provide these files as you get them with the RTP and you don't need to register for that... If it is, just remove the link from my post

rgss2template.zip
Wow... this is really cool, it brings everything great from VX to XP^^
You should all use RGSS202 now. I did this tutorial when I had only the trial version.

@t0nedef
First time I see this Tilemap script, I'll try it out tonight.
Dargor wrote:
@t0nedef
First time I see this Tilemap script, I'll try it out tonight.


its a little laggy, but i'm not a good enough scriptor to fix it.
Good Job!
But I've find a BUG in the given Tilemap script(e...I mean Poccil's...)
When you get into a very big map(such as 200X200)
An error will happened in Line 524
In order to fix it,we should change line 519 and line 520 into
"
LINE 519   for y in yStart..yEnd-1
LINE 520    for x in xStart..xEnd-1
"
(It seems like an array range error...maybe)

And there is one more question: What make it happen that after I have changed all $DEBUG into $TEST I still cannot use F9 to DEBUG? X_X


P.S: Please don't kill me for my poor English, I live in somewhere far from Earth -_-0
You need to add both $TEST = true and $DEBUG = TRUE to make it work.
Thanks for th bug report, I'll take a look at it.
can someone make a bug free demo of this with all vx scripts in? because i'm try some scripts and them don't work? this is truly 100% compatible with rgss2?
What? Why would you want to put RGSS2 + all VX script into XP? Why don't you just use VX?
And yes, everything from RGSS2 (from RGSS202E.dll, not VX scripts) will be 100% compatible with XP.
well i'm just want to migrate my vx project to xp without loose or convert any code. I'm want to migrate because xp tilemap format give more liberty to map than vx. correct me if i'm wrong and thanks for the reply Dargor
your gonna have to make some changes... and you'll need to redo all your maps. I don't know how major the changes to your scripts it will be. That really depends on what scripts you used and how they interact with your game environment.
Maybe, maybe, maybe, you can put every VX scripts in XP and use RGSS202E.DLL without adding ANYTHING else in the script editor (no new tilemap script, no RPG classes, nothing!) and maybe, maybe it will work.
Maybe :P But I don't see the point of making this.

But if you only want the XP mapping style in XP, you should probably use azrith's XP map editor for VX.
http://www.creationasylum.net/index.php?showtopic=23617
I noticed that plane was blank in the script editor... any idea what it's supposed to be?
It's nothing, you can delete it. The Plane class in RGSS2 doesn't differ from RGSS1.
I've played around with this, no rgss2 script works with this method... I'd just recommend using vx and painly map your game maps, or just use rgss1.
The goal of this isn't to use RGSS2 scripts. This tutorial is for XP, not VX. The RGSS library is still the same as RGSS1. The only difference is that you gain some RGSS2 features on XP. Things like blur, radial_blur, snap_to_bitmap, resolution changer, sprite wave effect and A LOT more.
Oh, well that makes sense then.
This is just perfect I just implemented the RGSS2 and it is a sweet thankyou DARGOR you rule! by the way I only have a non-working thing it's the DEBUGER .. It doesn't work I press F8, F9... and nothing happends!! =( some help here??
it's because the $DEBUG flag doesn't exist in RGSS2, it has been replaced with $TEST.
So in Main, at the very begining of the script, add $DEBUG = $TEST.

If it doesn't work, then add $DEBUG = $TEST = true instead. Note that in the final version of the game you'll have to set these variables to false, add $DEBUG = $TEST = false, or else, the player will always be in debug mode.
PERFECT!  :thumb: :thumb: thank you very much
I wanted something extra!!  🙂 Dargor as you seem to understand a lot of this things!! :P
I have my game running at 640x480... but unlike everyone else I want that, if people try to full-screen it the black border happears
(people always want the opposite but here is diferent ;).. ) thankyou in advance
Good idea, I'll make a little add-on for that. :thumb:
Good god Dargor! I think I just cried a little. This is to beautiful for words! I mean I've done this before but just how simple and complete it is is just beautiful! I can't believe how well you did yourself in this one!

Dargor you did it again. =D

XD hahah! VX scripts almost converted! Had to do some module playing around! SOON we will have a VX XP!

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=34903