Which scripting language does Skyrim use? [closed]
The previous Bethesda titles from the Elder Scrolls series - Morrowind and Oblivion - as well as the games based off Oblivion's engine, Fallout 3 and Fallout: New Vegas, used a custom scripting language internally, usually called "TESScript". A common complaint was that it was very limited, doing basically just enough for the specific game to work, and nothing more (Oblivion's version didn't even have looping statements, for example). This necessitated the development of so-called "script extenders" (MWSE, OBSE, FOSE and NVSE, respectively) to bring this language up to speed.
Did Bethesda take the criticism seriously and implement a different, complete scripting language into Skyrim - and if so, which one?
Solution 1:
The specific details about the scripting language haven't been announced, but they are not using the same scripting language as Oblivion, and have built a completely new language for Skyrim (More on scripting in Skyrim). Supposedly the language is more extensive than the previous one and may be feature complete enough to not require extenders, but that remains to be seen once it has been officially released.
The results from the Skyrim Script Extender project indicate that the old scripting language is still there (see: full command list, including references to VATS and the Pipboy), but also that there's a second, VM-based scripting language called "Papyrus" included. To quote ianpatt from the Skyrim mod forums:
Time to start turning this in to the "Skyrim Internal Technical Research Discussion" thread. This time around, it looks like we have two totally different scripting engines in the game. One is the classic system used in the previous games, it looks almost exactly the same from a very quick lookthrough. Command dump coming shortlyish.
The new one is much more interesting and appears to be called Papyrus or SkyrimVM. We'll probably need to wait for the editor to be released to get any idea about the syntax as the original source code for scripts doesn't appear to be in the .esm (unless they're compressed). However, here's a quick feature rundown from what I can tell. Please take things with a grain of salt for now, this is just a first look.
- core variable types are float, int, string, and bool
- arrays of the above are supported natively
- scripts are interpreted as a list of simpler yet much more powerful set of opcodes
- if the conditional branch opcodes support negative offsets then loops are trivial to implement (and probably have been)
- the new system is object-oriented - all scripts are class instances (UnrealScript influence here)
- compiled scripts are stored as separate files, unpack Misc.bsa and look in the scripts folder
- classes support inheritance, and there appear to be vm-world classes matching the internal form types