| 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 |
Dynamic WP Sets Dynamic Waypoint Sets offer a new dimension of realism for a NWN2 module. A Dynamic Waypoint Set allows different creatures to transverse different sets of waypoints from a given Waypoint Group.
Dynamic Sets A Dynamic Waypoint Set is a series of NWN2 Waypoints connected to each other through Scripting. The Dynamic Waypoint Set may be any series of Waypoints including one or more Waypoints form a pre-defined Static Waypoint Set.
Waypoint Cycles Static Cycles A Static Waypoint Cycle is a pre-defined Set of Waypoints, either Static Waypoints or Dynamic Waypoints where the transversal of the Set is always the same sequence of Waypoints. Dynamic Cycles A Dynamic Waypoint Cycle may or may not consist of any pre-defined Sets of Waypoints either Static or Dynamic where the transversal paths are completly determined through Scripting.
What Waypoints Can do The actions taken by the NWN2 Waypoints can be used as follows:
Dynamic WP Set Example A Module Area is created with a Group of five Waypoints. The Waypoints are assigned the following Tags: Waypoint 1 Tag = WP1 Waypoint 2 Tag = WP2 Waypoint 3 Tag = WP3 Waypoint 4 Tag = WP4 Waypoint 5 Tag = WP5 Once these Waypoints are created and their Tags assigned, the following script is created. The Script is named: wp_set1.
Any Creatures can now be created in the Module and its Properties/Scripts/On Heartbeart Script is assigned the above Script: wp_set1. The selected Creature will now transverse the Waypoint Set as defined in the above program.
Creating a New Set A new Waypoint Set may now be created from the same Waypoint Group of the five Waypoints placed in the Module Area. The following Script, called wp_set2, shows how:
If another Creature is nwo created in teh same Area and its Properties/Scripts/On Heartbreak Script is now assigned the above script wp_set2, then a new Waypoint Set is created for that Creature from the original Waypoint Group of five. This creature will now transverse from WP1 to WP3 to WP5, then repeat the process. Adding Variety Some variety in the Waypoint Set may be added as illustrated by the following Script called wp_set3:
If antoher Creature is assigned the above script (wp_set3) in its Properties/Scripts/On Heartbeat Script, then it will follow the sequence of WP1, wait htree seconds, WP2, wait four seconds, and WP4, waiting for seven seconds, then the process will be repeated. Dynamic WP Sets offer an almost limitless variety of activites for NPCs from any given Waypoint Group.
Where do we go from here In this section all of the Waypoint Cycles were still Static. This is because the NPcs assigned to a Waypoint Set performed the same Waypoint sequence over and over again. The next section illustrates how to create Dynamic Waypoint Cycles where NPCs will take different paths for a given Waypoitn Set.
|
|