Accessing OS in LUA code for creating a mod

0

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!

0

The Lua version in FA is sandboxed and has no access to the file system or the network.

"Nerds have a really complicated relationship with change: Change is awesome when WE'RE the ones doing it. As soon as change is coming from outside of us it becomes untrustworthy and it threatens what we think of is the familiar."
ā€“ Benno Rice

0

@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 script

Can you give us/me an example?
what kind of mod or function you have in mind?

0

@uveso I thought about machine learning and neural networks utilization. AFAIK, there's no e.g. tensorflow distribution for lua.

1

@brutus5000 could someone patch the engine to make some outside interaction possible?

1

Permitting outside interaction would open the gates for malware

0

@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...

0

@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.

0

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!

1

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.

"Nerds have a really complicated relationship with change: Change is awesome when WE'RE the ones doing it. As soon as change is coming from outside of us it becomes untrustworthy and it threatens what we think of is the familiar."
ā€“ Benno Rice

0

@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.

My github repo with UI Mods

1

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.

A work of art is never finished, merely abandoned