Author Topic: From 2da to TLK to WIKI  (Read 352 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
From 2da to TLK to WIKI
« on: September 15, 2012, 02:52:13 am »


               I am facing a problem which I have ignored until now:
After one makes changes to existing spells or feats or weapons or skills, the game documentation is no longer relevant which undermines the ability for players to make informed decisions about their characters or gameplay. To update the in game documentation is tedious. Rewriting a TLK is a chore. And generating additional documentation like a WIKI so that the information is available out of game is REALLY tedious.

Has anyone automated this process?

It seems to me that it would be possible to write a script (shell script not NSS) which would crawl thorugh the 2da and generate spell lists for the various classes, as well as create new TLK entries for spells (at least the headers of the spells). Then once the TLK is generated one could take that data and plug it into a wiki.

At present this is all theoretical for me. And I am wondering if I might as well just manually create the TLK entries for the changed spells, rather than try to write a script that will do it for me. BUT if anyone else has gone down the road of generating this kind of documentation directly from the game data with a script, I would like to know about it. I could use your help. My time could be better spent doing things other than data entry.

[Edit} and yeah this could have been put in tool developers, but... its also a custom content thing TLKs and 2das so... eh... this oughta be fine.
               
               

               


                     Modifié par henesua, 15 septembre 2012 - 01:56 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
From 2da to TLK to WIKI
« Reply #1 on: September 15, 2012, 05:08:55 am »


               I'd gone with the modified tlk table myself, and manually re-entered every single spell description into the custom tlk since I'd changed the spells to 3.5 compatible and wanted the changes to be acknowledged in game.

 It'd be easy enough to make a dynamic convo system to use in game that could parse the 2da to create a viewable full spell list using the 2da entries for both spell name and new spell descriptions.

 For out of game use, just make sure to copy/paste the new spells into a text file as you're going along, but failing that, you could loop the whole 2da, one class spell list at a time, and print the name and description to the log, copy/pasting it from there instead.

 I could slap together an example script for you, if you wanted.  It's be fairly simple to do.

Edit:  Here's the chat log 2da dump script.  Not sure if it'd work with the PRC spell lists without a TMI error, but it's fine with the vanilla list.

const int END_2DA = 839; // end of standard spells.2da list.
//// sclass is the class name from the spells.2da.  The names are case sensitive.
//// "Bard", "Cleric", "Druid", "Paladin", "Ranger", and "Wiz_Sorc".
void PrintSpellList (string sclass)
{
int i;

while (i < END_2DA)
   {
     if (Get2DAString("spells", sclass, i) != "")
         {
    PrintString ("----------------------------------------");
    PrintString (GetStringByStrRef (StringToInt (Get2DAString("spells", "Name", i))));
    PrintString (GetStringByStrRef (StringToInt (Get2DAString("spells", "SpellDesc", i))));
         }
      i++;
    }
}
               
               

               


                     Modifié par Failed.Bard, 15 septembre 2012 - 04:35 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
From 2da to TLK to WIKI
« Reply #2 on: September 19, 2012, 02:50:49 am »


               Hey Failed Bard, this wasn't what I was looking for but this works fine. Thanks.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
From 2da to TLK to WIKI
« Reply #3 on: September 19, 2012, 03:59:36 am »


               A Long time agao when I was Still thinking about making some tools for NWN.  I made a command line tool for adding text to a .tlk file.   With what Faild Bard has you doing you may want to use it to add your modified text  back to the talk file.  

Now lets see if i can figure out how to link to my SkyDrive. 

https://skydrive.liv...AGfPRtxbnUc4g-U

Well That kind of did it.  'Posted

The source code  was lost in a hard drive crash.   So it was never polished up.  
Hope it helps.  L8
               
               

               


                     Modifié par Lightfoot8, 19 septembre 2012 - 11:00 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
From 2da to TLK to WIKI
« Reply #4 on: September 19, 2012, 09:43:38 am »


               I'll check out your tool when I get to that point. Thanks, Lightfoot8
               
               

               
            

Legacy_Just a ghost

  • Full Member
  • ***
  • Posts: 244
  • Karma: +0/-0
From 2da to TLK to WIKI
« Reply #5 on: September 19, 2012, 11:01:45 am »


               Dunno if you can do PHP, but I made a set of functions that can parse 2da files. It's on the vault.
http://nwvault.ign.c....Detail&id=1201

The tlk file is another matter, though.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
From 2da to TLK to WIKI
« Reply #6 on: September 19, 2012, 01:11:24 pm »


               To save yourself so agravation   You may want to take a quick Peek at it  

I set it up to read a text file in the text file would contain  text  wrapped in a bbcode style.  for example

[ a 500]  Text added to the talk file [ /a]  would add that text to line 500 in the text but would not overrite it if it already exsisted.  

[ d 501]  would delete line 500 from the talk file.  

Now I am guessing at theletters i used in the code.   ( At work and cant down load it.)  

Anything not wrapped with tags is ingnored by the tool.  

So if you copy and pasted this entire post to a text file and feed it to the tool, it would add line 500 and delete line 501 and ingnore everything else.