Elven6 Posted March 5, 2006 Share Posted March 5, 2006 I am working on a mod and I need a few scripts for it that I cannot find in the tutorials. I also need to know where to put them lol I need one to initiate pazzak, a warping script and I need one that initiates a conversation line ONLY when the PC has a certain item with him. Link to comment Share on other sites More sharing options...
brwarner Posted March 5, 2006 Share Posted March 5, 2006 For the availability of a dialog line based on if the PC has an item you would use this: int StartingConditional() { sTag=GetScriptStringParameter(); int iResult = 0; object oPC = GetFirstPC(); object oItem; for(int i = 0;i<a;i++) { oItem = GetNextItemInInventory(oPC); if(GetTag(oItem)sTag) { iResult=1; return iResult } } return iResult } You have to set a to the number of inventory slots which i dont know how to do. Also if you are looking for scripting functions use kotor tool to look them up in the text editor. If you are using TK102s GUI dialog editor then when clicking on the correct node in the tree at the bottom under Conditional put the script name and then the tag of the item under the string parameter. Put the actual script file in override. Link to comment Share on other sites More sharing options...
stoffe Posted March 5, 2006 Share Posted March 5, 2006 For the availability of a dialog line based on if the PC has an item you would use this: (snip) If you know the tag of the item you don't have to loop through the player's inventory to see if they have the item. This should be enough: int StartingConditional() { string sTag = GetScriptStringParameter(); return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), sTag)); } Link to comment Share on other sites More sharing options...
Elven6 Posted March 5, 2006 Author Share Posted March 5, 2006 But where would I put it? I am using the dlgeditor you get off the Holowan site, their is a box for conditionals and one for scripts. I looked throught previous dialouges for mods made by other people and they only had a few characters in them. Using the code stroffe gave were would I put the name of the item? Link to comment Share on other sites More sharing options...
tk102 Posted March 5, 2006 Share Posted March 5, 2006 Using the code stroffe gave were would I put the name of the item? Put it in the StringParam field for Conditional #1 where "elven6_itemchk" is the name of the script stoffe -mkb- gave above, and "elven6_item_tag" is the tag name of the item you want to check for. The conditional script will return TRUE if the PC possesses the item (allowing the dialog to initiate). Link to comment Share on other sites More sharing options...
Elven6 Posted March 5, 2006 Author Share Posted March 5, 2006 Were does the script go? When I put it into the Script 1 or 2 box it gets cut after i click away like int StartingConditional() { string sTag = GetScriptStringParameter(); return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), sTag)); } Becomes int StartingCon int StartingCon Link to comment Share on other sites More sharing options...
tk102 Posted March 5, 2006 Share Posted March 5, 2006 The script is a separate file. It does not get entered into DLGEditor. You need to compile the script using KotOR Tool or nwnnsscomp.exe. Only the name of the script gets entered into DLGEditor. Link to comment Share on other sites More sharing options...
Elven6 Posted March 6, 2006 Author Share Posted March 6, 2006 When I try to compile the script using kotor tool I get a error I need the file nwscript.nss Link to comment Share on other sites More sharing options...
tk102 Posted March 6, 2006 Share Posted March 6, 2006 In KotOR Tool, browse to Kotor II - BIFs -- scripts.bif --- Scripts, Source and extract nwscript.nss into your SWKOTOR2\Override folder. Then try recompiling. Link to comment Share on other sites More sharing options...
Elven6 Posted March 9, 2006 Author Share Posted March 9, 2006 Ok I compiled the script and I entered a tag, but the thing is the dialouge dosen't appear. I also need one that will make a dialouge line disappear after the conversation is over. Edit: I made a scripting tutorial, its on my website under Tutorials so if anyone needs help check it out http://www.freewebs.com/kotorstuff/ I am closing this redundant thread, please continue any and all of your many scripting questions here. -RH Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.