| NWN2 Scripting. |
Simulation Training. Introduction Home First Program Seeing Results Variables and Data Types Comments Functions Data Conversion Random Numbers Concatenation Arithmetic Operators Compound Assignments One More or Less Precedence Relational Operators The Open Branch The Closed Branch Logical AND Logical OR Compound Statements ELSE If Switch Case The ? Operator The for Loop The while Loop The do while Loop Introduction to Functions Passing Values Passing Multiple Values Multiple Functions Simplifying Functions TRUE/fALSE Conditions Return Values Setting Global Variables Getting Global Variables Setting Local Variables Getting Local Variables WayPoints Introduction Static Waypoint Sets Dynamic Waypoint Sets Dynamic WP Cycles Input Output |
CommentsComments are used for the purpose of helping explain all or parts of the program to the programmer. Comments do not have any affect on the program itself. When the program is compiled, comments are ignored and preform no action during program execution. In the NWN2 editor, you will find many sources of already completed code. You will also find that they contain comments to help you understand what the code is suppose to do. You too should use comments in the code that you write. Doing so will help you remember what you intended different parts of your program to do. Coding a CommentThe program below illustrates two different ways of putting comments into a program.
The above program compiles without errors. Here are some facts about comments:
Where do we go from here?Now that we know how to do comments and declare variable as well as assigning them values, we are ready to try some really exciting code.
|
|