Re: SWIG Scripting Extensions project
Posted: 15 Feb 2015, 12:58
Is Lua faster? It's supposed to be but is it? If modder has to split script to 5 to make it perform well or rewrite it to Lua it might be worth to support new language.
Using lua as the scripting language and interpreter was considered at the very beginingmike29 wrote:Is Lua faster? It's supposed to be but is it? If modder has to split script to 5 to make it perform well or rewrite it to Lua it might be worth to support new language.
Zini wrote:The primary reason for having a custom format is, that we can exploit our the knowledge about the specific structure of Morrowind scripts and the underlying world model to gain a higher efficiency.
The secondary reason is, that translating to Lua sounds like more work than a custom interpreter (for which I might have reusable bits and pieces of code lying around from another project too).
The original Morrowind scripting language has so much bizarreness, that a straight forward translation would be pretty much impossible. Also, I am not really sure if a move to Lua as primary scripting language is a good idea. Yes, the Morrowind scripting language has its odd sides, but it is what everybody is using when it comes to Morrowind scripting and it actually isn't that much worse than other scripting languages (from an end-user's point of view), if you ignore how buggy it is. I would rather extend it, than offering a different language.
And the tertiary reason finally is, that I don't know much about Lua and I am only weakly motivated to change that. While I am aware that Lua is rather popular, so far I have failed to see the attractiveness of this language.
The biggest isue is maintenance, I think. We have to have mwscript, because the original game and mods all use it. Another scripting language would be more code that has to be kept working. It becomes a bigger issue if you want to add new scripting features, and allow mwscript to grow some as well.melrief wrote:For people who don't want to add the support to another language because "everybody use MWScript": you don't need to discard MWScript, you could just add the support for Python or Lua or other proper languages. Mods and modders that want to use MWScript regardless could use it without problems. The rest of us could use a more mature and advanced language. Everybody wins, what's the problem?
Code: Select all
Begin travelingtrigger
float timer
short ander
short x
short once
if once==0
set x to 4
eldafire->aitravel -11380 -68559 236
set once to 1
endif
set timer to timer+getsecondspassed
if ander==0
eldafire->aitravel -11380 -68559 236
player->rotate z 20
if timer>x
if eldafire->getaipackagedone==1
player->modspeed 50
fargoth->disable
set timer to 0
set ander to 1
endif
endif
endif
if ander==1
eldafire->aitravel -11390 -69994 241
player->rotate z -20
if timer>x
if eldafire->getaipackagedone==1
player->modspeed -50
fargoth->enable
set timer to 0
set ander to 0
endif
endif
endif
End travelingtrigger
Nobody has a clue on how MWScript really works. It's about opinions, not facts! There is no clear specification and yes, that's bad. For the record, "I myself have successfully used at least four operators and variables in a single line" is not the sign of a good programming language .A warning: There are different opinions on the forums on the use of several operators in one
line. Some people report a lot of problems with this, I myself have successfully used at least
four operators and variables in a single line. There appears to be an issue with very long
additions (e.g. adding up more than 20 variables in one line of code) that causes a mod to
crash the game upon loading. If this happens, split the calculations to several lines.
that should be no problem even with 100 xPset ln to ( ln + ( k10 * math_ln10 ) + ( k2 * math_ln2 ) )