Djinni Wiki
Advertisement

That’s it, at least as far as scripting goes. The scripting language used in “The Witcher” is exactly the same as the one used in “Neverwinter Nights”. However, the two languages may differ when it comes to function names, the way in which functions are called up, etc. If you want to take D’jinni scripting seriously, then you should take an interest in practicing in the “Neverwinter Nights” editor. Most functions are practically the same.

Also, take a look at guides and manuals about the NWN editor online. The NWN Lexicon is recommended and can be found at http://www.nwnlexicon.com/. Practically all the functions used in NWN are listed and described there.

Note that all the contents of the NWN Lexicon is licensed under the GNU FDL license, just like D'jinni Wiki, so you are welcome to copy it here, as long as you include a link to the original NWN Lexicon article.


This chapter deals with scripts. More precisely, it’s an introduction to scripting. Ideally, this chapter is intended for those who are more fluent with scripting languages (Java, C++, C#) or those who’ve handled Neverwinter Nights scripts before. I’ve also mentioned that this is only an introduction to the topic, since a more detailed account of scripting could take up an additional 200 pages of this manual, which is not really its intention. I will simply cover a couple of script examples.

“The Witcher” uses two scripting languages – LUA and Neverwinter Nights type scripts. In this chapter, we’ll take a look at the latter. It’s the same scripting language used in Neverwinter Nights. Naturally, these scripts can be written in the D’jinni editor. The editor has a built in script editor, which possesses three main functions – the syntax coloring, row numbering, and script syntax hints. The script editor can be launched in one of two ways. The first way is to choose New->Neverwinter Script (.nss) from the File menu:

Introduction scripting1

A new neverwinternights scripts window will appear:

Introduction scripting2

This is the script editor. The second way to launch it will be described later in the chapter. Each script has to be compiled, or “translated”, into a code understandable by the computer. Script compilation can be done in one of two ways. One way is to save the file, which automatically compiles the script. The second way is to choose the Compile command from the Tools menu:

Introduction scripting3

Please remember that the Compile command in the Tools menu is only available when the script editor window is active. Also, remember that upon choosing the Compile command from the Tools menu, the script will saved and then compiled.

All items (12)

Advertisement