public static void RunGame() { // Sets extension load paths and working directory PrepareLoadPath(); try { Ruby.Eval("require 'zlib'"); } catch (Exception ex) { Error($"Failed to link zlib.\n\n{ex}"); } // Runs the script and returns raises a RuntimeError when window is closed. try { bool Success = Ruby.Load(Config.Script); if (!Success) { string exception = Ruby.FormatException(); Console.WriteLine(exception); Error(exception); } } catch (Exception ex) { string exception = "PERIDOT ERROR: " + ex.ToString() + "\n\n" + ex.StackTrace; Console.WriteLine(exception); Error(exception); } }