Skip to content

Instantly share code, notes, and snippets.

@k0ffinz
Last active November 19, 2024 18:29
Show Gist options
  • Select an option

  • Save k0ffinz/1a5eaa3b6693f7482ff36c51520e7f4c to your computer and use it in GitHub Desktop.

Select an option

Save k0ffinz/1a5eaa3b6693f7482ff36c51520e7f4c to your computer and use it in GitHub Desktop.
Psych Engine Lua snippet to use RalLib. This way the module can be placed into the scripts folder as well as providing support to Android system.
local scriptFileName = stringSplit(scriptName, '/')
scriptFileName = scriptFileName[#scriptFileName]
local src = scriptName:sub(1, - #scriptFileName - 1)
local function warn()
debugPrint('Please download and put RalLib into the same folder as script.')
debugPrint('RalLib.lua file is not present in the scripts directory.')
debugPrint('')
debugPrint('')
end
if buildTarget == 'windows' then -- windows
if not checkFileExists(src:sub(6, -1) .. 'RalLib.lua') then warn() end
RalLib = require(src .. 'RalLib')
else -- linux-like
if not checkFileExists(src .. 'RalLib.lua', true) then warn() end
package.path = src .. '?.lua'
RalLib = require('RalLib')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment