How to get help for functions in the Script Editor
-
#1 - Click on the functions tab and then type in part of the function name in the Filter text entry field.
This will bring up a list of the function names that contain your filter.
If you could describe a function well enough to ask a question on the scripting board then you probably could have found it here by typing different things into the filter field and saved yourself a lot of time!
-
#2 - If you want to find out more about a function in the function list, then click on its name. Information will display in the little help window that will:
- describe the function return value
- describe what the function does
- tell you what parameters the function takes
- describe the parameters
If this information is NOT descriptive enough (more often than not), then run to the Lexicon and look up the function name to get a more detailed description.
Downloading a copy of the Lexicon is even better. If you have *any* desire to learn how to script the lexicon is your best friend and should be the first thing you turn to.
-
#3 - If you click twice on the function name, it will automatically be placed at the position of your cursor in the script editting window. Cool, eh?

How to look up constants in the Script Editor
-
Almost every built-in function will require a function of some type as a parameter. (ie: the argument nClassPosition to GetClassByPosition takes an argument of CLASS_TYPE_* according to the help window).
-
#1 - Click on the functions tab and then type in party of the constant name in the Filter text entry field.
This will bring up a list of the Bioware built-in constant names that contain your filter.
-
#2 - Unfortunately clicking once on the constant name only tells you the data type for the constants... which is almost always and int.
-
#3 - But if you click twice on the constant name, it will automatically be placed at the position of your cursor in the script editting window.

How to look up nwscript.nss to get exact values for constants
-
nwscript.nss is the magic file that contains a list of all the constants and all of the built-in script names. You should *NEVER* modify this script as modifying it could potentially break future versions of NWN. But it is quite handy if you want to look up exactly what values a constant has.
-
#1 - Click the open icon to open the Select Resource (open script) dialog.
-
#2 - Click on the All Resource option button. This will let you open scripts that are part of the game.
The default setting of Module Resources Only will only search scripts that exist inside your module.
-
#3 - Type in part of the name of the script you are looking for into the Resource Name text entry field.
-
#4 - Click on the file to select it and open it in the script editor.

How to open up a Bioware script (ie: a spell script)
-
Sometimes you want to open up a built-in Bioware script to modify it. A perfect example is a spell script, because lets say you want to change how a spell works. All of the built-in spells are named nw_s0_* in original NWN.
-
#1 - Click the open icon to open the Select Resource (open script) dialog.
-
#2 - Click on the All Resource option button. This will let you open scripts that are part of the game.
The default setting of Module Resources Only will only search scripts that exist inside your module.
-
#3 - Type in part of the name of the script you are looking for into the Resource Name text entry field.
-
#4 - Click on the file to select it and open it in the script editor.
