Elven6 Posted March 11, 2006 Share Posted March 11, 2006 I looked throught the scripting tutorial but I coulden't find a script that allows the PC to talk to a npc and then attack him. Does anyone have one that I can use? Link to comment Share on other sites More sharing options...
Kitty Kitty Posted March 11, 2006 Share Posted March 11, 2006 There's an excellent writeup by our very own tk102 entitled "Talk - Fight - Talk sequence" which should do what you need. Just read it over and leave out the part about stopping the NPC from death and going back into conversation if you don't need that part. You can find it HERE Cheers, -Kitty Link to comment Share on other sites More sharing options...
Elven6 Posted March 11, 2006 Author Share Posted March 11, 2006 When I try to compile the fight script it dosent work this is what I use void main() { object oNPC=GetObjectByTag("npc_tag"); ChangeToStandardFaction(oNPC, 1); // and if there are any thugs to fight... object oThug1 = GetObjectByTag("npc1_tag"); object oThug2 = GetObjectByTag("npc2_tag"); object oThug3 = GetObjectByTag("npc3_tag"); ChangeToStandardFaction(oThug1, 1); ChangeToStandardFaction(oThug2, 1); ChangeToStandardFaction(oThug3, 1); } Link to comment Share on other sites More sharing options...
Kitty Kitty Posted March 11, 2006 Share Posted March 11, 2006 Well, no. Like that I'm quite sure it's not going to work. See, right off, you don't even need any of the stuff after the comment line (// and if there are any thugs to fight...) except of course the closing curly brace unless whatever NPC you're trying to start a fight with has friends around that you also want to fight you. Second, everything you see in quotes there, such as "npc_tag" means you have to go look up the actual tag for the NPC you want to interact with and replace it with the correct information. Let me say I'm sorry in advance if I make any minor mistakes here -it's been a LONG time since I touched a script for KOTOR. If I do though, someone will be able to spot and correct it quickly I'm certain. That said... If you wanted to have Belaya fight you after talking with her on Dantooine in the Jedi Enclave, you'd want your source to look like this: void main() { object oNPC=GetObjectByTag(dan13_belaya); ChangeToStandardFaction(oNPC, 1); } Now if you want to have Belaya attack you and have Juhani join her in attacking you (I use her as the example simply because once she goes back to the enclace she's standing right there in the same spot) you'd want it to look like this: void main() { object oNPC=GetObjectByTag(dan13_belaya); ChangeToStandardFaction(oNPC, 1); object oThug1 = GetObjectByTag(dan13_juhani); ChangeToStandardFaction(oThug1, 1); } The reason yours won't compile is because you're trying to define a constant string within a function call that doesn't allow for doing so (the quotes), but even if it DID compile, it wouldn't do anything beause the game would never find any NPC called 'npc_tag' anyway. Not to be mean or rude or anything, but if you plan on fiddling about with much scripting, it would behoove you to read (not skim --read) through the available scripting advice and tutorials. It can be pretty tricky, and if you don't at least have a pretty solid basic knowledge of what's going on in there it'll give you migranes in no time. Cheers, -Kitty Link to comment Share on other sites More sharing options...
deathdisco Posted March 11, 2006 Share Posted March 11, 2006 @Kitty, glad to see you're back. You were here for a brief time when I first discovered Holowan. It's good to see one of the original Kotor modders back:D @Elven6, The script compiles fine. If you mean it not working like you intended, did you replace everything in quote with the tags from the UTC's you're using. EDIT: Kitty beat me to it. Link to comment Share on other sites More sharing options...
Pavlos Posted March 11, 2006 Share Posted March 11, 2006 No you do need the quotations around the tag - otherwise the game doesn't know what it is looking at. void main() { object oNPC=GetObjectByTag("dan13_belaya"); ChangeToStandardFaction(oNPC, 1); object oThug1 = GetObjectByTag("dan13_juhani"); ChangeToStandardFaction(oThug1, 1); } But yeah other than that it should be ok. Just attach it to the final dialogue node. Link to comment Share on other sites More sharing options...
Kitty Kitty Posted March 11, 2006 Share Posted March 11, 2006 No you do need the quotations around the tag - otherwise the game doesn't know what it is looking at. [snipped] But yeah other than that it should be ok. Just attach it to the final dialogue node. Ha! See? I knew I'd goof something up. Even as I was writing it the question as to whether the quotes should or shouldn't be around the proper tags was nagging me, and hence the disclaimer about my own lack of brain cells on the matter. Soooo.. that being the case, let's retract part of what I said above. Everything up there is still ok as far as the code goes (just put the quote marks back as Pavlos stated) and all should be well. If it's still not compiling, you've got something goofed in your tools. Start with checking the easy stuff, such as making sure all your paths are correct, and that you saved your script source as script_name.nss (NOT .txt) and that you have it and everything else KotORtool needs to find in the right places. That's probably where 80% of people have compile problems crop up, as well as access to include files, but that isn't the case here since this script doesn't need to include any others. And @ deathdisco: Thanx. It's good to be back, even if I am a dinosaur. Cheers, -Kitty Link to comment Share on other sites More sharing options...
Elven6 Posted March 11, 2006 Author Share Posted March 11, 2006 Ok I got the script to compile, but before I test it I need a warp script, like the one on Nar Shadda when you fix the speeder and it warps you Like if a NPC comes up to you and tells you he can take you somewhere, but you will need a script in his dialouge to get you their. Edit: I used the scripts but the PC dosen't attack after the conversation is over Link to comment Share on other sites More sharing options...
RedHawke Posted March 13, 2006 Share Posted March 13, 2006 A script to make an NPC hostile should run in the last line of the dialogue. Link to comment Share on other sites More sharing options...
cookie12 Posted March 13, 2006 Share Posted March 13, 2006 Does this script only work for Kotor 1? Link to comment Share on other sites More sharing options...
Pavlos Posted March 13, 2006 Share Posted March 13, 2006 No, it should work for TSL. Generally, scripts from KotOR I will work for TSL - the problem comes with taking TSL into KotOR - some of the functions used just don't exist! Link to comment Share on other sites More sharing options...
Elven6 Posted March 16, 2006 Author Share Posted March 16, 2006 The script still dosen't work, is their a special order the dialouge lines have to be? Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 Maybe your not compiling it? here do this take void main() { object oNPC=GetObjectByTag("dan13_belaya"); ChangeToStandardFaction(oNPC, 1); } that copy it paste it in your text editor in Kotor Tool go to the menu that has the compile button save it in your Override folder as fight now open up the module section of Kotor tool and look for Danm13_s.rim and look for the belaya dialog, make a new dialog entry for the PC to say then attach your fight.ncs script by typing in the first script box fight (without the .ncs) and save that in your override go to dantooine and talk to belaya and select your custom dialog and she should turn to a hostile (if you want to kill her permantly just edit her .utc file and turn of minamal 1 hp selection and save that into your override) if I made any mistakes tell me Link to comment Share on other sites More sharing options...
Elven6 Posted March 16, 2006 Author Share Posted March 16, 2006 Thats what I am doing but he dosen't attack Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 When you talk to he/she do you see your custom dialog entry? If so did you check and make sure you didnt add the .ncs extension to the dialog node? And in your override folder is it .nss or .ncs? And with the code you have to change dan13_belaya to something else if your doing another person Link to comment Share on other sites More sharing options...
Elven6 Posted March 16, 2006 Author Share Posted March 16, 2006 Ok here is the code I use void main() { object oNPC=GetObjectByTag("g_dark_mas01m"); ChangeToStandardFaction(oNPC, 1); } And the code I belive is in nss format Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 it has to be in .ncs format just make sure in the Kotor Tool text editor that that "Script is for Kotor 1" is check and that you use compile not the save or save as (p.s since you are using a normally hostile NPC make sure you edit his file and set him to netreul) but otherwise everything your doing is right -cookie12 Link to comment Share on other sites More sharing options...
Elven6 Posted March 16, 2006 Author Share Posted March 16, 2006 it dosent compile anymore, btw the script is for kotor 2 Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 ok start Kotor Tool and start a new script make sure its selected "Script is for Kotor 2" then his compile it should prompt you to save it, save it in your override, then check your override and make sure it is in .ncs format -Cookie12 Link to comment Share on other sites More sharing options...
Elven6 Posted March 16, 2006 Author Share Posted March 16, 2006 No it still dosent work, it is in a diffrent format, do I put the .ncs in the text box or is it the final product of compiling Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 put .ncs there hope it works for you -Cookie12 Link to comment Share on other sites More sharing options...
Patriarch Posted March 16, 2006 Share Posted March 16, 2006 Elven No offense, but the answers you are seeking, are not advanced.....Answers regarding talk fight talk are covered by tk102 in the tutorials.....Try to look at them and understand the syntax, add one line ...Then compile.....if success one more....this is helpfull at an early stage..... But mostly look for scripts that does something similar to what you wanna do..then modify it bit by bit.........Read the introduction to the scripting syntax by tk102.... To make a character attack you at the end of a dialogue just type "a_atkonend" in the scipt field of dlg edit.... Most of the scripts you need are already there.....Have a look at the source using kotor tool.... Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 Why does some people think a regular talk attack script is so ... advanced it was my first script done Link to comment Share on other sites More sharing options...
Patriarch Posted March 16, 2006 Share Posted March 16, 2006 cookie....Trying to give the guy some pointers....I know it is not advanced.... Link to comment Share on other sites More sharing options...
cookie12 Posted March 16, 2006 Share Posted March 16, 2006 oh... ok sorry continue on then Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.