Last active
November 19, 2024 18:29
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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