View Full Version : Script for Transitions?

07-14-2007, 02:31 AM
could someone enlighten me as to what the script for transitioning between moduals is? (how to make transitions)
please? :sithk:

07-14-2007, 08:46 AM
please? :sithk:

If you are using standard transition triggers (like the game usually does when you wander around and move between areas) there is no script needed. You just set the name of the destination module in the LinkedToModule field and the LinkedTo field to the tag of the destination waypoint within that module. These fields are set on the trigger instance in the GIT file. You don't need to make a new trigger template for this, you can re-use the standard newtransition template in most cases.

I haven't used KotorTool's module editor so I don't know how/if you can set it up there, but if you modify the GIT file with a GFF editor you:
add a new trigger instance to the TriggerList field

set its XPosition, YPosition, ZPosition fields to the base coordinates within the area of the trigger

set the TemplateResRef field to the name of a transition trigger template (UTT file). This template should have its Type field set to 1 and Cursor field set to 1. You can usually just use the standard newtransition.utt template that the game comes with unless you have reason to make your own.

set the LinkedToFlags field to 2.

set the LinkedToModule field to the name of the module (file) to transition to (e.g. 102PER).

set the LinkedTo field to the Tag of the object (usually a waypoint) in the destination module to arrive at

Add at least three Geometry points under the Geometry list field that make up a trigger area polygon which fires the transition when the player steps inside it. The PointX, PointY, PointZ fields for each geometry points are offsets from the base trigger coordinates, they are not coordinates within the area. I.e. if you set up three geometry points with coordinates (0.0, 1.0, 0.0), (-1.0, 0.0, 0.0), (1.0, 0.0, 0.0) you get a triangle where the first corner is one meter to the north of the trigger base, the second corner is one meter to the west of the trigger base and the final corner is one meter to the east of the trigger base.

Set the TransitionDestin field to the text name of the module the trigger leads to. This will be shown to the player when they approach the transition so they know where it leads (e.g. "Peragus Mining Tunnels").

You can also set up an area transition on a door, making it trigger when the player activates the door. Doors also have the LinkedTo, LinkedToModule and TransitionDestin fields in their entries in the DoorList field in the area's GIT file, which work the same way as for a transition trigger, though the LinkedToFlags is usually set to 1 for door transitions instead.

(Remember that the area GIT files must be packed inside the module files they belong to. If put in the override folder they will cause problems.)

If you want to make a non-standard (i.e. not door or passage based) transition you can use a script like:

void main() {
StartNewModule("module", "waypointtag");

...where you set "module" to the name of the module to load (e.g. 102PER) and "waypointtag" to the Tag of a waypoint placed within the destination module where the player should appear. You can leave out the second parameter if you just want the player to appear at the pre-set module start location.

07-14-2007, 06:42 PM
thanks a ton!