Warlord664 Posted September 15, 2011 Share Posted September 15, 2011 Hey! Can some one help me out with these? (1) I need a script that makes it trigger a conversation after you open a door. (2) I need a script that gives you credits kinda like a quest reward. (3) I need a script that makes one guy attack the other guy and kill him all in conversation. Ty. Link to comment Share on other sites More sharing options...
Qui-Don Jorn Posted September 15, 2011 Share Posted September 15, 2011 need more info,.. which game? is there a specific tag for the door? tags of the two "guys"? Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 This is for TSL The two guys are npcs I put down. The door is in the refugee sector in nar shadda its tag is NarShaddaaDoor01. I believe every door in the refugee sector has that tag. Link to comment Share on other sites More sharing options...
Qui-Don Jorn Posted September 15, 2011 Share Posted September 15, 2011 oh, umm. well there is a generic a_givecredits script in the game, you can just put it in the script slot in the dialog with the amount next to it in the box..or is it actually attached to a journal quest entry? what is the tag of the journal quest entry and the id# for it? Link to comment Share on other sites More sharing options...
harIII Posted September 15, 2011 Share Posted September 15, 2011 Here are the script you need, they should all compile because these are the generic scripts I use as templates while work on my project. Note that a lot of scripts can work in both TSL and KOTOR because they have basically the same set of functions. However TSL gives you a couple of more scripting options. Anyways, onto the scripts: 1. Conversation after Door - Attach this the OnOpen field of the door and it will fire when the door opens. Also I attached a small delay script so that the script will fire 3 seconds after the door is opened. I did this so that you would click the door and start a conversation while the door is still opening. Also I saw from your post that apparently all the doors in the area you want to use this have the same tag, that's bad, real bad, as in not breathing bad. You need to go in the .git file, find the door that you want the script to fire at (by matching up the coordinates with the whereami armband), and change the name so that it's unique. Otherwise the script will fire every time you open a door with the same tag. void main() { object oNPC=GetObjectByTag("npc tag or the name of dialog if there is no npc to fire it"); ActionDoCommand(SetCommandable(TRUE,oNPC)); DelayCommand(3.0,AssignCommand (oNPC, ActionStartConversation(GetFirstPC()))); } 2. Add Credits to the PC void main() { GiveGoldToCreature(GetFirstPC(),200); } 3. Two Guys Fight and Die - This one requires two scripts, one to fire at some point to make the guys fight and the second to kill the one you want. What's going on here is that the two characters will fight each other but you will NOT be able to intervene in the fight. What you need to do is fire the first script when you want the to characters to fight and the second when you want one of them to die. First Script: void main() { object oObject1=GetObjectByTag("first character"); object oObject2=GetObjectByTag("second character"); ChangeToStandardFaction(oObject1, 12); ChangeToStandardFaction(oObject2, 13); ExecuteScript("k_ai_master",oObject1,1005); ExecuteScript("k_ai_master",oObject2,1005); } Second Script: void main() { effect eStun = EffectDeath(); object oTarget = GetObjectByTag("tag of character to die"); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun,oTarget); } I hope this helps, if you have any questions, yell at me. Link to comment Share on other sites More sharing options...
Qui-Don Jorn Posted September 15, 2011 Share Posted September 15, 2011 wow. yeah, what he said. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 Ty Har. But the last script I just want the one guy to swing once and kill the other guy. I wasn't planning on having a big fight with these guys. Im guessing it will still work thoguh. Not sure where two place the second script. Will I have to have the guy whos killing the other guy talking while he does it? Link to comment Share on other sites More sharing options...
harIII Posted September 15, 2011 Share Posted September 15, 2011 If you want you could combine the two scripts together and do something like this for the second script: DelayCommand(5.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun, oTarget)); Just replace this with the last line of the last script and now it will happen after 5 seconds, you can change that pretty easily. Now that these two scripts are combined you can watch the fighting and then after 5 seconds the one guy will die. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 Awesome. Ty Har. Link to comment Share on other sites More sharing options...
harIII Posted September 15, 2011 Share Posted September 15, 2011 No worries, let me know if you need any additional help and I'll be happy to work with you. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 Huh. I just tried the door script and it didn't work. I put the npcs name in it and put the script in the onopen area on the door.utd so I don't know what I did wrong. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 15, 2011 Share Posted September 15, 2011 It is possible that you need to revert to an earlier save, one where you have not entered the module where the altered door is. Link to comment Share on other sites More sharing options...
harIII Posted September 15, 2011 Share Posted September 15, 2011 Another option is to simply place the .git file in the override and start the game that way. The .git in the override will in a sense "reset" the level and ensure that everything you do to the module will take affect. Some changes require you to start a new game to see their affects if you've already compiled the modules. If I'm testing something I always keep the .git file and any edited/new files in the override until I'm not with that section and have to move on to the next module. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 I already have the git file in my override. Are you guys sure theres not something wrong with the script? Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 15, 2011 Share Posted September 15, 2011 Post the script, as you are trying to use it. Not the one that harIII provided, but the one where you have substituted the tag you are using. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 void main() { object oNPC=GetObjectByTag("to'ggar"); ActionDoCommand(SetCommandable(TRUE,oNPC)); DelayCommand(3.0,AssignCommand (oNPC, ActionStartConversation(GetFirstPC()))); } Thats the script. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 15, 2011 Share Posted September 15, 2011 void main() { object oNPC=GetObjectByTag("[color=darkorange]to'ggar[/color]"); ActionDoCommand(SetCommandable(TRUE,oNPC)); DelayCommand(3.0,AssignCommand(oNPC,ActionStartConversation(GetFirstPC()))); } Not sure if the hyphen is a valid character or not for tags.... so that may be the problem. Otherwise, the code compiles fine. Have you placed it as the action script in the OnOpen field of the door's .utd? If so, then I am not sure what the issue might be... maybe harIII has an idea. For fun, you could play around with the DelayCommand.... try changing the value to a shorter time, or try it without the DelayCommand (you would need to remove the 3.0 value as well as the DelayCommand parentheses). Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 Well I already have that npc in game and that was his tag so I guess hyphens work. Yeah I placed it in the OnOpen field of the doors .utd Link to comment Share on other sites More sharing options...
harIII Posted September 15, 2011 Share Posted September 15, 2011 Does the dialog fire when you walk up to the character and try talking with him? Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 Yeah I can walk up and talk to him like every body else. There shouldn't be any thing wrong with the dlg Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 15, 2011 Share Posted September 15, 2011 Ok, so try this... void main() { object oPC=GetFirstPC(); object oTalker=GetObjectByTag("to'ggar"); ActionDoCommand(SetCommandable(TRUE,oTalker)); DelayCommand(3.0, AssignCommand(oTalker,ActionStartConversation(oPC,"[color=darkorange]yourdialogname[/color]",CONVERSATION_TYPE_CINEMATIC))); } This should, when you have substituted the name of your dialog for what is in orange above, fire the dialog immediately after opening the door. Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 I put that into the script and then tried to compile it and then it gave me an error. Did it compile it anyway or do I need to figure out what the error is and fix it? Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 15, 2011 Share Posted September 15, 2011 It compiles for me with no errors, even with the generic dialog name yourdialogname... I did edit my post a couple times... I was copy and pasting old code, and realized I had not declared a variable in my initial "try this" post. Sorry Try what is posted now, just copy & paste it into your editor and simply replace the name of your dialog where it is highlighted orange, leaving the quotes! Then compile and blissfully admire your modmaking! Link to comment Share on other sites More sharing options...
Warlord664 Posted September 15, 2011 Author Share Posted September 15, 2011 It works! Ty QGG! Now I just need to change the delay it was a little bit too long. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted September 15, 2011 Share Posted September 15, 2011 Anytime.... harIII was on the money, just left out specifying the dialog to fire... his code would have worked with the addition of a comma and the dialog name and it's data type. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.