ok, i have a bit of information for you regarding the dofile() method.
The script is relative to the exe applications directory.
For the "Skyline Editor.exe", this means the base directory is "Win32_Release" folder. If the script is in there,
then you can use this:
- Code: Select all
dofile("Base.lua");
But this is not a good place to put scripts lol. So to get to the asset library, you need to use:
- Code: Select all
dofile("../../Asset Library/Scripts/Base.lua");
But this is not a good method either because of the end game which could be packaged meaning no hard drive file paths and the lua file would have to be streamed into memory for use creating an unknown bug to solve atm.
The other option is no archiving in the end game, but even that has a different folder path:
- Code: Select all
dofile("Assets/Scripts/Base.lua");
This is a challenge to get around lol
Edit: What i might do, is create my own c++ version that does the same thing as dofile() command and if loading from a stream, then use dostring instead. Could be interesting and will keep you informed.
Edit 2: I have now made a new skyline command, instead of calling dofile. We now use:
- Code: Select all
sky.include("myscript.lua")
That's all that's needed and it will work in the end game and in the editor/player.
It finds the file based on the editor resources. So make sure to add the file to the list before calling.