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.

Load WIN32OLE class

I need to use this class, but the RGSS does not have it. So I try to load it from a .so file, but RMXP can't load these files.

My question is: How can I load .so files?
Or: Does an other way to load the win32ole class exists?
 
The Ruby standard libary files are .rb files themselves, so you you CAN require them like that. just take a look:

Code:
English.rb              parsearg.rb
Env.rb                  parsedate.rb
README                  pathname.rb
abbrev.rb               ping.rb
base64.rb               pp.rb
benchmark.rb            prettyprint.rb
cgi                     profile.rb
cgi-lib.rb              profiler.rb
cgi.rb                  pstore.rb
complex.rb              racc
csv.rb                  rational.rb
date                    rdoc
date.rb                 readbytes.rb
date2.rb                resolv-replace.rb
debug.rb                resolv.rb
delegate.rb             rexml
drb                     rinda
drb.rb                  rss
e2mmap.rb               rss.rb
erb.rb                  rubyunit.rb
eregex.rb               runit
fileutils.rb            scanf.rb
finalize.rb             set.rb
find.rb                 shell
forwardable.rb          shell.rb
ftools.rb               shellwords.rb
generator.rb            singleton.rb
getoptlong.rb           soap
getopts.rb              sync.rb
gserver.rb              tempfile.rb
importenv.rb            test
ipaddr.rb               thread.rb
irb                     thwait.rb
irb.rb                  time.rb
jcode.rb                timeout.rb
logger.rb               tmpdir.rb
mailread.rb             tracer.rb
mathn.rb                tsort.rb
matrix.rb               un.rb
mkmf.rb                 uri
monitor.rb              uri.rb
mutex_m.rb              weakref.rb
net                     webrick
observer.rb             webrick.rb
open-uri.rb             wsdl
open3.rb                xmlrpc
optparse                xsd
optparse.rb             yaml
ostruct.rb              yaml.rb
 
A require/load to win32ole can't be done, because there isn't a win32ole.rb file, or nothing in a .rb file that has the win32ole class.
Does a script for loading .so or .c files exist? I have search for it but I don't find anything.
 
------------------------------------------------------------------ Kernel#require
require(string) => true or false
---------------------------------------------------------------------------------
Ruby tries to load the library named string, returning true if successful. If the filename does not resolve to an absolute path, it will be searched for in the directories listed in $:. If the file has the extension ``.rb'', it is loaded as a source file; if the extension is ``.so'', ``.o'', or ``.dll'', or whatever the default shared library extension is on the current platform, Ruby loads the shared library as a Ruby extension. Otherwise, Ruby tries adding ``.rb'', ``.so'', and so on to the name. The name of the loaded feature is added to the array in $". A feature will not be loaded if it's name already appears in $". However, the file name is not converted to an absolute path, so that ``require 'a';require './a''' will load a.rb twice.

require "my-library.rb"
require "db-driver"

Good ol' fxri says Ruby knows how to load .so files, so try and load them.
EDIT: Download win32ole.so if you need it
 
It appears that RMXP has a faulty, or out of date version of require(RMXP is running Ruby 1.8.1). Silly Microsoft Visual C++ runtime errors.
What, might I ask, are you going to do with Win32OLE?
 
I want to implement SAPI to rmxp, so the event messages(or other things) can be speaked by the program.

It is very simple, it need only two lines for work:
Code:
Speech = WIN32OLE.new("SAPI.SpVoice")
Speech.Speak("The computer will talk...")
 
Oh, god.
Can't you guys read?
RGSS is a limited version of ruby.
You can't load .c or .so files. There's no way to do this.
I know that the RGSS is limited, if it were not limited, I would not be requesting something to load it.
There's no way to do this with the original RGSS, but it can be expanded for load .so or .c files; or another way to use the Win32OLE class.
 
It looks like there's a function called Speak_String within the DLL.
Here's the function's arguments : (text, voice_number, delkeep, uvs, volume, ups, pitch, uss, speed)
Note that I have no idea what those arguments refers to.
But it looks like you need to initialize other functions for this to work...
 

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