CaptainPike Posted September 4, 2014 Share Posted September 4, 2014 First and foremost, to be clear, I'm not asking for a mod to be done that has already been done (which this has been so; though I don't know if it has been done the way I am trying to do it). What I am asking for is assistance in helping me do a mod that has already been done; and with a specific piece of the puzzle in the mod I'm having trouble with. I'm trying to convert the Ebon Hawk "Emergency Supplies" into an interactive "store" that sells and buys at 0% markup/markdown (in other words, everything costs and buys at 0). To do this, I need to "prime" a merchant, and here is where I run into a problem: I am unable to change any number in my KOTOR Tool "merchants" section. Any number I try to enter is rejected; and the number that was there pops back up. This goes for item counts and the markup/markdown value. For the item counts, I've been able to work around it by putting codes for items I don't want (or don't want that many of) onto some very minor item; such as quarterstaff or clothing. But the Markup/Markdown values bug is really in my way on this one. So, I'd like some help: 1. Can someone make me a merchant file (favorably a Pazaak merchant; there's less junk in those stores to deal with) with 0% mark up/mark down to email to me; or, 2. Can someone tell me how to fix this bug; or, 3. Is there a way to script and force the 0% Markup/Markdown when the store opens (eliminating all this hassle altogether?) Thanks. Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 5, 2014 Share Posted September 5, 2014 Well, the Mark up and Mark down are controlled in the call to OpenStore, which should be in the script attached to the OnClicked event of the placeable. void main() { OpenStore("<tag of store>", GetFirstPC(), 0, 100); } Link to comment Share on other sites More sharing options...
CaptainPike Posted September 5, 2014 Author Share Posted September 5, 2014 OpenStore("EmergencySupplies", GetFirstPC(), 0, 0); So this would mean open "EmergencySupplies" for the first PC (the player) at 0% markup/markdown? Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 5, 2014 Share Posted September 5, 2014 OpenStore("EmergencySupplies", GetFirstPC(), 0, 0); So this would mean open "EmergencySupplies" for the first PC (the player) at 0% markup/markdown? Yes, but if you want free items, you should probably use 100% markdown. Link to comment Share on other sites More sharing options...
CaptainPike Posted September 5, 2014 Author Share Posted September 5, 2014 Ah! So, based on the percentage of the "base value" of the item: OpenStore("<tag of store>", GetFirstPC(), Markup%, Markdown%) Link to comment Share on other sites More sharing options...
CaptainPike Posted September 5, 2014 Author Share Posted September 5, 2014 Query #1: Ah! So, based on the percentage of the "base value" of the item: OpenStore("<tag of store>", GetFirstPC(), Markup%, Markdown%) Query #2: I don't want the "emergency supplies" to much up the Sasha quest, so I went digging into the scripting. Been researching some stuff; looked for the script for the "Emergency Supplies" object; found its script file; and found this: void main() { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); } Understanding that was a subroutine or function, I researched ActionStartConversation and found this: When an object executes ActionStartConversation, it attempts to use the dialogue file specified as sDialogResRef to start conversing with the target, oObjectToConverseWith. If the target is not a PC, the target's OnConversation event fires. So, which is correct: 1. Find the variable/journal entry that indicates Sasha is on board the ship and not found; and if that is not true, then open the "emergency supplies"; or, 2. Simply put the Emergency Supplies command to open after the ActionStartConversation? Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 6, 2014 Share Posted September 6, 2014 So, which is correct: 1. Find the variable/journal entry that indicates Sasha is on board the ship and not found; and if that is not true, then open the "emergency supplies"; or, 2. Simply put the Emergency Supplies command to open after the ActionStartConversation? Finding the variable is easier: Show spoiler (hidden content - requires Javascript to show) void main() { int iQuest = GetJournalEntry("k_pebo_stowaway"); if(iQuest >= 10) // She was found { if(iQuest != 40) // Not by Dantooine Twilek { OpenStore("<Tag>", GetFirstPC(), 0, 100); } } else { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); } } That should check if the Quest is active, but will not open the store if you initiated it with the Twi'lek on Dantooine. Also, note the in option 2, you would always open the store after the dialogue started, which would be havoc with the quest. Link to comment Share on other sites More sharing options...
CaptainPike Posted September 6, 2014 Author Share Posted September 6, 2014 OK, I looked at your script, I believe I understand the syntax, and compared it to the quest log via "Game Editor". I understand iQuest is a variable that holds the value associated with the state of the "Strange Stowaway" quest; If the value is >= 10, then the quest is active but not completed; so we check again, and if the value is 40, then we've only talked to the Twilek; so if the quest is active or completed (except on the condition that we have simply talked to the Twilek) then the store opens. So, the emergency supplies become available to the player only after Sasha's presence has been discovered; the rest of the time, clicking on the store will simply present the message about it being an "emergency supplies", LoL .... I am 80% clear. Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 6, 2014 Share Posted September 6, 2014 OK, I looked at your script, I believe I understand the syntax, and compared it to the quest log via "Game Editor". I understand iQuest is a variable that holds the value associated with the state of the "Strange Stowaway" quest; If the value is >= 10, then the quest is active but not completed; so we check again, and if the value is 40, then we've only talked to the Twilek; so if the quest is active or completed (except on the condition that we have simply talked to the Twilek) then the store opens. So, the emergency supplies become available to the player only after Sasha's presence has been discovered; the rest of the time, clicking on the store will simply present the message about it being an "emergency supplies", LoL .... I am 80% clear. Yes, you've read it all right. I did forget about the quest not being active, so I'm re-writing the script like so: Show spoiler (hidden content - requires Javascript to show) void main() { int iQuest = GetJournalEntry("k_pebo_stowaway"); if(iQuest == 0) // Quest not started at all... { OpenStore("<Tag>", GetFirstPC(), 0, 100); } if(iQuest >= 10) // She was found { if(iQuest != 40) // Not by Dantooine Twilek { OpenStore("<Tag>", GetFirstPC(), 0, 100); } } else { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); } } Now the only thing to experiment and check with would be whether the dialogue plays the first time it needs to, or whether the store just opens... Link to comment Share on other sites More sharing options...
CaptainPike Posted September 6, 2014 Author Share Posted September 6, 2014 Got it! I haven't been able to compile; "partial" error; so I guess I don't have all the right files in the right place. But, I don't want to depend completely on you; so let me do some research and see if I can't figure out what I'm doing wrong and what I need to do different first; and if I run into roadblocks, I'll scream @ ya! Thanks for all your help ... It's going to be cool to implement this feature into my games! Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 6, 2014 Share Posted September 6, 2014 Okay, and don't forget that I gave you my skype, if you have to get a hold of me. Link to comment Share on other sites More sharing options...
CaptainPike Posted September 7, 2014 Author Share Posted September 7, 2014 Okay. I'm stuck, LoL. I have googled "DeNCS Partial Error" and came up with nothing. I have googled "How To compile KOTOR scripts" but nothing I've found addresses partial error or what needs to be present for a successful compile; it only addresses the commands necessary to initiate a compile. It is my intent to not be so dependent on others to accomplish my mod ..... What I was doing when the error was caused is this: I placed in a folder (3) files: k_pebn_kiosk-Script.txt (* saved script to insert *) kiosk004.utp (* the "emergency supplies" object *); and supplies.utm (* the "store"). My script looks like this: void main() { int iQuest = GetJournalEntry("k_pebo_stowaway"); if(iQuest == 0) // Quest not started at all... { OpenStore("supplies", GetFirstPC(), 0, 100); } if(iQuest >= 10) // She was found { if(iQuest != 40) // Not by Dantooine Twilek { OpenStore("supplies", GetFirstPC(), 0, 100); } } else { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); } } I then opened DeNCS, loaded kiosk004.utp, copied and pasted the text above from my text file, then clicked File/Save then received the error. What am I doing wrong and what do I need to do different? Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 7, 2014 Share Posted September 7, 2014 Okay. I'm stuck, LoL. I have googled "DeNCS Partial Error" and came up with nothing. I have googled "How To compile KOTOR scripts" but nothing I've found addresses partial error or what needs to be present for a successful compile; it only addresses the commands necessary to initiate a compile. It is my intent to not be so dependent on others to accomplish my mod ..... What I was doing when the error was caused is this: I placed in a folder (3) files: k_pebn_kiosk-Script.txt (* saved script to insert *) kiosk004.utp (* the "emergency supplies" object *); and supplies.utm (* the "store"). My script looks like this: I then opened DeNCS, loaded kiosk004.utp, copied and pasted the text above from my text file, then clicked File/Save then received the error. What am I doing wrong and what do I need to do different? Well, DeNCS should only be used for .ncs files. Also, what is the exact error message you are getting? I recommend just compiling the script with KotOR Tool instead of DeNCS. Link to comment Share on other sites More sharing options...
CaptainPike Posted September 7, 2014 Author Share Posted September 7, 2014 Oops, I told you wrong, LoL. I was attempting to edit k_pebn_kiosk.ncs; Here are the error messages: Decompiling...k_pebn_kiosk.ncs: partial-could not recompile Recompiling...k_pebn_kiosk.ncs: partial-could not recompile But if we can do all of this through KOTOR, that'd be great; I don't like Java on my computer anyway. How do I access and compile .ncs files through KOTOR? I've tried just about every menu option and googled it ... Link to comment Share on other sites More sharing options...
CaptainPike Posted September 7, 2014 Author Share Posted September 7, 2014 This, perchance? http://deadlystream.com/forum/files/file/191-kotor-scripting-tool/ Link to comment Share on other sites More sharing options...
CaptainPike Posted September 7, 2014 Author Share Posted September 7, 2014 Now WAIT a minute! I used that tool above and brought up the k_pebn_kiosk.nss file, and the revised script is in there! But, DeNCS didn't show the revised script; it showed the old script. OK, I'm ditching DeNCS. So, if KOTOR Scripting Tool is showing the revised script in the .nss file when I open it, then I guess the revised script IS in there, and HAS been in there, LoL! So, now what? Just put that .nss file in 'Override' folder; or do I need to compile it into the module file? Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 7, 2014 Share Posted September 7, 2014 Oops, I told you wrong, LoL. I was attempting to edit k_pebn_kiosk.ncs; Here are the error messages: Decompiling...k_pebn_kiosk.ncs: partial-could not recompile Recompiling...k_pebn_kiosk.ncs: partial-could not recompile But if we can do all of this through KOTOR, that'd be great; I don't like Java on my computer anyway. How do I access and compile .ncs files through KOTOR? I've tried just about every menu option and googled it ... Okay, I see. What you want to do is use DeNCS to decompile the script, then right click on the left column of random numbers and select "Show Decompiled Code". Then select all of it, copy it, and then open KotOR Tool. Now, open the text editor and paste it. Make your edits, select which game version it is, and then double-check that all of the #include files are in the override folder for that game. Now, compile and it should work if there are no syntax errors. If there are syntax errors, post your code, but enclose the code with this(in addition to the [ CODE][/code ] part): [HIDDEN ][/HIDDEN ] but make sure to take out the spaces. Link to comment Share on other sites More sharing options...
CaptainPike Posted September 7, 2014 Author Share Posted September 7, 2014 .... nevermind this post, getting somewhere ... I think .... Link to comment Share on other sites More sharing options...
CaptainPike Posted September 8, 2014 Author Share Posted September 8, 2014 Type mismatch in parameter 1 of "openStore" function .... That makes no sense at all ... [hidden] void main() { int iQuest = GetJournalEntry("k_pebo_stowaway"); if(iQuest == 0) // Quest not started at all... { OpenStore("supplies", GetFirstPC(), 0, 100); } if(iQuest >= 10) // She was found { if(iQuest != 40) // Not by Dantooine Twilek { OpenStore("supplies", GetFirstPC(), 0, 100); } } else { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); }[/hidden] Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 8, 2014 Share Posted September 8, 2014 Type mismatch in parameter 1 of "openStore" function .... That makes no sense at all ... Try to change it to: OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100); Link to comment Share on other sites More sharing options...
CaptainPike Posted September 8, 2014 Author Share Posted September 8, 2014 You're revision, along with double-checking my LocRef in my .utm file (putting the word "supplies" there instead of what I had: "Ebon Hawk") resulted in an evidently successful compile. Lookup path root set to C:\SWKOTOR\ Loaded nwscript.nss from C:\SWKOTOR\override/ Compiling: k_pebn_kiosk.nss Total Execution time = 31 ms So now, I take it that I drop the script k_pebn_kiosk.nss and supplies.utm into the override folder, and it should work? Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 8, 2014 Share Posted September 8, 2014 You're revision, along with double-checking my LocRef in my .utm file (putting the word "supplies" there instead of what I had: "Ebon Hawk") resulted in an evidently successful compile. So now, I take it that I drop the script k_pebn_kiosk.nss and supplies.utm into the override folder, and it should work? Yes, and then it should be ready for testing. If you need a save nearby, then get the download from this link: http://deadlystream.com/forum/topic/826-game-savek1-taris-save-collection-2of2/ And use the last save, which will be placed right before your third Jedi Trial. Link to comment Share on other sites More sharing options...
CaptainPike Posted September 13, 2014 Author Share Posted September 13, 2014 Still not working. I've looked over the script and noticed that all, except one line has two symbols (==, !=, etc) except this one: int iQuest = GetJournalEntry("k_pebo_stowaway"); I'm assuming that line is correct b/c this is assigning a value to a variable rather than checking values against each other; Am I correct in assuming this line is correct? ----------------------------------------------------------------- I have the following files in my "override" folder: k_pebn_kiosk.nss; and supplies.utm; That's all that's needed there; Correct? Link to comment Share on other sites More sharing options...
CaptainPike Posted September 13, 2014 Author Share Posted September 13, 2014 I determined through testing that what actually seems to trigger the script to "investigate the supplies more closely" is a quest called "Dwindling Supplies" with 10 being the value held when Zaalbar tells us that supplies are dwindling. I then decided that the entire script could be condensed to something like: Show spoiler (hidden content - requires Javascript to show) void main() { int iQuest = GetJournalEntry("<variable>"); if(iQuest != 10) // (* value where the supplies need investigated *) { OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100); { else { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); } } (and yes, my brackets are probably completely off ... ) Thing is, I noticed your statements were looking for k_pebn_stowaway; so I went searchng for the correct value etc. for <variable>. I can't fiind k_pebn_stowaway in the list of variables? I did, however, find a variable called Ebo_Sasha_State. Where did k_pebn_stowaway come from? (... but none of this seems to explain why the modifications aren't working ... ) Link to comment Share on other sites More sharing options...
Fair Strides 2 Posted September 13, 2014 Share Posted September 13, 2014 I determined through testing that what actually seems to trigger the script to "investigate the supplies more closely" is a quest called "Dwindling Supplies" with 10 being the value held when Zaalbar tells us that supplies are dwindling. I then decided that the entire script could be condensed to something like: Show spoiler (hidden content - requires Javascript to show) void main() { int iQuest = GetJournalEntry("<variable>"); if(iQuest != 10) // (* value where the supplies need investigated *) { OpenStore(GetObjectByTag("supplies"), GetFirstPC(), 0, 100); { else { ActionStartConversation(GetLastUsedBy(), "", 0, 0, 0, "", "", "", "", "", "", 0); } } (and yes, my brackets are probably completely off ... ) Thing is, I noticed your statements were looking for k_pebn_stowaway; so I went searchng for the correct value etc. for <variable>. I can't fiind k_pebn_stowaway in the list of variables? I did, however, find a variable called Ebo_Sasha_State. Where did k_pebn_stowaway come from? (... but none of this seems to explain why the modifications aren't working ... ) Well, "k_pebn_stowaway" is the tag of the Sasha quest, hence the variable is the current index of that quest. Also, you need the .ncs file in the override folder, as the .nss does nothing for the game. Also, a helpful bit of formatting for your coding: If you have a void main(), then indent everything after the { by four spaces. For each conditional statement(if, else, while, for, switch/case), it is best to keep the original indent, but then do four more spaces inside the {}: Show spoiler (hidden content - requires Javascript to show) void main() { // indent four spaces for each line int iHelp = 1; if(iHelp == 1) // Keep original indent { // Indent four spaces inside the {} // Do something } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.