Dump contents of a (.lua) file

mfuesslin

Chieftain
Joined
Sep 6, 2015
Messages
11
Hi guys,

is there a way to load contents of a .lua file from another .lua file?
Something like:

Code:
local file = "../../../../Base/Assets/UI/Screens/CivicsTree_TABLET.lua";
local f = assert(io.open(file, "r"))
local content = f:read("*all")
f:close()

print(content);
It seems, that "io" is not accessible ("function expected instead of nil"). I also tried "local io = require("io");" without luck.

I try to debug the "CivicsTree_TABLET.lua" which is somehow different on the IPad than the original "CivicsTree.lua" on Windows. But to do this I need to view the contents of the file. As we cannot access the files of an IPad app in a non-jailbreak way, this is the only way for me to look at it...

Thank you for your help!
mfuesslin
 
You won't be able to do this, at least not through the game. The only way you can add the contents of one lua file into another is by using the "include(filename.lua)" command in another lua file. However, this won't allow you to print out the contents of filename.lua. What this does is add the contents of the specified filename.lua directly as part of code of the lua file where the "include" command appears -- this code is then treated as an integral part of the file with the "include" comand, and is parsed by the lua system into executable commands rather than as text strings you can cause the game to print.


If the IPAD version of the game locks you from looking at the contents of an lua file then I don't see any way you will be able to create an alternative version of the file for modding purposes.
 
Thank you very much for clarifying.
That's sad news... as it is nearly impossible to mod ipad-specific files without knowing them.
Then the only way to get the contents of the app files is jailbreaking...
 
Top Bottom