>If you have any trouble, feel free to ask on the Gosu boards. Ocra is still a project in development and everybody can benefit from sharing your experience.
ocra main.rb lib\*
. The wiki page says I must also change the path environment "like this":ENV['PATH'] = File.join(GAMEROOT,"lib") + ";" + ENV['PATH']
ocra main.rb fmod.dll
, Windows even broke from command line protocol and popped up a message saying "fmod.dll is either not designed for windows or it has an error. Blah blah blah..." and then the game would crash with the first attempt to use a sound returning the "could not load fmod.dll" error.GAMEROOT
: To get the folder your game lives in, I believe File.dirname($PROGRAM_NAME)
will do what you want—it does on Mac and Linux, but I don't have experience with Ruby on Windows.ENV['PATH']
: ENV
is a Hash-like object that grants access to your program's environment variables—basically information about the environment the program is running in that it passes on to its children. These variables can be modified by any process, but changes only apply to that process and any child processes it spawns after the change. These values can only be strings.PATH
in particular is a colon-separated (Unix) or semicolon-separated (Windows) list of directories that tells the operating system where to search for an executable when it's called. Apparently, on Windows, it's also used to find dynamic libraries.ENV['PATH'] = File.join(GAMEROOT, 'lib') + ';' + ENV['PATH']
is essentially prepending your own search path to the list of search paths. File.join(GAMEROOT, 'lib')
can be seen as a fancy way of saying "#{GAMEROOT}/lib"
, but it will use the platform's native directory separator instead of a hard-coded one. The semicolon is, of course, to separate your path from the rest.game_root = File.dirname $PROGRAM_NAME
ENV['PATH'] = File.join(game_root, 'lib') + ';' + ENV['PATH']
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill