Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - ForeverZer0

Pages: [1] 2 3 ... 7
New Projects / [Ruby] FMOD Low-Level API Wrapper
« on: March 22, 2018, 11:52:32 PM »
I was in need of a good audio API when working on a C# application, and was unable to find an existing library that fit my needs, so I ended up making my own using the FMOD Low-Level API (the predecessor to the legacy FmodEx). After working with FMOD, and learning the ins-and-outs of how it worked, I saw the potential for making a Ruby port as well. Searching online turned up very little as far as any type of wrapper that could ever be considered close to complete, and only had the basic functionality of FMOD implemented. This including existing RPG Maker scripts that wrapped the basic functionality of the old FmodEx, but nothing more. This prompted me to write my own wrapper.

Being my programming experience begin with Chaos Project and old Ruby 1.8.2, I decided to write in a way that would remain compatible with old versions of Ruby, and foregoing using any Ruby gems or functionality that didn't exist in Ruby 1.8.2, and decided to stick with using Win32API to wrap the FMOD functions, and didn't allow myself the convenience of using a new library like Fiddle of FFI to make things simple.

Currently, the project is approaching the alpha stage. Nearly ALL core functions are implemented, but there has been no in-depth testing yet, and there are still a few mostly uncommon functionalities that need worked on. I have spent A LOT of time making documentation for it, as it is a huge API that definitely has a learning curve. If you don't believe me, see the spoiler.

(click to show/hide)

In the future, I will be releasing this as a gem, but as it stands now, the project can be loaded into RPG Maker with a simple "require", and built upon that. I may even create a basic Audio module rewrite with this codebase in the future, but if anyone else feels like doing it, feel free to check out the code and build upon it for RPG Maker Audio module.

  • Support for 20+ audio formats "out of the box", including all the RPG Maker standards (.mp3, .ogg, .mid, .wma, ect.) with support for more via a plugin system using existing FMOD plugins libraries
  • All basic playback control (play, pause, resume, seek, volume, etc, etc.) that you would expect of any audio player.
  • 20+ built-in effects for sound, including pitch shifting, flange, advanced reverb environments, multi-band parametric equalizer, chorus, tremolo, oscillator,  and many, many more.
  • Streaming of all audio formats, not just MP3
  • Full 3D and 2D support, with distance/directional based sound, each with own reverb environment.
  • Support for custom speaker setups, full surround sound support for up to 12 speakers.
  • Driver selection.
  • Supports music tags (ID3, etc) if that's your thing...
  • Much, much more.

As I stated above, this project is still in its infancy, but already far surpasses any existing audio API that I could find for the Ruby language, and because I love you all, I kept it compatible with RPG Maker XP and above.

This post is meant to a preview for a full release, and I would recommend not to port it as it currently is in a completed project. As so much yet is untested to any passable standard, lacks complete protection against segmentation faults, etc.



FMOD DLL (Required)


Source - Github

Getting Started

Download the scripts, place unzipped directory in RPG Maker project folder along with the downloaded FMOD dll.
Open script editor, add the line:
Code: [Select]
require File.expand_path('lib/fmod')
Just to give you idea to get started, snippet to play a sound:
Code: [Select]
sys = FMOD::System.create
sound = sys.create_sound('My Audio File.mp3')

Things to remember, the documentation, which is posted above, is currently lacking a lot of examples, so feel free to download the help file from FMOD's website, which can still be helpful on how to do things until the examples are created.

The documentation is not compiled, but can simply be unzipped and opening the "index" file within, which will open it in your browser.

FMOD object's need disposed! Once you are done using a sound, system, etc, call dispose or release on it to free the underlying handle. Obviously this behavior would be taken care of automatically when ported to RPG Maker. This is a developer's API, not an end-user product.

Below is generic audio module I wrote real quick just as an example as an example. It is already far more capable than the built-in Audio, but really more intended as just boiler-plate code.
(click to show/hide)

New Projects / MOVED: The Legend of Terra (XP)
« on: December 13, 2015, 07:22:43 PM »

News / Suggestions / Feedback / Forum Error?
« on: November 26, 2015, 09:30:40 PM »
Am I the only one who is getting this?
I see this on 3 different devices at the top of every page...

(click to show/hide)

News / Suggestions / Feedback / Android App for Chaos Project
« on: October 22, 2014, 11:45:29 PM »
So I was thinking at trying my hand at developing for Android, but I don't even know where I will find the time to do so.
Anyways, I had an idea of either myself, or someone more experienced, developing an Android app for CP, which could be better than than simply using a browser.

Any thoughts?

General Discussion / RTP Paths in the Registry (RMXP)
« on: August 16, 2014, 05:07:08 AM »
Are the RTP paths stored in the same location in the registry on all machines and versions of Windows?

On my machine, Win7 x64, I installed RMXP in compatibility mode for Windows XP SP3, and the RTP paths can be found at:
Code: [Select]
I was just wondering if there was different setups that could cause this to be different, such as whether the machine is 32 or 64 bit, the operating system (XP, Vista, Seven, Eight), and if installing in compatibility mode can change it.

I seem to remember that 32-bit machines are different, but I don't have a VM created at the moment, so I am not sure.

I assumed this was relatively simple, but as it turned out, its not. Now I ask that before you reply, I fully understand what is says in the manual, and I am not some noob who needs the basics explained to me, I am referring to rendering the textures on the device. I am also fully aware that the more recent object gets drawn first if they are equal.

I am running into a few minor issues with Z coordinates for this XNA/IronRuby engine I am making. The only place I really see this problem is with the default battle system. Here is what it appears as:

(click to show/hide)

As you can see, everything appears fine except for the enemy being placed above the @actor_command_window.

I have tried a couple different ways of factoring sprite.z and viewport.z, by simply adding them together as one way. I was incorrect in this assumption, this is the way that I have been calculating, but have run into problems here, as the screenshot demonstrates. The enemy sprites have a Z of 304 on their own viewport that has a Z of 0. The @actor_command_window has a Z of 100 (inherited from Window_Base) without a viewport, so 0 would be added to it to get it's final depth. That makes a final tally of the enemy sprites having a Z of 304, and the @actor_command_window having a Z of 100. This is the reason the enemy sprites are on top, so simply adding them is not the correct answer.

I assumed next that drawing was ordered by the viewports, and the sprite's z only pertained to that particular viewport. For example, if there are two sprites, sprite A with z of 10, and sprite B with z of 0, but sprite B's viewport.z was higher than sprite A's viewport.z, sprite B would still appear on top. I was incorrect in this assumption as well, which can be demonstrated with this little snippet in RMXP.
(click to show/hide)
If that logic was correct, the second sprite should be under the first, since it does not have a viewport, and the first sprite's viewport has a Z of 50.

So I began testing how they relate within RMXP, and I am just getting more confused.
(click to show/hide)
No matter which order the sprites are created in, this causes the second sprite to always be on top, even though it does not have a viewport,  and the first one does with a Z of 50, and both sprite's have the same Z value.

Now, lets change the first sprites viewport to 100, and change nothing else.
(click to show/hide)
The second sprite appears on top, but only because it was created more recently, as you can test by changing the creation order. This leads me to believe that the viewport's Z doesn't do a damn thing, since it appears it wasn't even factored in to the drawing, and only the order the sprites were created in.

So let's test this theory, I will increase the viewport's Z very high, and lower the sprite's Z.
(click to show/hide)

Oh wait, nope, that's not it, that makes the first sprite, with a lower Z, higher than the second sprite, simply because it's viewport was higher. But that didn't work earlier when we tried it with this snippet:
(click to show/hide)

So what the fuck? Does it simply take the higher of the two between the a sprite's viewport's Z, and it's own Z, then use that?  Or is there some magical, undocumented Z value added when a sprite does not have a viewport?

I don't know, maybe I am just getting burned out and need to take a break so I can step back and see this more clearly, but this has been my issue for the all of yesterday and today, and I have not gotten anywhere on it.

Chat / Goodbye, Opera (and μTorrent, too!)
« on: August 12, 2014, 12:32:04 PM »
For the past 4-5 years, I have been a loyal user of Opera (technically Opera Next...), but that time has come to an end. For the past year or so, the direction Opera has taken in development has made it too far removed from the reason I loved it the first place. Gone are all the great features that I loved.

It seems like since they made the switch to Chromium, things have turned to the worst. I don't blame the engine, it is is superior in my opinion, and the switch did drastically help with Opera's biggest fallback at the time, which was compatibility. But around the same time, they begin to turn it into a browser for "the common people", and begin removing all the great features that allowed me to tweak it to just how I liked. The "settings" have turned into an extremely basic couple of options that really don't allow you to customize anything (Internet Explorer has more options...). I was thinking the other day, what exactly does Opera have that makes it better than the competition, and sadly, my answer was "nothing".  The few things that set it apart, such as Speed Dial, are commonplace in all the other browsers now, or a simple add-on which supports even more customization to the look and feel of it than Opera ever offered.

So, with a heavy heart, I have made my switch to Chrome as my daily driver. I have already found a Speed Dial extension that suits  my needs, and I have found a great deal of other extensions that have already improved my browsing experience beyond what Opera has done in a long time. I have not noticed any difference in speed, both are top-performers (both use the same rendering engine), and I have found a lot more support and interest in Chrome.

On another note, I have also since abandoned μTorrent.  It used to be the best torrent client out there, without anything else even coming close in my opinion, but now it is turning into nothing but ad-ware. Since version 2.2.1 (it is now 3.4.2), I don't think anything really positive has been added to it, just different ways to annoy users with ads.  Sure, I can go into the "advanced settings" and with the help of Google manage to turn off the right things to make the ads go away, but its the very principle of it all, and the direction the company has taken that turns me off to it.  If anyone else feels the same way, I have found another great client over at SourceForge called qBittorrent. It is minimalistic, and aims at reproducing the good old μTorrent without all the extra crap. I have found that it performs equally well, has all the same options that I like, comes with no ads, and is even open-source.

In the end, I am happy with the new software I am using, but I just find it sad the direction developers have taken with their products, and turned them from masterpieces, to complete crap that alienates the users that their product targets. No longer will I remain supporting software when this is the direction taken. I would rather give my support to developers who strive for satisfaction of their target audience, and not how much crap can they cram into it to annoy people enough to purchase the "premium" edition.

Sea of Code / [XNA 4.0] WTF is going on here?
« on: August 10, 2014, 04:27:03 PM »
As most everyone knows by now, I am creating a new engine using XNA.
I am getting a very strange bug that I cannot figure out to save my life, and it is really starting to irritate me. As I mentioned in the Shoutbox a few days ago, I was having problems loading very large tilesets. As it turned out, XNA has some a maximum texture size of 2048x2048 using the Reach profile, and a maximum texture size of 4096x4096 on HiDef profile.

I changed the profile to HiDef (goodbye Windows Phone compatibility!), which vastly increased the size of the textures I can use. As far as RMXP is concerned, the largest images that are going to be used are going to be tilesets. Some of these tilesets have a height larger than 4096 pixels obviously, so in order for them to be used, I have to modify the image internally when it loads to fit within the 4096x4096 bounds. For testing purposes, I have been using Inquisitor's Medieval Exterior tileset, since it is one that I know off the top of my head to be one of the largest.

All these images are fairly large, so be warned.

(click to show/hide)

Now, here it is loaded internally. Basically the width just gets expanded and overflow greater than 4096 pixels gets moved to columns. This is the actual texture as it is loaded and used to draw a tilemap.

(click to show/hide)

Pretty straightforward conversion, and easy to work with, just have to do a quick calculation to adjust coordinates for over-sized source images.
This works perfectly with the exception of a bug that I cannot find or understand. For some stupid reason, a white border is being placed around some of the tiles, specifically the bottom of the last column (where actual image data is contained, not the extreme bottom), and the right side of some tiles in the next to last column, where beside it is blank data.

Example 1
The damn tents along the right side of the next to last column.
(click to show/hide)
(click to show/hide)

As you can see, there are no white pixels there to be copied. I checked the coordinates, they are correct, its just adding white there. I have tried clearing the GraphicsDevice with all sorts of colors, no change. I have tried changing the blend color, and all I get is white with a tint of whatever color I choose, not just the color, so it's reading that portion of the texture as white.

Example 2
Basically the same thing, just a different area of the tileset, this time at the very bottom. I added the "signature" section of the tileset to a map, and here is how it comes out.
(click to show/hide)
(click to show/hide)

I am at a loss for this one, and thus far, it seems to ONLY do it with them specific areas, the rest of the map looks perfect.
Any ideas?

General Discussion / The Resurrection of the Zer0 Division Engine
« on: August 02, 2014, 03:28:47 PM »
So remember a few years ago when I mentioned I wanted to build a new and improved game engine that holds compatibility with existing RMXP projects, using XNA and IronRuby? I dubbed it the "Zer0 Division Engine", and it was the inspiration that started ARC? In case you forgot.

Well, while working on Rpg.NET, I was still getting that feeling that all the shortfalls of RMXP were holding me back, so during the past few days, I have had some free time, and I decided to take a quick try at seeing what it would take to create my original idea, before it became ARC and changed to something completely different.

I just wanted to let you all know I have it running. There is still loads of things to do, but I have successfully re-created RGSS, and have a game running smoothly on the screen, with rewritten Graphics, Audio, and Input. The tilemap rewrite is superb, can can run any resolution smoothly, without any of the priority issues I ran into in my Ruby rewrite, and the Ruby interpreter puts RMXP's to shame.

I still have lots to do before I start posting anything up, namely font rendering looks like garbage at the moment, and I need to create a custom build of IronRuby to remove the "superclass mismatch" error we ran into with ARC, which was something added into later versions of Ruby.

Once I get this running stable, the sky is the limit with what can be done.

Sea of Code / Which do you think would be more efficient?
« on: July 25, 2014, 02:05:56 PM »
I haven't run any benchmarks or anything yet, so I am kind of just asking this out of my ass, but here goes.
I am working on the Input module for Rpg.NET, so keep in mind this is not being performed in Ruby, so there are some things that can be done that are not possible with a script. Here is my debate, which of these two directions to take it:

Direction 1 : GetKeyboardState
This was my original thought. Every time Input.update is called, invoke GetKeyboardState, enumerate the buffer the key states were copied to, and internally calculate and set flags in arrays to store which keys are triggered, released, repeated, etc. This is more or less just the same formula as Custom Controls in ToA, but written in C#.

After thinking about it, I really don't care for this approach. It is perfectly acceptable as a Ruby script, since the options there are more limited, but I am not a fan of the the need to enumerate 256 keys every time the update method is called, and perform a bunch of checks on each key to determine what to do about each.

Direction 2 : WindowProc
I already have a WndProc function in place that receives any message posted to the window, including key presses, key releases, mouse buttons, mouse wheel, mouse move, and just about anything else you could imagine that has an effect on the window.

My theory is, instead of checking the state of the keyboard every frame, I can simply update the states of the keys as the messages arrive, and do nothing in the meantime. That means no enumerating 256 every frame, and it has the obvious advantage of being an "all-in-one" method that can allow me to seamlessly integrate mouse input, as well as other anything else I want to implement.

My question is, are there any disadvantages of the second approach over the first?

Authors: ForeverZer0
Version: 0.28A
Type: Managed RGSS API
Key Term: Scripting Tool


Rpg.NET is an API built using the .NET Framework for both improving performance and enhancing the RPG Maker series (XP, VX, and VXA). Contained within are various functions and classes that extend the ability of RPG Maker in areas such as graphics, audio, and Windows API interop. Included is a Ruby script that is the wrapper around the library, so it can be used as any other script within your game.


  • Lag-Free Particle Engine
  • Save Bitmap as *.png, *.jpg, *.bmp, *.gif
  • Load Bitmap from *.psd, *.tif
  • Get/Set Bitmap Hue
  • Get/Set Bitmap Saturation
  • Get/Set Bitmap Contrast
  • Get/Set Bitmap Brightness
  • Get/Set Bitmap Gamma
  • Bitmap#draw_text_vertical
  • Bitmap#draw_arc
  • Bitmap#draw_bezier
  • Bitmap#draw_beziers
  • Bitmap#draw_closed_curve
  • Bitmap#draw_curve
  • Bitmap#draw_ellipse
  • Bitmap#draw_line
  • Bitmap#draw_lines
  • Bitmap#draw_polygon
  • Bitmap#draw_pie
  • Bitmap#fill_closed_curve
  • Bitmap#fill_ellipse
  • Bitmap#fill_pie
  • Bitmap#fill_polygon
  • Bitmap#fill_gradient_rect
  • Bitmap#fill_gradient_ellipse
  • Bitmap#fill_gradient_polygon
  • Bitmap#color_mask
  • Bitmap Effect - Invert
  • Bitmap Effect - Pixelate
  • Bitmap Effect - Change RGBA Color Components
  • Bitmap Effect - Soften
  • Bitmap Effect - Gaussian Blur
  • Bitmap Effect - Sharpen (Multiple algorithms)
  • Bitmap Effect - Edge-Detect (Multiple algorithms)
  • Bitmap Effect - Emboss (Multiple algorithms)
  • Bitmap Effect - High Pass
  • Bitmap Effect - Grayscale
  • Bitmap Effect - Poster Effect
  • Bitmap Effect - Bitonal
  • Bitmap Effect - Median Filter
  • Bitmap Effect - Tint
  • Bitmap Effect - Color Balance
  • Bitmap Effect - Solarise

  • Get duration of audio files, in milleseconds (*.mid not supported)
  • Get duration of audio files, in frames (*.mid not supported)

  • Get RTP Path(s)
  • Get Full-Path to Resource File
  • Change Window Resolution
  • Show/Hide Output Console
  • Screenshot Window (with or without window frame)


Original Image

(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)


Rpg.NET Developer Release Demo (v.0.25)


Inside demo. (v.0.25)

Version 0.28A
Rpg.NET.dll (701 kB)


As this is not currently a stable release build, I would not suggest using it in a release game at this current time. Although everything within at this time will remain in it, and you can begin to utilize what it has in your game, there are numerous improvements that need to be done,


Should work with RPG Maker XP, VX, and VXA, although testing has only been done with RPG Maker XP. Before final release, all versions will be tested to ensure compatibility.

Requires Microsoft .NET Framework 3.5. This is standard on Windows 7 and higher operating systems, and USUALLY installed on Windows XP and Vista systems if updated normally. If distributing with your game, I would suggest providing the above link just in case.

Credits and Thanks

  • ForeverZer0, for the library and script
  • All those on Chaos-Project who have offered ideas on functions to implement, and those who will continue to do so

Author's Notes

There are still quite a few things to implement, I wouldn't even consider this library 1/4 finished at the current time, so please keep that in mind. I have many planned features that have been suggested yet to implement, as well as many others not yet mentioned, such as Input and Audio extensions, Tilemap rewrites to support greater resolutions, and additional Graphic functions. I would appreciate if you have any ideas, to please share them, I am compiling a list, and slowly working through them, this release is simply to show how progress is coming, and to inspire new ideas.

If you encounter any bugs and/or crashes, please report them here in this thread so that they can be addressed. As I stated earlier, testing is currently only being performed on RPG Maker XP, so there may be errors with VX and VXA that I am currently unaware of.

I would like to hear about your experience as far as performance goes with the graphical functions. I have done my best to maintain the highest degree of performance with Bitmap manipulation, using only pointers to unmanaged memory wherever possible. As of right now, the only functions that do not implement this are the hue, saturation, contrast, brightness, and gamma methods, they use a color matrix, but I am in the midst of re-writing them functions to use unmanaged methods, and compare benchmarks.

The particle generators are rather lame at the moment, and only three very basic types currently exist. I was working more on just getting the underlying engine to work and perform efficiently than develop nice effects, but expect more to come in that area in future releases.

General Discussion / Programs Targeting .NET Framework
« on: July 20, 2014, 03:39:03 PM »
As I personally prefer to develop using C# and targeting the .NET Framework, I was wondering about other opinions. Usually I simply just target the minimum framework that makes sense for my project, and don't worry too much about it, since I am developing for the end-user, and my personal belief is that it's not a big deal to have someone update their system to a modern framework. Now though, I am developing for an API that can be used for other developers, and will require to be distributed with their projects, so I feel like it's important to get the view of others.

In the past few years, the .NET Framework, or more specifically, the development for it have drastically increased. A typical Windows XP machine will have version 2.0 installed on it, so that's basically the minimum version used in active development. That's not to say that it will be the highest version on an XP machine, only that it is what will be on it by default, if the user has decided not to keep up on their updates. Windows Vista comes with version 3.0, and Windows 7 comes with version 3.5.

.NET Framework Version 4.0 is not installed on any machine by default, but it is a common update. This is my personal version of choice, as it has a lot of nice added features to make development easier, and is not uncommon on any machine. Version 4.5 came out with Windows 8, but I doubt I will be targeting it any time soon, as it is pretty much only common on Windows 8 PC's, which yeah, we all know by now the story on that...

More or less, I am just curious. I would hate to stick to only using version 2.0 to cater to the die-hard XP users who refuse to install updates, and not be able to develop how I want, but I don't want to develop an API that other developers won't use because it MIGHT make the end-user install an update first.

If you could share your thoughts, it would be greatly appreciated and help guide my development.

RPG Maker Scripts / [WIP] Rpg.NET
« on: July 14, 2014, 11:25:55 PM »
    With the discover of how to export methods from managed .NET assemblies, and now the discover of how to manipulate RGSS Bitmaps from within a managed .NET assembly, I can now do all sorts of things that I have only dreamed of before, using my favorite programming language: C#.

    For the past few days, I have been working on a library to use in conjunction with script that can add all sorts of various improvements and enhancements to RPG Maker. So far I have implemented a few general "utility" methods, and have been focusing a lot on extending the Bitmap class.

    So far, this is what I have:

(click to show/hide)

(click to show/hide)

What I was hoping to get from this thread was some feedback and ideas on other things that could be implemented. I already have a few ideas that I already have plans for, or have already begin implementing, which I will list here, but please feel free to share your thoughts.

(click to show/hide)

(click to show/hide)

RMXP Script Database / [XP][VX][VXA] Prevent Window Deactivation
« on: July 11, 2014, 08:11:15 PM »
Prevent Window Deactivation
Authors: ForeverZer0
Version: 1.1
Type: Game Utility
Key Term: Game Utility


Normally, when the RGSS Player window is no longer the foreground window, the game becomes "paused", and only the music continues while the game is suspended. This small library will prevent that action, and the game will not be suspended.


  • Compatible with ALL RPG Maker version
  • Very small (only 10.8 kB)
  • Very efficient, does not constantly check every millisecond, simply filters Windows message events being processed on the window
  • Two lines of actual Ruby code






Download NoDeactivate.dll and place in your game folder.

The following two lines of code will need added to main:
Code: [Select]'NoDeactivate.dll', 'BeginMonitor', '', '').call
Code: [Select]'NoDeactivate.dll', 'EndMonitor', '', '').call
(click to show/hide)
(click to show/hide)
(click to show/hide)


See above.


Should now be compatible with ALL version of RGSS, including RMXP, RMVX, and RMVX Ace.
If you are having difficulties getting it to function correctly, first try to copy the library defined in Game.ini to the path defined there.

Although the likelihood is near nothing, scripts that completely change the Input module COULD have an effect, though I am not aware of any existing Input module rewrite that does.

Credits and Thanks

  • ForeverZer0, for the "script" and library.

Author's Notes

Please report any bugs or suggestions.

Source code is available at SourceForge.
In order to post-process the library after build, you will need to recompile the assembly with the Rpg.NET Export Tool I had previously made.

Development Tools / [C#] Move-Route Recorder
« on: June 21, 2014, 07:36:40 PM »
Move-Route Recorder (XP, VX, VXA)
Author: ForeverZer0
Version: 1.0
Type: Move-Route Tool


This is a simple tool for easily creating large event move routes without the need to keep track of the current location in your head. It records the cursor movement as you move the selection rectangle on the map editor screen, and can then playback the movement into an event's move route list.


  • Works with RPG Maker XP, VX, and VXA
  • Simple GUI and user-friendly
  • Very lightweight
  • Portable, no installation required


(click to show/hide)

(click to show/hide)


MoveRouteRecorder.exe (194 kB)

Source code available at SourceForge.

Credits and Thanks

  • ForeverZer0, for the application

Author's Notes

Please report any suggestions or bugs that you may find, thanks for using!

Development Tools / [C#] Rpg.NET Export Tool
« on: May 19, 2014, 04:17:54 AM »
Rpg.NET Export Tool
Authors: ForeverZer0
Version: 1.0
Type: .NET Post-Built Tool


This application is designed to allow you to create Microsoft .NET assemblies that can interop with RGSS using Ruby's Win32API. Assemblies built that target the .NET Framework are managed code, and are unable to be invoked using Ruby. This application performs a post-build process on your existing .NET projects that allows them to be invoked with Win32API, just like that of an unmanaged C/C++ library. Since many on this forum are C# (and other .NET Framework languages) programmers, this should hopefully open up many new possibilities for us that have since moved on from RGSS due to it's simplicity, but still have an active interest in it.


  • Extremely simple to create managed .NET assemblies that can interop with Ruby
  • Easily modify and use existing projects
  • Only need to add a single method attribute to functions that you want to export


.NET Framework v.4.0
Rpg.NET (116 KB)

Requires Microsoft .NET Framework 4.0

.NET Framework v.2.0
Rpg.NET (116 KB)

This version of the framework is already pre-installed on Windows XP SP3 and above.

Contains everything needed to built projects with exported functions.
  • RpgExport.exe
    Main tool that performs the compilation
  • RpgExport.exe.config
    Configuration file for the RpgExport tool. Can be modified manually, but not required
  • RpgExportAttribute.dll
    Library that needs to be referenced by your project, and contains the method attribute. The dependency will be removed during the post-build process, so this file will NOT need to be deployed with your project

Source Code
Source Forge


Step 1
Download the above file, and unzip to anywhere on your computer.

Step 2
Create a new project, targeting whichever framework you prefer. Remember that pretty much every Window's computer out there will have .NET Framework installed already on it, but higher versions such as 3.5 and 4.0 may not be, and could possibly require the end-user to install before your assembly will work on it.

After creating your project, make a reference to RpgExportAttribute.dll.

(click to show/hide)

Step 3
Now create your code as you please. The only important factor to implement is that the methods must be marked as "static", and they need decorated with the "RpgExport" attribute that is imported from the RpgExportAttribute.dll. The only required argument with the attribute is the name that it will be as exported as, which can be different than the actual method name. Following is a rather simple example:

(click to show/hide)

The name assigned within the "RpgExport" attribute is the name that will be invoked with Ruby's Win32API class.

Step 4
Now build your project, and open up the RpgExport.exe tool.
Either drag-drop the created assembly onto the form, type in the full path to the file, or use the dialog to set the assembly as the input assembly.

(click to show/hide)

Here is a quick explanation of the parameters that can be set in the application:
  • IL Assembler Location
    This is the location of "ilasm.exe", selected from list of versions found on the system. I personally have not found any difference in which version is used, and have always just used the highest version available.
  • IL Disassembler Location
    This is the location of "ildasm.exe", selected from list of versions found on the system. Again, I have not found any difference in which is used.
  • Input Assembly
    The input assembly that will be recompiled
  • Output Assembly
    This is the output path of the assembly. If blank, the input assembly will simply be overwritten.
  • Architecture
    This is the target CPU architecture the assembly will target. Typically "Any CPU" will work just fine.
  • Optimize
    This is the same as checking "Optimize" in the within the Build Properties of the project, and is the default of any "Release" build. There really isn't any reason this should not be used.

Step 5
After making any changes you need, click "Export" and the project will be rebuilt. Copy this output assembly to your RPG Maker project's game folder, and you are ready for a test.

(click to show/hide)

Step 6
Within RPG Maker, create the necessary Win32API object, and invoke your new method!

(click to show/hide)

(click to show/hide)

Tips and Tricks

I will add  more to this section later, and explain more on the few things that follow just to get you started.

Invoke Ruby Code From .NET Assembly

Include "System.Runtime.InteropServices" in a class, and use P/Invoke to exectute Ruby code. The only little hiccup I have run in to so far is that ensure any class that implements importing unmanaged DLLs is marked as "internal", and not the within a class you are exporting functions from. To see what I mean, look at the following two pictures.

(click to show/hide)

(click to show/hide)

Code: [Select]'RpgNet.dll', 'SayHello', 'p', '').call('ForeverZer0')
Encrypting/Compressing Scripts

Yup, this is actually quite simple, a very good encryption, but does require the use of one other post-built tool. I will explain more tomorrow within the next day or so.


Feel free to report any bugs, issues, or comments, I will try to answer anything that I can.
Please give credit if using in your project!

Development Tools / [C#] MouseBot
« on: March 23, 2014, 12:00:15 AM »
Authors: ForeverZer0
Version: 1.1
Type: Input Simulator


Recently I found need for a utility to automate mouse/input on my PC while I was away, and I employed the use of GhostMouse.  Unfortunately, this program is not free to use, and is only a limited trial unless purchased.  Although this can be bypassed easily, it inspired me to create my own application to do the same, so I introduce to you: MouseBot!

MouseBot is a very lightweight and simple program that comes packed with features to automate mouse movement, clicking, keystrokes, and text input. Simply build a list of commands with the user-friendly interface, and start the system to have them execute without your need to perform them. The possibilities are endless, and can be used for whatever you may require, such as automatically level-grinding in a game, fooling a web server to think that someone is still present to prevent a timeout, or whatever you can think of.


  • Commands allow for clicking, pressing, or releasing any mouse button/key
  • Configure to simulate Ctrl, Alt, and/or shift during keystrokes
  • Automatic text input
  • Configurable delays between actions, down to one millisecond
  • Automated mouse movement
  • Save/Load settings and commands
  • Configurable hotkeys for starting/stopping execution
  • And more!


(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)


Source Code


Requires Microsoft .NET Framework 4.0 or higher.

Any suggestions or bug reports are greatly appreciated!


Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)

Pages: [1] 2 3 ... 7