Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

The Structure of RGSS202E.dll

Hi,

I've been modifying a lot of RPG classes in my project and added new child classes to already existing RPG classes.
On runtime, it works fine. However, when I close RM and reopen it, it crashes saying 'unable to load data'.

This is a normal behavior since these new child classes aren't in the original RGSS library and so it can't find and load it.

My question is: is it possible to create a new library containing my new classes and include RGSS202E.dll to this new library?
If it is, then I'd like to know if anyone knows how it's been originally coded so I can incorporate my new classes to the RGSS library.
I've been playing a bit with C++ recently, compiling DLLs and using them with RPG Maker. It's mainly for modifying bitmaps on runtime but can this be of any use?

Thanks in advance!
-Dargor
 
That would be hard to make. Creating a new library that works with RMVX could be possible but totaly hard. You would need to remake all the RGSS202E APIs, and as far as I know nobody knows how they work and what they do.

An easier attempt could be to inject the new code in the DLL, and that's possible as I made for my RGSSAD Exractor. However that worked with the Game.exe Player, I've never tested it with the editor.
 
I've tested a bit and it seems that RMVX won't load a modified RGSS202E.dll. So it seems useless to modify it for the editor, though it will work for the player.

However RMXP will load a modified RGSS102E.dll, I tested it with a modified uncompressed RGSS102E.dll. I changed some initial values for some RPG classes and when creating a new item in the database it was created with the modified values, so it works well.
 
First you'll need an uncompressed DLL, here I have one uploaded: http://www.fileden.com/files/2007/2/10/757733/RMXP Others/RGSS102E-uncompressed.rar

Then you will need a hex editor, any will do but if you haven't one already I suggest http://frhed.sourceforge.net/.

Open the dll file with the hex editor and search for "module RPG", that is where the RPG classes start.
hexz.png


This script is in only one line, with ";" as statments separators. If you want to add new things you will need to make more space compressing that script there, as you can't use more than what it already uses. I suggest eliminating spaces like "@id = 0;" to "@id=0;" or better using "attr_accessor" with multiple parameters.

Example:
Code:
class Actor;def initialize;@id = 0;@name = '';@class_id = 1;@initial_level = 1;@final_level = 99;@exp_basis = 30;@exp_inflation = 30;@character_name = '';@character_hue = 0;@battler_name = '';@battler_hue = 0;@parameters = Table.new(6,100);for i in 1..99;@parameters[0,i] = 500+i*50;@parameters[1,i] = 500+i*50;@parameters[2,i] = 50+i*5;@parameters[3,i] = 50+i*5;@parameters[4,i] = 50+i*5;@parameters[5,i] = 50+i*5;end;@weapon_id = 0;@armor1_id = 0;@armor2_id = 0;@armor3_id = 0;@armor4_id = 0;@weapon_fix = false;@armor1_fix = false;@armor2_fix = false;@armor3_fix = false;@armor4_fix = false;end;attr_accessor :id;attr_accessor :name;attr_accessor :class_id;attr_accessor :initial_level;attr_accessor :final_level;attr_accessor :exp_basis;attr_accessor :exp_inflation;attr_accessor :character_name;attr_accessor :character_hue;attr_accessor :battler_name;attr_accessor :battler_hue;attr_accessor :parameters;attr_accessor :weapon_id;attr_accessor :armor1_id;attr_accessor :armor2_id;attr_accessor :armor3_id;attr_accessor :armor4_id;attr_accessor :weapon_fix;attr_accessor :armor1_fix;attr_accessor :armor2_fix;attr_accessor :armor3_fix;attr_accessor :armor4_fix;end;

Code:
class Actor;def initialize;@id=0;@name='';@class_id=1;@initial_level=1;@final_level=99;@exp_basis=30;@exp_inflation=30;@character_name='';@character_hue=0;@battler_name='';@battler_hue=0;@parameters=Table.new(6,100);for i in 1..99;@parameters[0,i]=500+i*50;@parameters[1,i]=500+i*50;@parameters[2,i]=50+i*5;@parameters[3,i]=50+i*5;@parameters[4,i]=50+i*5;@parameters[5,i]=50+i*5;end;@weapon_id=0;@armor1_id=0;@armor2_id=0;@armor3_id=0;@armor4_id=0;@weapon_fix=false;@armor1_fix=false;@armor2_fix=false;@armor3_fix=false;@armor4_fix=false;end;attr_accessor(:id,:name,:class_id,:initial_level,:final_level,:exp_basis,:exp_inflation,:character_name,:character_hue,:battler_name,:battler_hue,:parameters,:weapon_id,:armor1_id,:armor2_id,:armor3_id,:armor4_id,:weapon_fix,:armor1_fix,:armor2_fix,:armor3_fix,:armor4_fix);end;

Then you just need to place the new modified dll in the RMXP editor folder.

Edit: You can also try to add a "require 'something'", and add in that .rb all your modifications.
 
Nice, it seems to work well indeed.

Now I'd need an uncompressed version of RGSS202E.dll since this is the library I'm using.
Do you have one or have you any advice on how I could get one? Maybe I could do it myself?
 
Thanks a lot vgvgf, I'll play with this a little more tonight. :)
You say that I can't use more space that there is already in there. Why is that? Is it possible to expand the space available?
 
That string has a fixed size, I don't know where the size of that string is stored or how to modify it as it is compiled, so you can't insert new bytes of data in the dll for making the script string longer because it won't work. I think that the position and lenght of a string, functions, and other things are stored in some kind of index somewhere in the dll, and that's not human readable. If you insert new bytes of data, you would need to modify the position of all next functions, strings. resources, and else in that index, and that's hard work.

But as I said earlier, if you need more space, you can try adding a require function and load a .rb. That may work.
 
Yes it is. Now I wish there is enough space for me to add all I need.

EDIT:
Actually you're more than right, using no spacing at all and using only 1 attr_accessor with multiple arguments will save a whole lot of space.
Also, it seems like I can copy/paste text directly into the dll! Pretty nifty, I could rewrite all RPG classes on 1 line in a text file and then paste this in the hex editor. Then I could fill all the extra space with empty values and have a direct visual feedback of how much space is left.

Maybe I'm wrong but if it's that easy then I find this really funny! :P
 

e

Sponsor

A bit late here, but here's an interesting Microsoft project that allows you to rewrite the DLL's in-memory code, so that you don't have to package a full new RGSS dll but just your tiny one with Detours (which is also pretty small). It can also be used to intercept DLL calls and bunch of other features. I've used it before to add Ruby packages and other useful things.

Detours

I know you've already worked with the other solution, but maybe in the future you'll consider this :eek:
 
Hmmmm that's interesting and might be really useful.
I have so many new RPG classes that optimizing the module directly in the DLL probably won't free enough space.

So yes, I will take this into consideration.
It seems a bit complicated though. Do you have any good tutorials or "how to" that can help me work with this?

But hey, very nice find! :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top