The new MWSE-Lua interface

Everything about development and the OpenMW source code.
Post Reply
User avatar
SeaFox
Posts: 34
Joined: 29 Feb 2016, 17:30

The new MWSE-Lua interface

Post by SeaFox »

While browsing Nexus Mods, I noticed that Tamrielic Lore Tooltips requires MWSE (2.1+) because of the new MWSE-Lua interface.

From the Morrowind Script Extender v2 documentation:
Starting in MWSE 2.1, modders are able to create powerful, event-driven modifications to The Elder Scrolls III: Morrowind using the Lua scripting language.

Unlike traditional mwscript, Lua scripting is responsive. Instead of checking every frame to see if an object is being activated, a mod might register to see if their reference was activated.
It seems to me that Lua scripting may be the future of Morrowind modding now that it is being incorporated into the Morrowind Script Extender (MWSE). I am wondering how much MWSE functionality is being built into OpenMW, including Lua scripting, and how this will effect the availability of mods to users of OpenMW.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: The new MWSE-Lua interface

Post by akortunov »

Currently there is no Lua in OpenMW, only in the TES3MP (but it does not support an MWSE 2.x API).
We just do not have volunteers to implement it.
NullCascade
Posts: 121
Joined: 16 Jan 2012, 07:58

Re: The new MWSE-Lua interface

Post by NullCascade »

akortunov wrote: 30 Sep 2018, 16:20We just do not have volunteers to implement it.
I volunteered to do the work and concurrently work on both OpenMW-Lua/MWSE-Lua at the same time to make a compatible API. You had the volunteers, but the OpenMW project wants a different direction.
User avatar
SeaFox
Posts: 34
Joined: 29 Feb 2016, 17:30

Re: The new MWSE-Lua interface

Post by SeaFox »

NullCascade wrote: 30 Sep 2018, 16:42 I volunteered to do the work and concurrently work on both OpenMW-Lua/MWSE-Lua at the same time to make a compatible API. You had the volunteers, but the OpenMW project wants a different direction.
Seems like the best course of action is to create a proof of concept project first. Show people what it can do, convince them of how powerful and important it is to the future of Morrowind modding. When they finally see the light, they will rush to help with the project. I think the success of MWSE-Lua could be a powerful incentive for collaboration between OpenMW-Lua and MWSE-Lua, and that will help move the direction of OpenMW.
User avatar
lysol
Posts: 1513
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: The new MWSE-Lua interface

Post by lysol »

SeaFox wrote: 30 Sep 2018, 17:11 Seems like the best course of action is to create a proof of concept project first. Show people what it can do, convince them of how powerful and important it is to the future of Morrowind modding. When they finally see the light, they will rush to help with the project. I think the success of MWSE-Lua could be a powerful incentive for collaboration between OpenMW-Lua and MWSE-Lua, and that will help move the direction of OpenMW.
This is not the issue. The concensus already is that OpenMW will add Lua scripting.

The difference is that MWSE-Lua is not sandboxed (meaning you can inject code from scripts directly into the game (I'm not a coder, so I can't really elabore on this any more than this), but you also can, theoretically, implement a virus within a mod) and OpenMW lead Zini has said that sandboxing is a must have. Not having sandboxing gives you a new level of freedom in what you features can implement, but Zini's argument is that since OpenMW's source code is free and open, you can implement these same features directly in the engine anyway, and that OpenMW therefore should go for the safer, sandboxed, implementation of Lua.

NullCascade does not agree with this decision, so he will not be the one that implements Lua scripting to OpenMW. Well, unless Zini changes his mind, but he has been very clear about this, so I highly doubt he will.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: The new MWSE-Lua interface

Post by akortunov »

I wonder which exactly parts of MWSE are blocked by sandboxing.
Direct access to filesystem and ability to run external EXE-files are blocked by fact that OpenMW is a cross-platform project, not just by Lua sandboxing.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: The new MWSE-Lua interface

Post by AnyOldName3 »

Both of those can work cross-platform, as long as you actually bother to recompile your mod for all the platforms OpenMW supports (and in a world where sandboxing was something we considered okay, we could offer some kind of fat binary format with binaries for all the architectures and OSes we support contained within the same file).
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: The new MWSE-Lua interface

Post by akortunov »

AnyOldName3 wrote: 30 Sep 2018, 19:08 Both of those can work cross-platform, as long as you actually bother to recompile your mod for all the platforms OpenMW supports (and in a world where sandboxing was something we considered okay, we could offer some kind of fat binary format with binaries for all the architectures and OSes we support contained within the same file).
Does not look good for me. I doubt that most of modders will actually use this feature - they will just make their mods Windows-only.
User avatar
SeaFox
Posts: 34
Joined: 29 Feb 2016, 17:30

Re: The new MWSE-Lua interface

Post by SeaFox »

AnyOldName3 wrote: 30 Sep 2018, 19:08 Both of those can work cross-platform, as long as you actually bother to recompile your mod for all the platforms OpenMW supports (and in a world where sandboxing was something we considered okay, we could offer some kind of fat binary format with binaries for all the architectures and OSes we support contained within the same file).
Perhaps something like the java virtual machine could be used. Compiled code would work an all platforms for which a virtual machine is available. Or some sort of JIT compiler could be used. Code would be distributed as source, and would automaticly be compiled when first used, regardless of which platform is used.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: The new MWSE-Lua interface

Post by AnyOldName3 »

That's basically how Lua and MWScript and any proposed system works, but the point of calling native code is that you can call native code in addition to the stuff written in a portable language.
Post Reply