| 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 |
True/False ConditionsThe NWN2 editor allows ffor variable settings to either TRUE or FALSE. This is helpful when you need to check for only two conditions. This section gives an example of how that is done.
Creating Variables for True or False Conditions The NWN2 data type int allows for two special conditions. These are TRUE and FALSE (they must be all uppercsae to work). The following program illustrates:
The above program compiles without errors. Note that both declared variables, Condition1 and Condition2 are of data type int. However, in the NWN2 scripting editor they can be set to either a TRUE or a FALSE condition. These conditions can now be checked in logical operations for their conditions. This is illustrated in the next example.
|
|