Accessing OS in LUA code for creating a mod
-
Hi there!
I have some ideas for FAF mods that require executing external script (in pyhton actually, however I can compile it into an executable or run it on server with HTTP interface).
I've never worked with lua before, so I've been studying this topic for a while recently: whether it is possible to access literally SOMETHING except of the log file from isolated lua environment?
Maybe some lubraries can be added, just like the JSON library is added?
Would be grateful for any help or advice!
All the best! -
The Lua version in FA is sandboxed and has no access to the file system or the network.
-
@sussusamogus said in Accessing OS in LUA code for creating a mod:
Hi there!
I have some ideas for FAF mods that require executing external scriptCan you give us/me an example?
what kind of mod or function you have in mind? -
@uveso I thought about machine learning and neural networks utilization. AFAIK, there's no e.g. tensorflow distribution for lua.
-
@brutus5000 could someone patch the engine to make some outside interaction possible?
-
Permitting outside interaction would open the gates for malware
-
@blackyps that's all very understandable. However textures, sounds and effects can be bundled using mods.
Maybe it could be possible to provide modders with possibility of including some "trusted" scripts into their mods too? Such mods could be double-checked by community, moderators and marked as "unsafe" in storage...
-
@blackyps i would not like to see it done for normal games, but if it was possible using some ML for an ai would be quite cool. Even if its not used outside of a dev environment.
-
At least file IO would be very helpful and (potentially) not very harmful. Like reading from a file packaged along with a mod - what can go wrong with that?..
HTTP IO would be even better. Just like sending and receiving simple JSON requests - no js scripts and stuff...
Let me know if you decide to implement it - I can provide any support needed!
-
Writing Io is super dangerous. A harmful or buggy mod could overwrite files or flood the disk.
Reading http during the game is also dangerous , because requests can fail (=desync) or take longer (=lag).The lua engine is hardcoded into the engine. A few experts tried updating it with a newer version for performance improvements, but despite many years of trying it does not work.
-
@Brutus5000 Well, the current game implementation actually doesn't protect you from flooding a disk (screenshot command) or checking for file existanse in sim may cause desync or creating too many logs causing lags. IO will make it only less complicated at this point.
-
We won't introduce additional IO functionality. As Brutus states, it is extremely dangerous. @Genos is technically correct that we can already flood the disk, but that isn't an argument to open up more IO functionality.