JayDominus 5 Posted December 28, 2019 I stumbled upon a script that injects some text lines into the dilaogue. The lines are all written inside the script itself. As far as I can tell, KotOR scripts are very unkind to non-Latin letters and when I try to replace it with some cyrillic text... well, the sucker just won't compile. My question is: is it possible to add new strings to the .TLK and then modify the script so it refers to those strings instead? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 28, 2019 13 minutes ago, JayDominus said: I stumbled upon a script that injects some text lines into the dilaogue. What script is that? That is not a script function that I am aware of. Quote Share this post Link to post Share on other sites
JayDominus 5 Posted December 28, 2019 13 minutes ago, DarthParametric said: What script is that? That is not a script function that I am aware of. k_pkor_pillar01.ncs from korr_m39aa_s.rim Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 28, 2019 Ah, custom string tokens, I forgot about those. You could try using the GetStringByStrRef function: // 239: Get a string from the talk table using nStrRef. string GetStringByStrRef(int nStrRef); So the amended script would look something like: case 13: string1 = GetStringByStrRef(123456); break; You'd presumably want to use TSLPatcher to add the new strings via an append.tlk and then have it dynamically inject the StrRefs into the script source via memory tokens and compile it during the install. The TSLPatcher manual covers all this. It's actually odd that they didn't do something like that themselves, since the game was multilingual from the start (that's the entire point of the TLK setup). 1 Quote Share this post Link to post Share on other sites
JayDominus 5 Posted December 28, 2019 2 hours ago, DarthParametric said: You'd presumably want to use TSLPatcher to add the new strings via an append.tlk and then have it dynamically inject the StrRefs into the script source via memory tokens and compile it during the install. The TSLPatcher manual covers all this. I don't really need that since my translation work has an all-new TLK included. I was thinking about just including the .tlk and a modified version of this script (since I don't know any mod that does any changes to the Towers of Hanoi puzzle anyways). I dunno if it's just my inexperience or is this script weird, but when I extract it, load it up in KSE, save it as an .nss and try to compile it back without any changes, it refuses to do so, displaying a syntax error. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted December 28, 2019 This compiles, but you'll need to edit the placeholder StrRefs to their proper values. k_pkor_pillar01.nss 1 Quote Share this post Link to post Share on other sites
JayDominus 5 Posted December 28, 2019 32 minutes ago, DarthParametric said: This compiles, but you'll need to edit the placeholder StrRefs to their proper values. k_pkor_pillar01.nss 1.75 kB · 0 downloads Jumpin' Jesus on a pogo stick, it works like an absolute charm! Thank you a thousand times! Quote Share this post Link to post Share on other sites