Conditional area transitions

Description
I had an area in a module where I needed to do something similar to the end of the Charwood quest, but I wanted a clean and simple script to do it. I found using an Area Transition trigger easier than using a door transition for this, although the programmer in me wants to work on that.

On Click script of the Area Transition
// // Script: cond_area_trans1.nss // Author: Trinity // Date: 20 November 2002 // // This script goes into the On Click script for the // area transition trigger. Some people click on // AT triggers. // void main { // Assign the variables object oPC = GetClickingObject; object oWP = GetWaypointByTag("WP_AT_NEWAREA"); object oWP1 = GetWaypointByTag("WP_AT_OLDAREA"); int iVar1 = GetLocalInt(GetModule, "iVar"); // Now we test to make sure at iVar1 is what you need to // go into the new area. If it isn't, you go to the old. if (iVar1 != number) {   AssignCommand(oPC, JumpToObject(oWP1)); } else {   AssignCommand(oPC, JumpToObject(oWP)); } }

The On Enter script slot of the area transition
// // Script: cond_area_trans2.nss // Author: Trinity // Date: 20 November 2002 // // This script goes into the On Enter script for the // area transition trigger. Some people just enter // AT triggers. // void main { // Assign the variables. object oPC = GetEnteringObject; object oWP = GetWaypointByTag("WP_AT_NEWAREA"); object oWP1 = GetWaypointByTag("WP_AT_OLDAREA"); int iVar1 = GetLocalInt(GetModule, "iVar"); // Now we test to make sure at iVar1 is what you need to // go into the new area. If it isn't, you go to the old. if (iVar1 != number) {   AssignCommand(oPC, JumpToObject(oWP1)); } else {   AssignCommand(oPC, JumpToObject(oWP)); } }

Trinity