sketch42 Posted March 9, 2005 Share Posted March 9, 2005 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 Link to comment Share on other sites More sharing options...
Darth333 Posted March 9, 2005 Share Posted March 9, 2005 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/Bioware_Aurora_Trigger_Format.pdf It provides useful info, especially concerning the geometry. Link to comment Share on other sites More sharing options...
Fred Tetra Posted March 9, 2005 Share Posted March 9, 2005 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? Link to comment Share on other sites More sharing options...
sketch42 Posted March 9, 2005 Author Share Posted March 9, 2005 TSL im trying to set up a new area... using 501OND Link to comment Share on other sites More sharing options...
sketch42 Posted March 10, 2005 Author Share Posted March 10, 2005 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 Link to comment Share on other sites More sharing options...
Darth333 Posted March 10, 2005 Share Posted March 10, 2005 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/showthread.php?s=&threadid=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: http://hhttp://img.photobucket.com/albums/v144/Darth333/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/Bioware_Aurora_Trigger_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: 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/v144/Darth333/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. Bioware_Aurora_Trigger_Format.doc Link to comment Share on other sites More sharing options...
ChAiNz.2da Posted March 10, 2005 Share Posted March 10, 2005 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 Link to comment Share on other sites More sharing options...
sketch42 Posted March 10, 2005 Author Share Posted March 10, 2005 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!!!! Link to comment Share on other sites More sharing options...
Xcom Posted March 10, 2005 Share Posted March 10, 2005 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. Link to comment Share on other sites More sharing options...
Darth333 Posted March 10, 2005 Share Posted March 10, 2005 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. Link to comment Share on other sites More sharing options...
Xcom Posted March 10, 2005 Share Posted March 10, 2005 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. [/Quote] 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. 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. Link to comment Share on other sites More sharing options...
sketch42 Posted March 10, 2005 Author Share Posted March 10, 2005 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.. object oNPC1 = GetObjectByTag("vaklu"); object oNPC2 = GetObjectByTag("tobin"); object oPC = GetEnteringObject(); AssignCommand(oNPC!, ActionStartConversation(oNPC2, "", TRUE)); Link to comment Share on other sites More sharing options...
Darth333 Posted March 10, 2005 Share Posted March 10, 2005 I gave you the script above. Just replace Object oPC by your second npc tag... 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. Link to comment Share on other sites More sharing options...
sketch42 Posted March 10, 2005 Author Share Posted March 10, 2005 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 Link to comment Share on other sites More sharing options...
Xcom Posted March 10, 2005 Share Posted March 10, 2005 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). Link to comment Share on other sites More sharing options...
Darth333 Posted March 10, 2005 Share Posted March 10, 2005 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/v144/Darth333/gff_geom.jpg Link to comment Share on other sites More sharing options...
sketch42 Posted March 10, 2005 Author Share Posted March 10, 2005 Originally posted by Darth333 I gave you the script above. Just replace Object oPC by your second npc tag... 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 Link to comment Share on other sites More sharing options...
Darth333 Posted March 10, 2005 Share Posted March 10, 2005 ok, camera discussion can be continued in this thread: http://www.lucasforums.com/showthread.php?s=&threadid=145924 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 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. Link to comment Share on other sites More sharing options...
sketch42 Posted March 10, 2005 Author Share Posted March 10, 2005 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 Link to comment Share on other sites More sharing options...
Darth333 Posted March 10, 2005 Share Posted March 10, 2005 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 Link to comment Share on other sites More sharing options...
Fallen Guardian Posted April 2, 2012 Share Posted April 2, 2012 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 Link to comment Share on other sites More sharing options...
Darth333 Posted April 2, 2012 Share Posted April 2, 2012 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.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.