On Lua Scripting Limitations

Feedback on past, current, and future development.
darkbasic
Posts: 124
Joined: 18 Apr 2016, 15:45
Contact:

Re: On Lua Scripting Limitations

Post by darkbasic »

I'm all in for sandboxing.
User avatar
Tauin0349
Posts: 2
Joined: 08 Apr 2021, 04:56

Re: On Lua Scripting Limitations

Post by Tauin0349 »

while I agree that a sandox should be implemented for compatability reasons as you dont want them shipping mods that only work on one platform, or break after an update because something changed (im looking at you SKSE and various DLL mods before the address library), preventing write access could hinder some mods that rely on that, I'd argue that lua scripts should have read/write access to everything in the data folder and nothing more.

as for config files, im fine with having them have some kind of export/import feature if it means that config files are standardised with something like TOML/YAML/JSON.
User avatar
Tauin0349
Posts: 2
Joined: 08 Apr 2021, 04:56

Re: On Lua Scripting Limitations

Post by Tauin0349 »

oh and as for lua scripts accidentally deleting directories, just, dont let them do that? deleting flies within those directories is fine imo, but stopping them from deleting directories is a safe way of preventing disaters.
User avatar
psi29a
Posts: 5080
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: On Lua Scripting Limitations

Post by psi29a »

I don't understand why this is that hard? Any file available in OpenMW's VFS is readable. So that's a none-issue.

The writing part is something we have to provide some special hand-holding for. Having free-rain to write to a filesystem, and then something as mundane has filling up your filesystem because a mod went nuts is suddenly possible. Suddenly your SSD (for example) is being thrashed, and ruining the life of the device, or filling it up and causing everything to slow down because your SSD works fastest when it's under 80% usage. Or your OS hangs on you because it can't create additional resources due to disk being full. These things are still possible even if we limited writing to only a specified area.

It's a bit different from those who specify options in the launcher/settings because you are warned ahead of time and make the conscious decision to turn things on. They also trust that OpenMW makes a best-effort interest to protect users. That same level of trust just isn't there for mods. Most people don't even read the instructions, so why would they even bother to read through the Lua?
User avatar
wazabear
Posts: 42
Joined: 13 May 2020, 19:31
Gitlab profile: https://gitlab.com/glassmancody.info

Re: On Lua Scripting Limitations

Post by wazabear »

Tauin0349 wrote: 08 Apr 2021, 12:15 as for config files, im fine with having them have some kind of export/import feature if it means that config files are standardised with something like TOML/YAML/JSON.
Honestly, Lua tables are perfect for this. Easy for modders, trivial to serialize, and easy to read (users rarely actually edit offline config files if we implement the MCM, which I plan on). You write and store all mod config in Lua!

No weird syntax or gotchas that those ZOML/GOML/SOML formats introduce.
Fade away and radiate
Post Reply