Robert Straughan - Capture Glory: Introduction

Introduction


Okay, what I am actually going to try and show you is just how easy using Neverwinter Script can be if you can learn to use the right frame of mind when writing your scripts.


In order to do this, I have built a small module to demonstrate to you how easy it can be to use the scripting language. Before attempting this tutorial, you should play through the module (it'll only take about ten minutes).



[Editor's Note: The complete tutorial and module is available from NWVault at nwvault.ign.com/Files/other/data/1044836522765.shtml.]


The Basic Principle


Remember, no matter how complicated scripting looks, there is a basic principle to keep in mind:


"Scripting is like LEGO."


This may seem a bizarre statement, but it's true. Anybody who doesn't understand what LEGO is for would probably throw the bricks around or try and eat them.


Once you understand how the bricks can snap together, you can sit there and build up a massive pile of junk until your heart's content. While you can learn how to clip together LEGO and build that pile of junk in almost no time, it takes practice to come up with a 14-room mansion.


While it can take very little time to learn how to put together scripting, you must bear in mind that scripting is not like experimenting with the toolset. You can't sit down and write a script without having a rather specific idea of what you wish it to do.


This is why I believe most tutorials go wrong by trying to teach you bits and pieces. Useful information to have at hand, but it doesn't necessarily teach you how to do scripting by yourself. They teach you the language. I'm going to teach you to script. To get end results.



The Module


The module was not intended to be entertaining as such, it was more to include a variety of scripting challenges that I could run through and show you the process of writing them out.



Screenshots


I've placed a number of screenshots of this module in action, as well as some editor shots. I have placed links on the relevant pages from this tutorial so that you can see end results while reading.



The Tasks


At the end of each page, I've set a task based on what I've done on that page. Open up the editor, and see if you can complete the tasks I have set. [Note: a hit to the task appears in seemingly empty box at the bottom of each topic; you can view the hint by highlighting the text within the box - but try and complete the task without using the hint if you can --Ed.]



Update


This tutorial has been updated. The updates have been made in bold type-face, so that those who have previously used this tutorial can see which parts I've added.


This Box


This box will give you some useful information on the basics of scripting throughout the course of this tutorial.


Don't worry if you can't understand what it says straight away, it will help when running through the tutorial.


Basic Scripting


One of the first and most basic concepts of scripting that you should grasp is the types of information script deals with.


int


int stands for integer, which means a whole value. It does not have letters, and cannot have a decimal point. Should a fraction occur, the integer will be rounded down.


object


An object can be anything which is physically represented within the module. Areas, creatures, placeables, waypoints, etc. These are all objects.


float


A float is also a numeric value only, but this can have a decimal point. Note that some scripters do place an f after the number. This does not interfere with the script.


string


A string is a series of numbers or letters encased within a set of quote marks. A string is case sensitive.


location


A location is the x/y coordinates of an object within an area in your module.


effect


Effects are things from visual effects, to applying spell effects or other bonuses/penalties upon an object.


vector


A vector is similar to a location, only it includes the z-axis value as well. A vector is made up of three floats, but is treated as one value in the script.





 author: Robert Straughan, editor: Charles Feduke