Author Topic: Conversation Standard Tokens in 2DA, TLK, hardcoded?  (Read 584 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« on: April 14, 2011, 10:45:23 pm »


               Where are the standard conversation tokens stored?

I know how to access them in the conversation tool. What I want to know is how the engine resolves these tokens. Are they stored in a 2DA? The TLK? Or are they hardcoded? Does anyone know?

And yes I know how to set up custom tokens via script - thats not the question here. If you know where the standard tokens are stored, please let me know.

Thanks.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #1 on: April 14, 2011, 10:56:21 pm »


               The String is in Dialog.tlk  the StrRef Number for each token is in stringtokens.2da
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #2 on: April 14, 2011, 11:32:50 pm »


               THANKS!

so we can create new ones in a custom tlk file and a custom 2da. very nice. I wonder why I missed stringtokens.2da. I'll give it another look. I might not have extracted that one.
               
               

               


                     Modifié par henesua, 14 avril 2011 - 10:33 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #3 on: April 14, 2011, 11:46:48 pm »


               I do not know if you can create new ones or not.  At least if you can I have no idea how at the moment.  It would be simpler to just script new ones useing the SetCustomToken scripting function.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #4 on: April 15, 2011, 12:35:12 am »


               it'll be an experiment.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #5 on: April 15, 2011, 01:02:59 am »


               Yes you can create new tokens, I did it for czech nwn community to allow language inflection. But it has few limitation stringtokens.2da doesn't work in hak packs, in order this to work player must have it in his override.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #6 on: April 15, 2011, 02:19:03 am »


               Are you saying that you can create new Tokens like feline/canine  Or  vampire/wolf.   Or just modify the one that are already there?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #7 on: April 15, 2011, 02:25:01 am »


               the first, I made a special </a> token (he -> +"" she ->+"a") and FirstName1 up to FirstName9 that showed a direct line from dialog.tlk
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #8 on: April 15, 2011, 03:40:39 pm »


               Thanks for the additional information, ShaDoOoW.

I'm not excited by the possibility of using override files though. Seems more of a thing for a PW than what I am working on.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #9 on: April 15, 2011, 09:12:31 pm »


               Well I didnt provided much of usefull really and I don't even know much more about this 2da. It seems to be quite hardcoded I just used a copy&paste and testing when I was making my own tokens.

I needed to do only token that shows one direct line from TLK and gender-like token so it was pretty easy.

From what I figured:

Token collumn is a string that must be put into < and > in order to get the token to working.

ActionCode collumn is hardcoded and does refer to various 2da or hardcoded checks depending on values:
Seems that value of 1 is "gender-check" that shows StrRef1 for male and StrRef2 for female, and maybe StrRef3/4 for Both/None:?
Value of 2 and 3 seems to work as a no-check that shows StrRef1 for all characters. I didnt used other vales most of the rest of them is bound to 2das, it seems that 5 and 6 are race-checks that are bound into racialtypes.2da etc.

Collumn Default is used maybe if the check for anything returns -1 which is not in given 2da/or anything? Seems not used anyway.

collumn Category? I dont have a clue, I think its unused, I put there 0 and it worked fine.

If you want to show a direct line from a TLK without any check, you can use either ActionCode of 2, or 3 and then StrRef1 to TLK line OR just use ActionCode of 1 and then put the same tlk line into all StrRefs.

If you want to show something different for male and female just use ActionCode of 1 and then StrRef1 for male and StrRef2 for female.

This is what I added into stringtokens for the czech language unofficial translation.

58         FirstName1                         1            5180 112011      112011    112011    112011    0
59         FirstName2                         3            5180 112012      112012    112012    112012    0
60         FirstName3                         3            5180 112013      112013    112013    112013    0
61         FirstName4                         3            5180 112014      112014    112014    112014    0
62         FirstName5                         3            5180 112015      112015    112015    112015    0
63         FirstName6                         3            5180 112016      112016    112016    112016    0
64         FirstName7                         3            5180 112017      112017    112017    112017    0
58         FullName1                          1            5180 112018      112018    112018    112018    0
59         FullName2                          2            5180 112019      112019    112019    112019    0
60         FullName3                          2            5180 112020      112020    112020    112020    0
61         FullName4                          2            5180 112021      112021    112021    112021    0
62         FullName5                          2            5180 112022      112022    112022    112022    0
63         FullName6                          2            5180 112023      112023    112023    112023    0
64         FullName7                          2            5180 112024      112024    112024    112024    0
72 i/y 1 -1 3159 3151 -1 -1 0
73 el/la 1 -1 112026 112027 -1 -1 0
74 y/a 1 -1 112028 112029 -1 -1 0
75 sam/a 1 -1 112041 112042 -1 -1 0
76 /a 1 -1 -1 3119 -1 -1 0

In order to allow language inflection, I changed all lines in dialog.tlk where was FirstName or FullName into one of these. The values on line 72 (which should be 65 but it doesnt matter) and below were for additional differences in words for male/female my language have.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Conversation Standard Tokens in 2DA, TLK, hardcoded?
« Reply #10 on: April 15, 2011, 09:15:20 pm »


               So when Im thinking about it now after I recheck my old research I don't think that something like vampire/lycan> would be possible. But if you would added vampire and lycan into racialtypes.2da then <race> and <Race> could work, provided that a script that checks for the vampire/lycan race is is done on that conversation line

Or just use <CUSTOMX> with conjustion with script. I dont think that stringtokens are really usefull in any way for a custom content.
               
               

               


                     Modifié par ShaDoOoW, 15 avril 2011 - 08:19 .