| 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 |
First ProgramYour first program is the simplest program possible. To check if the program is correct in the NWN2 editor you only need to click on the Compile button or use the key F7. If there are no errors in the program you will see a messag ein the compile results box that the compilation was successful. If the program is nto correct, you will see an error message there.
Your First Program Below is your first program:
The above program compiles without errors. Here are some facts about this program:
Another way of writing the same program. The above program could have also been written as shown below:
The above progarm would sitll compile without errors. The placement of the openign and closing braces { } is simply a programmers choice. We will use the way shoawn in the first progrm above.
What Each Part Means The table below lists the purpose of each part of our most basic program:
What does the Above Program Do? Nothing! It simply serves as an example of the simpliest possible C++ program that will successfully compile.
|
|