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.

Using .dll or .so files in rmxp

Seto

Member

Is it possible to use either a .dll file or a .so file in an rmxp game? I have tried "require" but it wont allow me to load the files. I would like to know if you have done this before and how? From what I know it might not be possible to use .so files but I could be wrong. I only need to use one of these two file types form my game so either is good. If you need anymore infomation just ask.
 
The evil Enterbrain disabled the .so require ability of ruby in rmxp. However, you can use dll calling their API functions with Win32API class.
Example:
Code:
dll_api = Win32API.new("user32", "GetActiveWindow", "", "L")
hwnd = dll_api.call()
Here, in "Win32API.new("test", "GetTestValue", "L", "L")", the first value("test") is the dll name, the second parameter, is function name of the dll, the 3th parameter are the types and number of parameters to pass to the dll function, and the last parameter, is the type of value you will receive from the API.
For more info see http://www.ruby-doc.org/docs/Programmin ... ndows.html
 
Short answer, Yes.

Long answer, No,
you have to do
Code:
Win32API.new("user32", "GetActiveWindow", "", "L")
at least once for every function but then if you want to call a function more than once you only need to use
Code:
dll_api.call()

Hope it helps :thumb:
 

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