.TLK Files, How to use/create them and Why we should.
If you've tried opening my mod in the toolset without copying the stuff correctly, you might notice an error. That's because you're missing the .tlk file which should be in the tlk folder in the NWN2 folder along with the module folder where you put custom modules in. You need the tlk file because it's where my dynamic conversation lines are stored (the lines that give a custom name based on who's spawned in, and how they are feeling, etc..). If you run my mod without it you'll just get funny lines when you ask for a status update like "ranger" or "monk". That's because it defaults to the original NWN2 tlk file.
So what is the .tlk file? Basically it's just a file that contains numbers, and a bunch of text associated with those numbers. It'll look funny if you try opening it in notepad. When you set your mod to use a .tlk file, you can then use the text in your conversations. Try it now (you don't have to have a custom tlk file set up), by creating a new conversation, then when creating a new line in your convo, click edit string ref then type a number in. If you type in say 125366 you might get the line "Don't question me, not now - this is more than any of us were expecting." If you play the original NWN2 campaign, somebody says this line somewhere.
Why should we use tlk files for conversations? Why not just type it out like we do in class?
Well, what if you use a standard line repeatedly? Maybe you want all the merchants to say "Thanks for buying from me!" after the player talks to them. Well you could copy and paste that line in every merchant convo, or you could set it up in a tlk file, then just add the string ref in the conversation and bob's your uncle. Later, say you want to change that line to "Thanks for buying from me,
There are a few downsides: Because you're using the string refs, if you want to change lines completely you'll have to open up the conversation and set the new line. So when you merge tlk files, the string ref will most likely change so you'll have to go through your conversations and check to make sure they're referring to the right line, but once this has been done, you shouldn't have to change them again. You also can't change the tlk file from within the conversation editor in the toolset it self, so if you spot a mistake you'll have to do it in the tlk file. I think you lose the string ref or it doesn't save the changes if you edit the conversation from within the conversation editor.
So how do I create one? How to use it?
First download a tlk editor. I use this one located here. If you do use that one, remember to use TlkEdit2 and not TlkEdit otherwise you'll get a file that won't work with the mod. The editor itself is pretty self explanatory, just type in the boxes next to the line numbers.
Note: If you've got your mod open with the tlk file set, you won't be able to save your .tlk file in the editor. You'll have to get around that by either closing your toolset (not as desirable) or you could also do what I do which is just have two versions, say fit1.tlk and fit2.tlk, then just save to the other one that is not set in my module. So if my mod has fit1.tlk, I save to fit2.tlk. When i need to try it out, I set the mod to fit2.tlk then test. when I'm done, make any changes in the editor and save to fit1.tlk and repeat. It's annoying but better than closing and opening the toolset repeatedly (which we also know isn't the most stable of all creatures.)
So in conclusion, tlk files are awesome, and you should use them. (this is mainly directed at nick and estelle since they are doing the conversations but programmers should take note of this as well since you'll need to be able to look into talk files for custom token numbers).
A short note on Custom Tokens
If you look into my tlk file or mod, you'll notice things like SetCustomToken() function like so
SetCustomToken(201, "Magic"); After that script has been run, whenever a conversation has the tag
Note that NWN2 uses the first 50 or so tokens so to be on the safe side, start at about 100 or so.
So for the folks doing conversations, consider using custom tokens to make your conversations more dynamic and varied.
just letting you know that i have read it and although its sounds like a good idea im more than happy to copy and paste different conversations many times. i have writeen most of the conversations down on a piece of papaper so i always have something to refer to, and im not sure if this is me being lazy but i think it would be easier for me if i were to just copy and paste, but also i dont want it to be too repetative otherwise it will look like we are being lazy so instead of having everyone say "thank you for buying from me" you can miz it up by having some saying "thanky you and take care" or "godspeed" or "may the gods shine upon you" or some shit like that. i dunno ill talk to you about in games studio
ReplyDelete