Page 1 of 1

What language is the scripting language for Morrowind

PostPosted: Sat Apr 10, 2010 6:54 pm
by Michael_Lightbringer
When delving into scripting, what language is closest to the one used for Morrowind?  C++?

Re: What language is the scripting language for Morrowind

PostPosted: Sat Apr 10, 2010 7:31 pm
by Jac
It resembles C++, but I wouldn't try to compare it to any language because while it may help, it won't very much. If you're looking to learn a programming language, the best thing to do is to look at examples of code.

Re: What language is the scripting language for Morrowind

PostPosted: Sat Apr 10, 2010 8:24 pm
by peachykeen
I'm not sure if I'd say it resembles C++ (or any C variant).

It has the usual elements of a logical language (if, ==, all those good ones), but the syntax is extremely simplified and parentheses are usually unneeded. I don't know any other languages that don't use parentheses off the top of my head, but if there is one (and it's probably some terrible language like BASIC or Pascal), that's what MWScript is closest too.

It has assembly's ease of use. BASIC's power. C's logic. And a random function syntax.

All that said, if you know C (or most other functional languages with a hint of object-orientation), you'll be able to pick up MWScript fairly easily. There are a lot of minor tips and tricks, but the basics are there. Morrowind Scripting For Dummies is a good place to check, too.

Re: What language is the scripting language for Morrowind

PostPosted: Sat Apr 10, 2010 8:46 pm
by Michael_Lightbringer
I was learning from Morrowind Scripting for Dummies a couple years ago when I was last big into Morrowind.  I don't actually know C++.  I was just wondering, really if Morrowind scripting might be a fun and recreationally fulfilling way to make coding more accessible.

Re: What language is the scripting language for Morrowind

PostPosted: Sat Apr 10, 2010 8:58 pm
by peachykeen
You can learn some of the general theories from it, but overall, it's not a very helpful language. Once you understand how if works and what variables are and all that, I'd go play with another language. If you want quick learning and rewards, try DarkBASIC (although learning BASIC is generally considered a Very Bad Thing, and can lead to permanent brain damage). If you want a good idea of how things work, I like C++ and didn't find it too bad to learn, although C# is certainly easier (with XNA (free), you can start making 3d apps pretty quick).

Re: What language is the scripting language for Morrowind

PostPosted: Sat Apr 10, 2010 9:16 pm
by Michael_Lightbringer
Thanks for the simple answer.  Part of it is I'm trying to sugar coat all the hard work that would go into learning to code.  I was thinking that learning with Morrowind and maybe go back to my MUD roots might give me a chance to learn coding basics that would be disguised as having a  good time making something for games I love rather than poring over dull texts and sites on traditional code.  If I am reading you right then I can learn to think like a coder from Morrowind scripting?

Re: What language is the scripting language for Morrowind

PostPosted: Tue Apr 13, 2010 4:16 am
by symon
Many games have included a language interface to allow scripting since at least Quake. The choice has often been made to use an existing language to leverage the many advantages this gives. For example Freedom Force chose Python and a callback model for it's scripting.

The advantages are that the scripting can be easily extended and a script doesn't run every frame, only when an on-screen event requires it be triggered.

Beth chose to write their own custom scripting language, which is consequently difficult to extend, inflexible and bears little resemblance to anything other than that it has the basic capabilities of any language. It certainly doesn't have the low level abilities of C. If it was C like, it would cope with pointers et al.
If you want to learn to program, pick a simple language, say php and try with that.

Then come back to Morrowind.

Re: What language is the scripting language for Morrowind

PostPosted: Tue Apr 13, 2010 5:27 am
by Earth Wyrm
I agree with Symon, MW scripting is too dissimilar to other languages for it really to be useful for anything other than picking up the very, very most fundamental programming concepts. Not to mention that it has so many bizarre quirks that you'll probably end up spending more time wrestling with its own particular twisted vision of reality than actual programming concepts.
I'd second PeachyKeen's C# and XNA suggestion if you want to pick up coding skills and get some immediate motivatory feedback.

The only reason I can think of to work with MW's scripting language is to script for Morrowind - and even that's only with the caveat that you ought to spend at least half of your time swearing at it as a matter of course.

Re: What language is the scripting language for Morrowind

PostPosted: Tue Apr 13, 2010 2:28 pm
by Fliggerty
I think that scripting was a hindrance to my learning other languages such as C++.  Although I will say that the one advantage it did provide is a great way to visual how object oriented programming works.  An NPC is a class and its skills and attributes are member variables.  It's that simple.

Learn PHP or Python.   You may be amazed at how simple they can be to pick up.

Re: What language is the scripting language for Morrowind

PostPosted: Tue Apr 13, 2010 4:52 pm
by Jac
I'm with Earth Wyrm on this. If you're going to try your hand at MW scripting, then by all means, learn it. If not, stay as far away as possible and look at a real programing language instead.

Re: What language is the scripting language for Morrowind

PostPosted: Wed Apr 14, 2010 12:33 pm
by peachykeen
Fliggerty wrote:I think that scripting was a hindrance to my learning other languages such as C++.  Although I will say that the one advantage it did provide is a great way to visual how object oriented programming works.  An NPC is a class and its skills and attributes are member variables.  It's that simple.

This is true. You'll pick it up about the same from any OO language (any C variant and most interpreted languages). It's not a terribly hard concept, no matter where you learn.

Learn PHP or Python.   You may be amazed at how simple they can be to pick up.

I would disagree with this, especially PHP. Python is alright for a starting language, but it's not a very good one IMO (I don't like it, period, but it is relatively complete and simple). PHP is definitely not a good language to start with (almost as bad as BASIC), it won't teach you much of the important concepts (types, variable declaration, etc) and does some things a bit odd.
If you're going to go into serious programming (or may need to actual write something to use one day), I would start with a compiled language (as opposed to an interpreted language, and yes, I know PHP and Python can be compiled, but they're still just scripts). There are very often some major differences between how you handle compiled programs vs parsers, especially when it comes to debugging. C# sits in the middle, with the much of the ease of an interpreted language and some of the power (and speed) of a compiled program. From C#, you have a good foothold to move up (in power and complexity) to C++ or down (in difficulty and speed) to one of the 3 P languages (Perl, Python, and PHP, all often used for scripting and web-related nonsense).

Re: What language is the scripting language for Morrowind

PostPosted: Fri Apr 16, 2010 8:48 am
by Fliggerty
I'll bite and argue that.  We can both say what we think is best, but everybody learns differently.  I learn incrementally.  Back in the day I started with BASIC which taught me program flow.  Then I picked up HTML and CSS which taught me how to translate code into a visual medium.  Now I saw learn PHP to learn how the other basic code elements work.  By those I refer to functions and classes.  It's nice learning how to handle those without the need to deal with compiling and memory addresses and pointers and all of that other nonsense.
Why reinvent the wheel?  If you have a foundation that handles the parsing, error reporting, memory management, and garbage cleanup so you can focus on the function of your project, why do you need anything more?  I think that in and of itself lends the potential to such languages to actually be more powerful...especially since there is the option to handle those things if you choose.

Re: What language is the scripting language for Morrowind

PostPosted: Fri Apr 16, 2010 11:54 am
by Elaura
Though languages are not my thing, learning is and Fligg opened the floor to that.  My suggestion would be to take a goal-oriented approach and rephrase your question.  What do you want to be able to do with this knowledge/skill?  Do you want to be a game developer, work for a software company, develop your own software to market?  Maybe you just want to say you did it?

In the business world, you want to look at what is in demand right now and where the trends are going.  If one language seems to be pulling ahead in the field you are interested in, learn that one.  As Fligg said, "why reinvent the wheel?"  If languages are a hobby, sure, learn the ones you care to and start with BASIC if it appeals to you.  If languages are a means to an end, tell us what that end is and we can give you better advice on how to achieve that goal.

Re: What language is the scripting language for Morrowind

PostPosted: Fri Apr 16, 2010 12:08 pm
by peachykeen
Well, any language is good for program flow, unless you pick some really out-there one that is totally unique or exceptionally verbose or compact (COBOL or Brainfuck). Even BASIC has the usual stuff, ifs thens and whatnot. I followed basically the same sequence as you, Fligg, so that does more or less work... just not sure if it's the best. The part where people tend to disagree, I think, is when you start teaching the complex stuff.

I think users should have to handle garbage on their own, and when they can do that, then they can use garbage collection systems. Being able to handle it manually keeps you from getting into the mindset of throwing memory around, which will cause a lot of trouble later. Of course, it's a pain for most new users, so something that does it for them is good. You definitely need to understand how memory works and why you should conserve it, and learn it early, before you get any bad habits.

As for PHP teaching OO, you're right, technically. I don't like PHP a whole lot (not a fan of the Ps, I guess), but it does have a lot of the stuff you need. It's close enough to a C language that you can jump to there without too much trouble, so I guess it would work as a starting point. Being web-targeted though changes some stuff around, it's harder to do the kind of stuff you'll need for a normal program (basic console IO and GUIs, especially).

Maybe starting with PHP/C# (simple enough to learn the concepts and complex enough to start using OO), then C++ when you have some experience and learn garbage collection and pointers/low-level functionality there. I definitely wouldn't go for Perl or BASIC until you have good coding habits down, that'll just mess you up later. The top of the stack, last one to learn would be assembly. Ultimate power in 3 letters.

Edit: Weird, I can't type C (plus) (plus). At least, not in the quick edit box.