From NWN Lexicon
Jump to: navigation, search

Comments let you add explanation to your code that make it easier for you and others to go back and make sense out of the logic (or lack thereof).

There are a few ways to add comments to NWScript:

// single line comment
/* single line comment */
    muli-line comments

Comments aren't compiled, so they won't add any size to the final script. They should not be viewed as a waste of time; on the contrary, they save time by making it much easier to go back and scan code for meaning, even while writing the first pass of logic.

Often comments are used for formal documentation of script and function headers.


From the official script library:

//:: Acid Fog: On Enter
//:: NW_S0_AcidFogA.nss
//:: Copyright (c) 2001 Bioware Corp.
    All creatures within the AoE take 2d6 acid damage
    per round and upon entering if they fail a Fort Save
    their movement is halved.
//:: Created By: Preston Watamaniuk
//:: Created On: May 17, 2001

 author: Ryan Hunt, editor: Charles Feduke