[XP] RMXPAce -- Using the VX Ace engine in your XP games

Started by Terv, February 17, 2013, 04:38:51 pm

Previous topic - Next topic

KK20

Just first want to point out your link redirects me to the home page, so I don't know what your image looks like.

I'm currently away from my computer for the weekend, so I won't be able to check in a few days.

EDIT: can you try, on the line with the .sub!, to replace it entirely with just an empty string
''

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Metaron

You're a lifesaver KK20, it fixed my error on start up.

It has given an odd display though with the top of the dialogue boxes where the player names shows, the main box seems to cut through it.

I've uploaded an image here for it:  https://imgur.com/grzmFdG

I've also modified the link in my previous post for the error if you need to see it still.

Do you reckon I need to fiddle with the settings in the [XPA] XPA_Window script?

Thanks again for your help :)

KK20

Might just be a z-layer issue. Check by changing the z value of the window that draws the name in its initialize method.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Metaron


Taylor

This system is a life-saver. Originally I started my project in RMXP, but then I was tempted by VXAce's engine in all the myriad of improvements it had. But god did I underestimate how much anxiety and frustration its mapping UI would cause. (why are there still not layer buttons in MV????)

So I went from XP to Ace and now to this. Now I have my project in XP with various things I've learned from Ace, along with engine improvements.
There is though one element that Ace improved on that I don't seem to see way to do here: Windows inside viewports.

In Ace you could use viewports to move sets of windows or display only portions of windows. You can't do that here - near as I can tell, setting an XPA_Window to be tied to a viewport doesn't change anything. I want to make a scrolling save file list, and I would do that by putting them in a viewport and scrolling that... but, no dice.
I can use viewports by using Ace's native Window module instead of XPA, but that seems to make padding fall apart, and I've made minor adjustments to the code for personal customisation, so I'd lose that.

For now I can just set co-ordinates for each window (i.e. (@file_index * @height) - ($scene.file_index * @height)), but I think the functionality of Ace viewports would still be an improvement.

KK20

Window viewports is actually a thing in XP too. This was something we've known about for some years now; Blizzard's XPA_Window doesn't use viewports correctly. Because the default scripts do not even assign viewports to Windows, for design reasons, it seemed better to use viewports to hold the window's sprites so that moving windows would be easier (changing the viewport x/y instead of each sprite's x/y individually). It wasn't until some user came across complaining about a script incompatibility that we were made aware that scripters were actually assigning windows to viewports.

I don't remember if someone ever provided a rewrite to make the windows behave as they should. I probably looked into it for a few days, but this was a long time ago.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

rfvtgbzxc

I'v already forggoten that the RMXP is 40-frame-based since I used the XPA, it's runs so fluently. I found a new game.exe which optimized by using DirectX, and I am trying to use this exe on XPA. However, the customized Tilemap of XPA occured some errors. The Tilemap try to call XPA_Tilemap.dll to implement varies updates, then it crashed, sometimes the Windows 10 would alert that this exe try to visit unauthorized memory such as 0x000000000000000c. I guess the XPA_Tilemap.dll may calculate something and inject them back to the game,but failed for the different exe.

My process of debuging stopped beacuse of my unknown of how this dll runs. May I know why creating and updating the tilemap needs to use the dll while the others(such as sprit) needn't? I'm also confused about the mechanism of Graphics.update, it seems that it don't need any parameter, and it can understand how to update the sprites needed correctly.

The DirectX-optimized exe is called RGD(RGDirect), and here is the link:http://cirno.blog/archives/290#instructions

Just forgive my confusions and my bad grammars, my English is not god. Without the RGD I can still make a fluent RMXP game by XPA but I want to try more. Thanks again for your XPA :)
 

KK20

Yeah, I have been following the development of that project for a while now. The reason it won't work with XPA is due to the usage of DirectX. The Bitmap object is handled entirely different now, so the DLL is accessing wrong memory address points to manipulate the color data.

If you want to use that EXE, you need a tilemap rewrite written in pure Ruby. Though, I'm more interested in MKXP since it's designed with XP in mind. I didn't pay much attention to it at first because I could never understand how to set it up and build it, but someone forked the project and provided instructions I could follow.
https://github.com/inori-z/mkxp-z

Again, this handles Bitmaps entirely different too (with OpenGL).

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

rfvtgbzxc

Quote from: KK20 on January 17, 2020, 03:16:13 amYeah, I have been following the development of that project for a while now. The reason it won't work with XPA is due to the usage of DirectX. The Bitmap object is handled entirely different now, so the DLL is accessing wrong memory address points to manipulate the color data.

If you want to use that EXE, you need a tilemap rewrite written in pure Ruby. Though, I'm more interested in MKXP since it's designed with XP in mind. I didn't pay much attention to it at first because I could never understand how to set it up and build it, but someone forked the project and provided instructions I could follow.
https://github.com/inori-z/mkxp-z

Again, this handles Bitmaps entirely different too (with OpenGL).
Very well. My first intention is to try to change some places which use the DLL. But now it seems not as easy as I thought to be before. I'll try the MKXP on XPA.

Taylor

February 06, 2020, 08:17:03 am #369 Last Edit: February 06, 2020, 08:22:05 am by Taylor
Update regarding viewports: in the end I just placed the contents of each save slot in a single Window_Scrollable, instead of drawing a set of windows for each. I had the feeling that the viewport issue was previously investigated, but it felt like the matter was dropped.

Also on the latter: MKXP is something I would greatly like to use, simply because multi-platform is a good idea, but I've never been sure how to make use of it - XP Ace uses a mix of RGSS1 and RGSS3, and there's no way to use both in MKXP. And of course, Win32API class support is out, which breaks XPA_Tilemap and XPA_Window. Never mind say, XInput support.
... I have no idea how to compile things, but I wonder if simply compiling a version of MKXP which always refers to XP's tilemap and window regardless of RGSS version would be a start...

Though regardless of RGSS setting, MKXP doesn't support OGG LOOPSTART. Loop points and remembering playback position of music after battle was what enticed me to VXA in the first place... before I realised how anxiety inducing the map editor would be.
EDIT: Actually wait it does support loopstart... if you also specify looplength. VXAce doesn't seem bothered by that, curiously, but I've found some other systems before require it.

whitespirits

Hello it's been a while! So I am wanting to use xpace purely for the map editor in XP, my question is can I use purely vxace project scripts and make use of the XP editor?

KK20

You would need a script (which would also include a tilemap rewrite) for VXA that can translate XP map.rxdata files. Which probably doesn't exist since events aren't the same between versions.

XPA was never designed to use VXA resources. In fact, you don't need XPA to even do what you want.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ickh

Hi!
This project is amazing and it worked like a charm!

Since I have the v.1.05 of RMXP, I tried to find a way the solve the problem with the dll replace. As stated in the OP, RMXP 1.05 replaces RGSS104E.dll with the original file and updates the content of Game.ini every time you save the project. So either ranaming RGSS301.dll to RGSS104E.dll (as written in the instruction) or modify the Game.ini to point RGSS301.dll will not work.
Renaming Game.exe and Game.ini is not enough because RMXP wants exactly "Game.exe" and "Game.ini" files in order to run the game from the editor.
So I have written a small program that will replace "Game.exe" and do nothing more than call the (actual) renamed Game.exe.

Download it.

Note: The program needs Microsoft .NET Framework 4 or higher.

Here the instructions to make all the process work (they are also contained in the zip).

First of all...
0. Install the XPA engine following the instructions in the first page of this thread (chapters "3.1" and "3.2")

Then extract the zip and...
1. Copy the RGSS301.dll from XPA to your project folder again without renaming it.
2. Go to your project folder and rename "Game.exe" with a name of your choice (eg. "MyGame.exe")
3. Make a copy of "Game.ini" and raname the copy accordingly to the new "Game.exe" (eg. "MyGame.ini")
4. Open the new ini file ("MyGame.ini") and modify the library name from "RGSS104E.dll" to "RGSS301.dll". You can make any other customization here, like changing the game title and the RTP reference. This will be the ini file of your final game.
5. Copy "Game.exe" and "XPA_Launcher.ini" from XPA Launcher to the project folder.
6. Open "XPA_Launcher.ini" and just write in it the new name of the Game.exe file that you chose in step 2 (eg. "MyGame.exe")

You can now open and save your project as usual!

Additional step

I don't know exactly why, but with these changes Rpg Maker no longer set the $DEBUG variable when you start the game from the editor. You have to set it manually by adding a script at the very top (before "[XPA] Configuration") with the following line:

   $DEBUG = true

   You can name the script "DEBUG MODE".
   Remember to delete or comment this script before releasing the game!


Enjoy!

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Metalgalamoth

March 05, 2021, 12:51:48 am #374 Last Edit: March 05, 2021, 03:43:23 am by Metalgalamoth Reason: Show more details abut the issue
Hello, I did test it on my project, I want to use it formally in the final version for my game on Steam, so I hope we can talk about the permissions :) also I got some few errors with 2 scripts, nothing big, just some help will be awesome. Cheers.

1. Error with script Elemental Graph, display a radial graph with the elements defs for the actor, but it shows me an error "NoMethodError ocurred" Private method "draw triangle" called for -bitmap:0x13a94864-

2. Error with script No Gameover, XPA Line 31: NoMethodError ocurred, undefined method "pwd" for 0:Fixnum

For now all other scripts works perfectly fine :)

KK20

Can you share the links to where I can download those two scripts?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!


KK20

The scripts you provided don't contain anything that cause the error. You're probably better off just giving me your Scripts.rxdata so I can see the full context of everything. I'm guessing these are multi-part scripts, and you only gave me a portion of it.

1. Private methods became a thing in RGSS3. In RGSS1, they had no effect, so it's weird to see a scripter try to utilize it. The solution would be to find where the method is being defined as private and simply removing it. It's not in the script you sent me.

2. There is no 'pwd' present anywhere in the script, so I can't investigate any further.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Metalgalamoth

March 08, 2021, 02:51:31 am #378 Last Edit: March 08, 2021, 02:58:01 am by Metalgalamoth
"len = Dir.pwd.size + 128"
thats in the line 31 in [XPA] XPA Engine Scripts :O

I see, well yes I just use this XPA for the first time, so I was just running all the scripts without any changes

Here are both scripts in a testing blank project, same errors

https://mega.nz/file/rc52CYbR#MboT0-kKnkEE5lhkAF951lOeuVmW1uH7Tk1tlOEuh1w

KK20

For the Dir problem, the script's author completely forgot that in Ruby there exists a module called Dir, which one of the XPA scripts relies on. They essentially wiped out the existence of that module by making a configuration option for it:
Dir = 0           # Direccion del Chara (2:abajo, 4:izq, 6:dch, 8:arriba)
This is bad design on their part. You can quickly correct this by renaming the variable to something else (like Direction) and updating the line
$game_temp.player_new_direction = Dir
accordingly.

EDIT: Actually, you might run into issues with this script again down the road, so let me just fix it up entirely:
#===========================================
# Script por: Kotfire
# Versión : 1.1
#-------------------------------------------------------------------------- ---
# -Instrucciones-
# Pegar encima de main y disfrutar
# Editar las condiciones (abajo)
# Si en algún mapa quieres quitarlo call script: $game_temp.battle_gameover = true
#-------------------------------------------------------------------------- ---
module NoGameover
  RecoverAll = false     # Recuperar hp, mp, estados...?
  Teleport = true     # Teletransportar a un mapa concreto?
  X =  20                 # Coord X del mapa
  Y = 7                  # Coord Y del mapa
  ID = 28                 # Id del mapa
  Direction = 0           # Direccion del Chara (2:abajo, 4:izq, 6:dch, 8:arriba)
  Exp = false            # Perder Exp?
  Exp_lost = 0           # Cantidad de Exp a perder
  Gold = false           # Perder Dinero?
  Gold_lost = 0          # Cantidad de Dinero a perder
  GameOver = false       # Ir al GameOver
  Nada = false            # Si no eliges nada, activa este para que no esten muertos
end

#========================================================================== ====
# ¦ Game_Temp
#========================================================================== ====

class Game_Temp
  #---------------------------------------------------------------------- ----
  attr_accessor :battle_gameover         
  #---------------------------------------------------------------------- ----
  alias initialize_kot initialize
  def initialize
    @battle_gameover = false
    initialize_kot
  end
end

#========================================================================== ====
# ¦ Scene_Battle (1)
#========================================================================== ====

class Scene_Battle
#--------------------------------------------------------------------------
  def judge
    if $game_party.all_dead? or $game_party.actors.size == 0
      if $game_temp.battle_can_lose
        $game_system.bgm_play($game_temp.map_bgm)
        battle_end(2)
        return true
      elsif !$game_temp.battle_gameover
        $game_system.bgm_play($game_temp.map_bgm)
        battle_end(2)
        for actor in $game_party.actors
          if NoGameover::RecoverAll
            actor.recover_all
          end
          if NoGameover::Exp
            actor.exp -= NoGameover::Exp_lost
          end 
          if NoGameover::Nada
            actor.hp += 0
          end
        end
        if NoGameover::Teleport
          $game_temp.player_transferring = true
          $game_temp.player_new_map_id = NoGameover::ID
          $game_temp.player_new_x = NoGameover::X
          $game_temp.player_new_y = NoGameover::Y
          $game_temp.player_new_direction = NoGameover::Direction
          $game_variables[13] += 1
          $game_variables[17] += 1
        end
        if NoGameover::Gold
          $game_party.lose_gold(NoGameover::Gold_lost)
        end
        if NoGameover::GameOver
          $game_temp.gameover = true
        end
        return true
      end
    end
    for enemy in $game_troop.enemies
      if enemy.exist?
        return false
      end
    end
    start_phase5
    return true
  end
end

For the draw_triangle problem, it has now occurred to me that Kernel methods can be called from another class, but will result in it being a private method. I guess I learned something new today.
Anyways, looks to be like an oversight the script's author missed completely. The draw_triangle method should be contained within the Bitmap class, like so
#==============================================================================
# Bitmap
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Draw Line
#--------------------------------------------------------------------------   
  def draw_elemental_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
    distance = (start_x - end_x).abs + (start_y - end_y).abs
    if end_color == start_color
      (1..distance).each {|i|
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
        if width == 1
          self.set_pixel(x, y, start_color)
         else
          self.fill_rect(x, y, width, width, start_color)
        end
      }
    else
      (1..distance).each {|i|
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
        r = start_color.red   * (distance-i)/distance + end_color.red   * i/distance
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
        if width == 1
          self.set_pixel(x, y, Color.new(r, g, b, a))
        else
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
        end
      }
    end
  end

# Elemental Star Settings
#--------------------------------------------------------------------------
# Element Star made by Tsu, based on Prefix's Element Wheel
#--------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Draws a triangle that passes (angle-wise) from start to end color
#----------------------------------------------------------------------------
  def draw_triangle(cx, cy, start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
    distance = (start_x - end_x).abs + (start_y - end_y).abs
    (1..distance).each {|i|
      x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
      y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
      r = start_color.red   * (distance-i)/distance + end_color.red   * i/distance
      g = start_color.green * (distance-i)/distance + end_color.green * i/distance
      b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance
      a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
      draw_elemental_line(cx, cy, x, y, Color.new(r, g, b, a), width, Color.new(r, g, b, a))
    }
  end
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!