lfnetwork.com mark read register faq members calendar

Thread: Setting up Triggers....
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 03-09-2005, 02:32 PM   #1
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
Setting up Triggers....

i want to set up a trigger point to actuvate a custom dialog in a custom module .. now i opened the git file in the gff editor and found the triggers list.. now i know i need to make a utt file and write a script for that file.... the thing i need to know is well a couple of things... in the GFF editor under "TriggerList" there are the basic Xposition Yposition Orientation etc... but theres also a Tree for Geometry do i need to use that? if so whats it for??
also what would be the syntax for the script i need to activate the dialog?

thanks

sketch42 is offline   you may: quote & reply,
Old 03-09-2005, 03:24 PM   #2
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
I made a tutorial about this sometime ago but never posted it. Will do when I get home.


In the meantime, I would tell you to look at my tk102 birthday mod but PCGM is down (they're wroking on the server from what I know). If you already have the mod, check the d3_tukata.utt file in the d3_party.mod file. The triggers spawns two tukatas when the player crosses the trigger area.

You can also check this document: http://nwn.bioware.com/developers/Bi...ger_Format.pdf
It provides useful info, especially concerning the geometry.
Darth333 is offline   you may: quote & reply,
Old 03-09-2005, 05:23 PM   #3
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Re: Setting up Triggers....

Quote:
Originally posted by sketch42
i want to set up a trigger point to actuvate a custom dialog in a custom module .. now i opened the git file in the gff editor and found the triggers list.. now i know i need to make a utt file and write a script for that file.... the thing i need to know is well a couple of things... in the GFF editor under "TriggerList" there are the basic Xposition Yposition Orientation etc... but theres also a Tree for Geometry do i need to use that? if so whats it for??
also what would be the syntax for the script i need to activate the dialog?

thanks
Which module are you using for the setting? Is it a K1 or 2 module?


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-09-2005, 06:25 PM   #4
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
TSL im trying to set up a new area... using 501OND

sketch42 is offline   you may: quote & reply,
Old 03-09-2005, 10:12 PM   #5
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
ok i thinkk i understand the geopmetry but now i have another question ... it seems that the geometry is the area of the trigger ... so when i put the trigger in that area.. it makes that whole area a trigger area now?

i hope that made sense.... also i cant seem to find the syntax in NWScrip.nss that i need....

Basically i have a dialog between 2 NPC's and i want them to start conversing when i hit the trigger... so what would i need for the script for that??

TIA

sketch42 is offline   you may: quote & reply,
Old 03-09-2005, 11:06 PM   #6
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
How to set a trigger


Triggers are used when you want to fire an event when your PC crosses a certain area such as such as spawning npcs, turning npcs hostile, strarting a dialogue, etc...

Triggers are in GFF format and use the .utt extension.

1. Editing the .utt file with Kotor tool:

Info contained in this section is a combination of what appears in the Bioware information document and personal additions.


Basic Tab
  • Basic Tabe
  • TemplateResRef: the entry here has to be the same as the file name. Per example, if your .utt file is called abc.utt then type abc here.
  • Tag: err…the tag of your trigger. It is an identifier.
  • Name: The name of the trigger. Make sure you set the language correctly according to your game version.
  • Faction: The faction of the trigger. the factions that are mostly used for triggers in Kotor are:
    1: is the most commonly used faction (ennemy) type number 1 if you want to trigger dialogue when your PC crosses the trigger area.
    13: is used for traps (mines)
  • Type: type one of the following numbers:
    0 = Generic
    1 = Area Transition
    2 = Trap (mines)
  • Cursor: The number here refers to a cursors.2da. row number. i tis used to specifiy a special mouse cursor icon to use when the player mouses over the Trigger. 0 means there is no mouseover cursor feedback. Game should use the specified cursor only if the
    OnClick event is non-empty. Area Transition triggers should always have the cursor set to 1 by the toolset. For Area Transitions, the game ignores the Cursor value anyway and always uses Cursor 1.
Scripts Tab
For more information, read this thread: http://www.lucasforums.com/showthrea...hreadid=143452
  • OnClick: indicate the name of the script you want to fire when the player clicks on the trigger.
  • OnDisarm: indicate the name of the script you want to fire when the player disarms the trigger the trigger (example: play a sound). Used for traps (mines) only.
  • OnTrapTriggered: indicate the name of the script you want to fire when the player triggers the mine (note: this is not what will make the mine explode: you don’t need to attach any specific script of you want the mines to explode – but you can use this filed to fire another event).
  • ScriptHeartBeat: indicate the name of the script you want to fire On Heartbeat
  • ScriptOnEnter: indicate the name of the script you want to fire when your PC enters the trigger area.
  • ScriptOnExit: indicate the name of the script you want to fire when the PC exits the trigger area
  • ScriptUserDefine: indicate the name of the script you want to fire using a User Define event (examples: on damaged event, on death event) .
Trap Tab
  • TrapDetectable: 1 if Trap can be detected, 0 if not (if it is visible or not)
  • trapDetectDC: if the trap can be detected insert the DC required to make it visible (must within a 1-250 range).
  • trapDisarmable: 1 if Trap can be disarmed, 0 if not… (in kotor 2, all traps I have looked at seem to be set at 1)…
  • DisarmDC: This is used for mines. If the Trigger is a Trap (Type has to be set at 2), put the DC required
    to disarm the trap. DC has to be in the 1-250 range.
  • TrapFlag: 1 if the Trigger is a mine or similar trap, 0 if not
  • trapOneShot: 1 if the Trap disappears after firing, 0 otherwise
  • TrapType: used for mines only; refers to a row number in traps.2da corresponding to the type of mine
  • KeyName: field not used
  • AutoRemoveKey: this field is not used
Comments Tab
  • Comment: put whatever romance you want here or simply skip this field


If you open the .git file with a GFF editor, you’ll notice that there are a few additional fields:
  • HighlightHeight: Some Triggers have a highlight color ingame (Area Transitions are blue, Traps are red, and clickable generic triggers are green). If the trigger highlights, this is the height in metres above the ground that the highlight extends.
  • LoadScreenID: Refers to a row number in loadscreens.2da. It is used to specify a loading screen to use if the trigger is usedto transport the player in another area. If 0 is entered, then the game will load the default loading screen duyring area transition.
  • PaletteID: not too sure what these numbers refer too…perhaps someone else knows…
  • PortraitID: ??? what does this has to do with triggers

1. Editing the .git file:

Triggers are placed in the .git file the same way as placeables, creatures, doors, etc. but under the triggers list.

If you open an existing .git file, you should see something like this under the triggers list:
hhttp://img.photobucket.com/albums/v...3/gff_geom.jpg

o The XYZ Position is the location of the trigger. When your PC crosses this spot, the event will be fired.

o In the TemplateResRef field: put the the .utt filename.

o The geometry XYZ points are how big is the trigger field. It is like an imaginary polygon. I recommend you use 4 coordinates here. If the field is too small, the risks are that if your npc doesn't step exactly on "the spot" you will miss the trigger. If it's too big and it overlaps other triggers, then you will have funny (and less funny) effects. (make sure you read pages 9 and 10 of this document concerning geometry: http://nwn.bioware.com/developers/Bi...ger_Format.pdf * Edit: also downloadable at bottom of this post )


You can get all the coordinates you need with the Whereami armband: http://www.starwarsknights.com/tools.php

If you are making a mod for Kotor 1, then maybe you can use Kotor Tool integrated module editor if the map you are editing is available. This will greatly facilitate the positioning of triggers.

3. Now, let’s use an example:

For the following tutorial, we will spawn a NPC with the ABC tag near your PC who will engage conversation when your pc crosses the trigger area.

1. Make the script that will fire when your PC enters the trigger area:

Code:
void main()
{
 object oEntering = GetEnteringObject();
  object oPC=GetFirstPC();
  if (GetIsPC(oEntering) && (!GetIsObjectValid(GetObjectByTag("ABC"))))

      {
  CreateObject(OBJECT_TYPE_CREATURE, "ABC", GetLocation(oPC));     
  AssignCommand((GetObjectByTag("ABC")),ActionMoveToObject(oPC));
   AssignCommand((GetObjectByTag("ABC")), ActionDoCommand(ActionStartConversation(oPC)));
  }
}



Save the script as spawning_abc.nss and compile.

2. Edit the .utt file:

Set the fields as follow:

Basic Tab
  • TemplateResRef: spawn_abc (make sure you save your .utt file with the same name: spawn_abc.utt).
  • Tag: spawn_abc (it doesn’t the same as the TemplateResRef field but I always name it the same to avoid mixing up names)
  • Name: The name of the trigger. Make sure you set the language correctly according to your game version.
  • Faction: 1
  • Type: 0 (it’s not a mine nor an area transition)
  • Cursor: 0
Scripts Tab
  • OnClick: [leave blank]
  • OnDisarm: [leave blank]
  • OnTrapTriggered: [leave blank]
  • ScriptHeartBeat: [leave blank]
  • ScriptOnEnter: spawning_abc (the name of the script you want to fire)
  • ScriptOnExit: [leave blank]
  • ScriptUserDefine: [leave blank]
Trap Tab
  • TrapDetectable: check this box
  • trapDetectDC: 0
  • trapDisarmable: check this box
  • DisarmDC: 0
  • TrapFlag: 0
  • trapOneShot: check this box
  • TrapType: 0
  • KeyName: [leave blank]
  • AutoRemoveKey: [leave blank]
Comments Tab
  • Comment: [leave blank or type whatever you want]


3. Edit the .git file, to position the trigger where you want and define the area it will cover. Type the name of your .utt file in the TemplateResRef field as in this screenshot:

http://img.photobucket.com/albums/v1...3/trigger1.jpg

Note: do not put the .git file directly in your override folder. Or you’ll end up with very funny effects, including messed up triggers. You have to pack it as a .mod file along with the .are and the .ifo files for the module and the other module specific files. You may also need to use CAMedit to fix the corrupted cameras in the .git file: http://www.pcgamemods.com/5276/

Hope this helps. I will review this tutorial during the weekend and try to add more screenshots.
Attached Files
File Type: doc Bioware_Aurora_Trigger_Format.doc (210.5 KB, 88 views)
Darth333 is offline   you may: quote & reply,
Old 03-09-2005, 11:11 PM   #7
ChAiNz.2da
Brony 4 Life. Yo.
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,847
Quote:
Originally posted by Darth333
Hope this helps. I will review this tutorial during the weekend and try to add more screenshots.
Umm, I hope you add this to the Tut's Sticky as well wow Darth333, I mean..just wow...

Needless to say I have a copy of this on my drive as we speak heheh


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 03-10-2005, 01:50 AM   #8
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
Quote:
Originally posted by Darth333
How to set a trigger

Blah Blah Blah Blah Blah ......
Hope this helps. I will review this tutorial during the weekend and try to add more screenshots.
wow your the best... i mean wow... thank you so much.....

who's better than you???









NOBODY!!!!

sketch42 is offline   you may: quote & reply,
Old 03-10-2005, 05:34 AM   #9
Xcom
k_ai_master
 
Xcom's Avatar
 
Join Date: Dec 2001
Location: scripts.bif
Posts: 1,011
Thumbs up

That's very useful tutorial, Darth. Thanks

One thing though, you might want to destroy the trigger after starting conversation by calling

DestroyObject(OBJECT_SELF);

in the script. Otherwise, I think it will "try" to start the cinematic every time you walk into it.

Xcom is offline   you may: quote & reply,
Old 03-10-2005, 09:48 AM   #10
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
Quote:
Originally posted by Xcom

One thing though, you might want to destroy the trigger after starting conversation by calling

DestroyObject(OBJECT_SELF);

in the script. Otherwise, I think it will "try" to start the cinematic every time you walk into it.
Good point. I'll double check that during the weekend. This is one thing I am not sure: of you set TrapOneShot to 1 if the trigger should disappear after firing.
However I am not sure if it applies only to mines or also to conversations. I'll test it
We can also use variables to make sure the trap triggers only at certain moments too.
Darth333 is offline   you may: quote & reply,
Old 03-10-2005, 10:23 AM   #11
Xcom
k_ai_master
 
Xcom's Avatar
 
Join Date: Dec 2001
Location: scripts.bif
Posts: 1,011
Quote:
Originally posted by Darth333
This is one thing I am not sure: of you set TrapOneShot to 1 if the trigger should disappear after firing.
Hmm.. I don't know. It may be. I know that DestroyObject will get rid of it permanently, but please inform us of your test results.

Quote:
Originally posted by Darth333
We can also use variables to make sure the trap triggers only at certain moments too.
Yes, that's a good method if you want to re-use the trigger. I am actually using smth like this in my Battle Sim mod.

Xcom is offline   you may: quote & reply,
Old 03-10-2005, 02:32 PM   #12
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
ok so now ihave the trigger setup .. i just need a script to attach to the utt to initialize the conversation between the 2 NPCs

i was going through nwsript and the nwnlexicon and i think i need something like this..

Code:
object oNPC1 = GetObjectByTag("vaklu");
object oNPC2 = GetObjectByTag("tobin");
object oPC = GetEnteringObject();
AssignCommand(oNPC!, ActionStartConversation(oNPC2, "", TRUE));

sketch42 is offline   you may: quote & reply,
Old 03-10-2005, 02:40 PM   #13
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
I gave you the script above. Just replace Object oPC by your second npc tag...

Code:
void main()
{
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering) )

   {
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("ABC"))));
 AssignCommand((GetObjectByTag("ABC")),ClearAllActions()); 
AssignCommand((GetObjectByTag("ABC")), ActionDoCommand(ActionStartConversation(oPC)));
    }
}


edit: modified the script. The dialogue will still be between you and the main NPC and the second NPC will be a participant to the conversation. Just leave your PC replies in blank.

Last edited by Darth333; 03-10-2005 at 05:49 PM.
Darth333 is offline   you may: quote & reply,
Old 03-10-2005, 02:47 PM   #14
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
wow how the heck did i miss that???? i read it like 3 times wow... im sorry than k you for pointing out my stupidity

sketch42 is offline   you may: quote & reply,
Old 03-10-2005, 02:57 PM   #15
Xcom
k_ai_master
 
Xcom's Avatar
 
Join Date: Dec 2001
Location: scripts.bif
Posts: 1,011
Darth, another little point and I have no idea if it matters or not, but since you said you are going to test..

Anyway, I noticed in your screenshot of GFFEdit the trigger entry has User-defined Struct 0. All Obsidians triggers are user-defined structs 1 and their geometry sub-entries are User-Defined Struct 3.

Now, again I don't know if it matters for triggers, but I know for sure it matters for creatures if you specify them in GIT files. (I spent hours trying to figure out why my creatures won't spawn until T7nowhere pointed me to those damn struct numbers. GFFEdit creates user-defined struct 0 by default when you create new node or copy existing one).

Xcom is offline   you may: quote & reply,
Old 03-10-2005, 03:12 PM   #16
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
Oops, you're right. I've been punished for my lazyness...I used an old screenshot I had on photobucket...but now that I remember I used this screenshot to explain the problem you just describe to someone else

Here is the correct screenshot: http://img.photobucket.com/albums/v1...3/gff_geom.jpg
Darth333 is offline   you may: quote & reply,
Old 03-10-2005, 06:12 PM   #17
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
Quote:
Originally posted by Darth333
I gave you the script above. Just replace Object oPC by your second npc tag...

Code:
void main()
{
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering) )

   {
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("ABC"))));
 AssignCommand((GetObjectByTag("ABC")),ClearAllActions()); 
AssignCommand((GetObjectByTag("ABC")), ActionDoCommand(ActionStartConversation(oPC)));
    }
}


edit: modified the script. The dialogue will still be between you and the main NPC and the second NPC will be a participant to the conversation. Just leave your PC replies in blank.
ok im confused about somethin here... bear with me i have to NPCs... one we'll call ABC and one we'll call XYZ ... now this script is for ABC and te PC to start a ialog and since the dialog field is empty for the PC in the dlg file than it will simply act as a dialog between ABC and XYZ?

what if i want ABC and XYZ to talk without the pc or anyoneelse hearing what they're saying.. meaning just them 2.. like with the twileks in nar shadaa when they speak about atton to each other?

im sorry for being such a pain

sketch42 is offline   you may: quote & reply,
Old 03-10-2005, 06:36 PM   #18
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
ok, camera discussion can be continued in this thread: http://www.lucasforums.com/showthrea...hreadid=145924


Quote:
ok im confused about somethin here... bear with me i have to NPCs... one we'll call ABC and one we'll call XYZ ... now this script is for ABC and te PC to start a ialog and since the dialog field is empty for the PC in the dlg file than it will simply act as a dialog between ABC and XYZ?
exactly

Quote:
what if i want ABC and XYZ to talk without the pc or anyoneelse hearing what they're saying.. meaning just them 2.. like with the twileks in nar shadaa when they speak about atton to each other?
check the dialog...your PC is there otherwise you wont see the conversation.
Darth333 is offline   you may: quote & reply,
Old 03-10-2005, 06:50 PM   #19
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
Quote:
Originally posted by Darth333

check the dialog...your PC is there otherwise you wont see the conversation.
so if i wanted this dialog to take place in a diffent module other than the one the pc is in.. i would have to make an area transition for the pc to the new module where the dialog is taking place and than another area transition for the pc to be returned to where they where originally

sketch42 is offline   you may: quote & reply,
Old 03-10-2005, 06:55 PM   #20
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
Quote:
Originally posted by sketch42
so if i wanted this dialog to take place in a diffent module other than the one the pc is in.. i would have to make an area transition for the pc to the new module where the dialog is taking place and than another area transition for the pc to be returned to where they where originally
correct
Darth333 is offline   you may: quote & reply,
Old 04-01-2012, 11:43 PM   #21
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Hey, I know this thread is really old, but I noticed that due to a recent change on Bioware's site, the link Darth333 provided for Bioware's notes on the trigger's geometry doesn't work. I've manged to find working links using the wayback machine though.

PDF File

Downloadable DOC File


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 04-02-2012, 06:43 PM   #22
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
Quote:
Originally Posted by Fallen Guardian View Post
Hey, I know this thread is really old, but I noticed that due to a recent change on Bioware's site, the link Darth333 provided for Bioware's notes on the trigger's geometry doesn't work. I've manged to find working links using the wayback machine though.

PDF File

Downloadable DOC File
Thanks for letting us know. Added an extra download option in my (old) post..
Darth333 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Setting up Triggers....

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:03 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.