[post-1.0] Scripting enhancemnts

Everything about development and the OpenMW source code.
User avatar
raevol
Posts: 3066
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: [post-1.0] Scripting enhancemnts

Post by raevol » 25 Dec 2013, 23:29

Lua is really amazing, but has anyone considered Python? If we are even considering this?

User avatar
heilkitty
Posts: 139
Joined: 11 Aug 2011, 07:57
Location: Vivec City, MW
Contact:

Re: [post-1.0] Scripting enhancemnts

Post by heilkitty » 26 Dec 2013, 04:43

There's still no Restricted Python for 3.x, AFAIK.
In Soviet MoЯЯowind, Almalexia kills YOU!!

User avatar
Br0ken
Posts: 241
Joined: 02 Apr 2012, 05:54
Location: Siberia

Re: [post-1.0] Scripting enhancemnts

Post by Br0ken » 26 Dec 2013, 09:16

raevol wrote:Lua is really amazing, but has anyone considered Python? If we are even considering this?
Python is a really powerful language, but it's more suitable for stand-alone work. For embedded scripting, Lua will be better choice: more faster to execute (especially LuaJIT), smaller in codesize, easier to integrate and consumes less memory.

wheybags
Posts: 207
Joined: 21 Dec 2012, 19:41

Re: [post-1.0] Scripting enhancemnts

Post by wheybags » 26 Dec 2013, 13:23

Still really think we should have a seperate scripting language on top of mw script...

User avatar
potatoesmaster
Posts: 112
Joined: 26 Dec 2012, 17:01

Re: [post-1.0] Scripting enhancemnts

Post by potatoesmaster » 26 Dec 2013, 14:12

OpenCS will need script extensions too. I think Python is better suited for that: it's popular, has a lot of resources (tutorials, a good documentation, a bunch of libraries) and enforces readability.
If OpenMW ever have a new scripting language, be it the same as OpenCS.

If it happens, an exact translation (from Morrowind script to Python or lua) would be ugly. One thing I dislike in vanilla scripts is polling. Having event handler functions would be better IMHO.

It's a lot of work, since we have to remain compatible with vanilla scripts. And there will be no benefit until new content are created for OpenMW. :?

Tarius
Posts: 574
Joined: 24 Oct 2011, 19:29

Re: [post-1.0] Scripting enhancemnts

Post by Tarius » 26 Dec 2013, 18:33

Looks like people are leaning to python.
While I dont code or script, I would choose python as well based on the fact that its the major code used for scripts in Blender. This would mean even more people would be familiar with it.
I am a bigger fan of tons of control rather than taking the "user-friendly" approach.
-Okulo

HiPhish
Posts: 323
Joined: 02 Jul 2012, 08:36

Re: [post-1.0] Scripting enhancemnts

Post by HiPhish » 26 Dec 2013, 19:13

I'm skimming these topics, but I don't understand much of it, so I would be grateful if someone could explain to me what all this means. I am familiar with compiled languages: you write something in a language that looks like English, except more rigid, then you run it through a compiler that translates it to machine code and you get a computer program.

How does a scripting language work? From what i understand it needs to be "interpreted" by a program (i.e. OpenMW in our case). Lua and Python existed long before OpenMW, so how do the languages know how Morrowind works? I assume someone has to write some sort of "bridge" between script and game, but if that's the case, what does the scripting language contribute? What would be the advantage in adapting an existing language that people have to learn again over writing a custom language?

User avatar
heilkitty
Posts: 139
Joined: 11 Aug 2011, 07:57
Location: Vivec City, MW
Contact:

Re: [post-1.0] Scripting enhancemnts

Post by heilkitty » 26 Dec 2013, 19:42

HiPhish wrote:What would be the advantage in adapting an existing language that people have to learn again over writing a custom language?
Cleaner and much more powerful syntax (I doubt this event handling/callbacks thing potatoesmaster mentioned is possible with Morrowind scripting syntax), nice things from the standard library (e.g. math, working with arrays).
In Soviet MoЯЯowind, Almalexia kills YOU!!

User avatar
Br0ken
Posts: 241
Joined: 02 Apr 2012, 05:54
Location: Siberia

Re: [post-1.0] Scripting enhancemnts

Post by Br0ken » 27 Dec 2013, 04:36

Tarius wrote:Looks like people are leaning to python.
While I dont code or script, I would choose python as well based on the fact that its the major code used for scripts in Blender. This would mean even more people would be familiar with it.
Yes, Python uses Blender and several games. But Lua became a de facto standard in game development, it was used in the many commercial games and it's a best-known scripting language in modding community. Even Civ series switched from Python to Lua in Civ V.
Besides, Lua used in powerful game editors such as CryEngine SDK (Crysis series) and X-ray SDK (S.T.A.L.K.E.R. series). And, of course, in Garry's Mod. :)

User avatar
Okulo
Posts: 672
Joined: 05 Feb 2012, 16:11

Re: [post-1.0] Scripting enhancemnts

Post by Okulo » 27 Dec 2013, 10:25

Zini wrote:Would not be easy to implement (we would have to do a good part of the work twice, since I am absolutely not going to drop the original language) and it would lead OpenMW into a direction that I am not willing to go.
As a compromise, why not a Lua/Python-esque implementation of the Morrowind scripting language? Wasn't MWs scripting language very unwieldy in places ("set var to 10" rather that "var = 10")? Still, I personally prefer curly brackets over phrases such as "endif", makes it easier to recognize a block, but Lua and Python don't have that either, it seems...

Post Reply