Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

Introduction to scripting

From Djinni Wiki

Jump to: navigation, search

[edit] Introduction

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:

Image:Introduction_scripting1.jpg

A new neverwinternights scripts window will appear:

Image:Introduction_scripting2.jpg

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:

Image:Introduction_scripting3.jpg

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.

Rate this article:
Share this article: