Salk 374 Posted June 27, 2016 Hello!I am in Manaan and while playing the Swoop Racing minigame, I am reminded of how useful it would be to have a chance of tweaking a little the record times (especially here in Manaan) to give more meaning to the "amateur", "semipro", "professional" racing class by making the time difference more prominent. I noticed how in the file k_inc_man there is this: int QUEEDLE_TIME = 3012; int CASSANDRA_TIME = 2702; int JAX_TIME = 2548; int CHAMP_TIME = 2348; Does anyone know whether or not this is what needs modifying? Is there something else I should be looking for?Thanks! 1 Quote Share this post Link to post Share on other sites
Kexikus 995 Posted June 27, 2016 It certainly.sounds as if it's what you're looking for. I'd just try it ;) Quote Share this post Link to post Share on other sites
Salk 374 Posted June 27, 2016 (edited) It certainly.sounds as if it's what you're looking for. I'd just try it ;) I would gladly try but I am unsure about how to proceed with it. It's a k_inc_* file... This same file has the following: void SetTokenRaceTime(int nToken, int nRacerTime) { // calculate the time components int nMinutes = nRacerTime/6000; int nSeconds = (nRacerTime - (nMinutes * 6000)) / 100; int nFractions = nRacerTime - ((nMinutes * 6000) + (nSeconds * 100)); //building the time string string sTime = IntToString(nMinutes) + ":"; if (nSeconds < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nSeconds) + ":"; if(nFractions < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nFractions); SetCustomToken(nToken,sTime); } I believe this part is what creates the actual CUSTOM tokens used in the swoop racing dialogues in Manaan. I should find the script that uses the function SetTokenRaceTime... But how do I find it? Edited June 27, 2016 by Salk Quote Share this post Link to post Share on other sites
Jorak Uln 458 Posted June 27, 2016 I would gladly try but I am unsure about how to proceed with it. It's a k_inc_* file... You might want to ask Fair Strides - hes the expert. Btw, im glad you try on these - vanilla swoop race is way too easy. For motivation, it would be cool to give special prizes like rare items etc. Quote Share this post Link to post Share on other sites
Kexikus 995 Posted June 27, 2016 I would gladly try but I am unsure about how to proceed with it. It's a k_inc_* file... This same file has the following: void SetTokenRaceTime(int nToken, int nRacerTime) { // calculate the time components int nMinutes = nRacerTime/6000; int nSeconds = (nRacerTime - (nMinutes * 6000)) / 100; int nFractions = nRacerTime - ((nMinutes * 6000) + (nSeconds * 100)); //building the time string string sTime = IntToString(nMinutes) + ":"; if (nSeconds < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nSeconds) + ":"; if(nFractions < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nFractions); SetCustomToken(nToken,sTime); } I believe this part is what creates the actual CUSTOM tokens used in the swoop racing dialogues in Manaan. I should find the script that uses the function SetTokenRaceTime... But how do I find it? I'm no expert but from what I can tell, this SetTokenRaceTime function takes the constants you posted earlier and translates them to the minute:seconds:fractions format the player sees and can interpret. So if you change the constants, the new race time should appear both in subtitles and as actual race time. As I said, just try to change one of them and see if the displayed race time changes. If it doesn't or somehow screws up the game you can always delete the modified ncs from your Override. Quote Share this post Link to post Share on other sites
Eauxps I. Fourgott 81 Posted June 28, 2016 IMO, the problem with trying to make the classes' differences more pronounced is the fact that you're running the exact same track with each one... Don't know how that would be fixed, though. Quote Share this post Link to post Share on other sites
Salk 374 Posted June 28, 2016 Kexikus, from the little I understand, I cannot make a .ncs file of the above .nss file. That's the problem... In theory, I could extract the whole scripts.bif file where k_inc_man.nss is, change it there and then replace the original scripts.bif in the /Data folder of the game but I wonder if it is even possible to repack extracted files into a new .bif? Alternatively, I would need to find the file in the game that does use the SetTokenRaceTime function included in k_inc_man.nss and change the time constants there. But the problem here is, what file is that? Quote Share this post Link to post Share on other sites
Kexikus 995 Posted June 28, 2016 But why? You'd just extract k_inc_man.nss, edit it and compile it to k_inc_man.ncs. Why wouldn't that work? Quote Share this post Link to post Share on other sites
Salk 374 Posted June 28, 2016 Fair Strides explains the reason here. In short, the k_inc_* files (from what I understand) are just libraries that are called by other scripts to allow for the use of extra functions. Compiling an include file does not produce anything. Quote Share this post Link to post Share on other sites
Kexikus 995 Posted June 28, 2016 Ah right, I remember. Then I'm out of ideas :/ Quote Share this post Link to post Share on other sites
Salk 374 Posted June 28, 2016 Let's see if Fair Strides might once more come to the rescue! Thanks for your help anyway though! Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted June 29, 2016 I don't check DS for two days and I've already counted my name mentioned about six times (plus I got something like 8 emails related to DS, though some were status related)... I'm at school but should be home tonight. Should be pretty easy to dig through the Manaan scripts and look for the code. I'll let you know what I dig up. ...And by the way, don't ask me to write a tutorial on how to find this stuff; I'm not sure I could actually explain it properly... :| 1 Quote Share this post Link to post Share on other sites
Salk 374 Posted June 30, 2016 I know you are busy and everyone needs your help, Fair Strides! Take your time and thanks again for your patience. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted June 30, 2016 From what I've been able to track down, it's most likely set in the area's OnEnter script, which won't decompile. What you could do instead is open up the Swoop organizer's (Sslamoth's) .utc file, man26_swpreg.utc in manm26ab. Set his OnDialogue script to something (for example, "salk_racers") and then make a new script with the following: void SetTokenRaceTime(int nToken, int nRacerTime) { // calculate the time components int nMinutes = nRacerTime/6000; int nSeconds = (nRacerTime - (nMinutes * 6000)) / 100; int nFractions = nRacerTime - ((nMinutes * 6000) + (nSeconds * 100)); //building the time string string sTime = IntToString(nMinutes) + ":"; if (nSeconds < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nSeconds) + ":"; if(nFractions < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nFractions); SetCustomToken(nToken,sTime); } void main() { int QUEEDLE_TIME = 3012; int CASSANDRA_TIME = 2702; int JAX_TIME = 2548; int CHAMP_TIME = 2348; SetCustomToken(18, QUEEDLE_TIME); SetCustomToken(19, CASSANDRA_TIME); SetCustomToken(20, JAX_TIME); SetCustomToken(21, CHAMP_TIME); } I say to use the OnDialogue event so that we know for sure the changes are in effect, since this will be set every time you talk to him. You can just adjust the times in the void main at this point, but remember how the times themselves are calculated. Quote Share this post Link to post Share on other sites
Salk 374 Posted July 1, 2016 I will gladly test this solution. Thanks for your suggestion! Quote Share this post Link to post Share on other sites
Salk 374 Posted July 4, 2016 Unfortunately the solution above did not work. I had to put the SetCustomToken second parameter between "" for making it even compile but other than that when I tested it nothing happens when I click to initiate the dialogue. Even if it *did* start the dialogue I was thinking that the script above would not do anything to actually change the record times since the function SetTokenRaceTime is never even called within the main function. Am I wrong? I suppose I should just drop this, although it irks me... Quote Share this post Link to post Share on other sites
Kexikus 995 Posted July 4, 2016 Yeah, I guess it should be SetTokenRaceTime that's called in the main function and not SetCustomToken. Then it would also work without the quotation marks since SetTokenRaceTime expects an integer as second parameter while SetCustomToken expects a String. The thing I'm wondering now is whether or not this will affect the actual racing times. This probably depends on where they are set but I would assume that it's not the same as the string token used for the dialog but another function in another script that takes the original integer constant and transforms it into some kind of time scale the game can handle. But testing that would be pretty easy once you get the script posted by FS to work (which it should with the change I described above). Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 4, 2016 Yes, it seems I was in a hurry... This should work: void SetTokenRaceTime(int nToken, int nRacerTime) { // calculate the time components int nMinutes = nRacerTime/6000; int nSeconds = (nRacerTime - (nMinutes * 6000)) / 100; int nFractions = nRacerTime - ((nMinutes * 6000) + (nSeconds * 100)); //building the time string string sTime = IntToString(nMinutes) + ":"; if (nSeconds < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nSeconds) + ":"; if(nFractions < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nFractions); SetCustomToken(nToken,sTime); } void main() { int QUEEDLE_TIME = 3012; int CASSANDRA_TIME = 2702; int JAX_TIME = 2548; int CHAMP_TIME = 2348; SetTokenRaceTime(18, QUEEDLE_TIME); SetTokenRaceTime(19, CASSANDRA_TIME); SetTokenRaceTime(20, JAX_TIME); SetTokenRaceTime(21, CHAMP_TIME); AssignCommand(GetFirstPC(), ActioNStartConversation(OBJECT_SELF)); } However I just took a moment to do some digging, and the conditional script that checks if you lost the race is 3400+ bytes (3.4+ KB) instead of the usual several hundred. Unfortunately, DeNCS fails to de-compile it. Looking at the byte code I don't think it could be an issue, but if it is, we're pretty much out of luck here. Quote Share this post Link to post Share on other sites
Salk 374 Posted July 4, 2016 Well, thanks for amending the script. I know it was a long shot but I do appreciate the effort to help. Thank you. Quote Share this post Link to post Share on other sites
Salk 374 Posted July 5, 2016 Like before, clicking on the Swoop organizer does not start any conversation and disrupts the successive interaction with object (no matter where I click, nothing happens). Quote Share this post Link to post Share on other sites
Kexikus 995 Posted July 5, 2016 In the latest version of FS' script it says ActioNStartConversation with a capital N where it should be a small n. If you haven't changed that it could be the reason. (Not sure why this line exists anyway^^) Also, where in the dlg did you put the script and are you sure it's named correctly? Quote Share this post Link to post Share on other sites
Salk 374 Posted July 5, 2016 Hello Kexikus! Yes, I noticed the typo. It wouldn't compile before changing to a non capital "n". The script is, as suggested by FS himself, been called by "OnDialogue" (so it is not in the .dlg file ) and must somehow disrupt things. Unfortunately I do not know enough to understand why it happens. The problem on my side is also that each time I want to mess with .utc files I need to change the DPI back to normal and reboot the system, making it for a very tedious process (Windows XP requires this reboot each time). Quote Share this post Link to post Share on other sites
Kexikus 995 Posted July 5, 2016 Oh right, OnDialogue is not in the dlg... Could have known that^^ Do you use a savegame where you've not been to the swoop area before when testing the script? Or maybe try and put the script in the very first line of his dlg instead (and remove the ActionStartConversation line). Quote Share this post Link to post Share on other sites
Salk 374 Posted July 5, 2016 I will experiment more. And yes, I am using a "clean" save game. Quote Share this post Link to post Share on other sites
Salk 374 Posted February 8, 2020 Hello! I resurrect my own old thread to report some news. First of all, I am now able to choose new record times to beat for the three tiers in Tatooine and Manaan. Said that, there is still something that I can't figure out. Namely how the original times are calculated by the game. Using Manaan as example we have the following record times: Queedle: 0:23:82 Casandra: 0:23:25 Hukta: 0:22:50 Queedle as Sector Champion: 0:22:48 But the formula we find in the include script shows this: int QUEEDLE_TIME = 3012; int CASSANDRA_TIME = 2702; int JAX_TIME = 2548; int CHAMP_TIME = 2348; void SetTokenRaceTime(int nToken, int nRacerTime) { // calculate the time components int nMinutes = nRacerTime/6000; int nSeconds = (nRacerTime - (nMinutes * 6000)) / 100; int nFractions = nRacerTime - ((nMinutes * 6000) + (nSeconds * 100)); //building the time string string sTime = IntToString(nMinutes) + ":"; if (nSeconds < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nSeconds) + ":"; if(nFractions < 10) { sTime = sTime + "0"; } sTime = sTime + IntToString(nFractions); SetCustomToken(nToken,sTime); } And according to this, the times should be: Queedle: 0:30:12 Casandra: 0:27:02 Hukta: 0:25:48 Queedle as Sector Champion: 0:23:48 which would be just what I wished it was from the very beginning. Records that would show a real gap between one Tier and the next one rather than a series of almost identical results. Somehow the game changes those times somewhere although I wouldn't know how and when exactly. Still, in my own SW: KotOR Upgrade, the times indicated above will be restored thus making the Swoop Racing a much more sensible kind of challenge. Cheers! 1 Quote Share this post Link to post Share on other sites