Sign in to follow this  
JayDominus

Scripts and text strings

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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).

  • Like 1

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this