[Debate] How Should Elemental Handle Mod Scripting

Since so many people have had things to say about which scripting language to use I thought maybe there should be a thread where the modders-to-be sort things out.

The suggestions I've seen so far are:

Angelscript
Lua
Python

I've not worked with any of them but I've seen the results of some games modded with Python - Specifically Mount and Blade.

My thought on this, and you can disagree or talk about the pros and cons of languages here all you want:

Stardock plans on making a mod layer between Kumquat and any games created with the engine.

So this mod layer will be what interperets and handles the scripting. It's obviously either in testing or not in full development by this point or I'm sure there'd have been more information on it.

If the mod layer can interperet one script, why not all three? Create a file type for Kumquat - Whether it be *.kms for Kumquat Modding Script or whatever. Make it simply have three start and end tags and nothing else. One to start and end each scripting language section.

The modding layer could then, in turn, have a special handler for any variables created by any of the three languages to prevent people from having to learn how to pass variables back and forth.


  • Python creates a variable "CookieMonster" with value "OmNomNom"
  • Kumquat's modding layer sees the variable creation and stores variable "CookieMonster" with value "OmNomNom" for Angelscript and Lua.
  • Lua calls for a variable by the name of "CookieMonster", and Kumquat's already rendered value is put into the script as "OmNomNom" for which Lua's scripting calls to re-value "Cookie".
  • Kumquat's modding layer sees the re-value and restores variable "CookieMonster" with value "Cookie" for AngelScript and Python.
  • AngelScript calls for variable "CookieMonster" and clears it.
  • Kumquat's modding layer sees the removal of "CookieMonster" and removes it from Python and Lua.

  • I'm sure it'd be much more complicated than this, but this sort of approach would allow for a lot more in the way of modding, and it would mean that modders familiar with each script wouldn't have to relearn an entire new version.

    Anyone else have thoughts on what Stardock should do?

    6,307 views 3 replies
    Reply #1 Top

    I don't think the mod layer will have anything to do with Elemental, other than possibly share language. The mod layer sounds like it will be a dev kit to make your own games, pretty much.

    Personally I'd prefer LUA, because I have worked with it before.

    Reply #2 Top

    # Python creates a variable "CookieMonster" with value "OmNomNom"
    # Kumquat's modding layer sees the variable creation and stores variable "CookieMonster" with value "OmNomNom" for Angelscript and Lua.
    # Lua calls for a variable by the name of "CookieMonster", and Kumquat's already rendered value is put into the script as "OmNomNom" for which Lua's scripting calls to re-value "Cookie".
    # Kumquat's modding layer sees the re-value and restores variable "CookieMonster" with value "Cookie" for AngelScript and Python.
    # AngelScript calls for variable "CookieMonster" and clears it.
    # Kumquat's modding layer sees the removal of "CookieMonster" and removes it from Python and Lua.

    Generally you cannot share values this simply. In python, for example, all 'values' are objects, and you will have to have C++ import/export protocol for each class, including those created by users in their scripts, which is not as trivial as it sounds (dynamic class/object mutations, closures, __getattribute__, __metaclass__ etc)

    Usually engine provides some API to the script, which accepts either simple types or predefined objects, and otherwise leaves script to itself, not trying to touch its internal objects.

     

    Also, I dont think there is a point in having Lua if you have Python. Its only advantage over python is its lightweigthness, but in your scenario python will have to be compiled in engine and loaded anyway, so it does not matter.

     

    Also, whatever they do with other languages they should not put python code in non-standard containers with 'tags'. Even simple python code usually takes several modules and importing is tied to filesystem and file extensions.

    Reply #3 Top

    Like I said, I've not used any of them at any point in time. My programming experience is in web apps, database/SQL, and anything to do with the internet.

    Hence my impression of scripting languages being more simplified than it sounds like they are. I actually have a book on Python but I've not cracked it once.

    Glad to get some responses! <3