void main() { //Get the PC that just clicked on the transition object oClicker = GetEnteringObject(); //Get the location of the PC location lLeave = GetLocation( oClicker ); //Get the PC's postion vector vLeave = GetPositionFromLocation( lLeave ); //The Trigger that's in the destination area object oTran = GetObjectByTag( "jw_leaveac_trig_WP" ); //Get the destination area object oDestArea = GetArea( oTran ); // get the vector of the entering waypoint. location lWPleave = GetLocation( GetObjectByTag("jw_tr2ac_trig_WP") ); vector vWPleave = GetPositionFromLocation( lWPleave ); ///get the PC's vector when compared to the leaving WP. vector vDifference = vWPleave-vLeave; // get the location of the waypoint to go to location lWPenter = GetLocation( GetObjectByTag("jw_leaveac_trig_WP") ); /// get the vector of the spawnpoint to go to: vector vWPenter = GetPositionFromLocation( lWPenter ); /// add in the difference vector vFinal= vWPenter-vDifference; //Get the PC's facing float fFacing = GetFacingFromLocation( lLeave ); //Create a new Location to place the PC in location locNew = Location( oDestArea, vFinal, fFacing ); //Clear all PC actions, (Stop walking) and then jump //to the new location. AssignCommand( oClicker, ClearAllActions() ); AssignCommand( oClicker, JumpToLocation( locNew ) ); }