Author Topic: 2DA and TLK editing via web interface  (Read 1968 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
2DA and TLK editing via web interface
« on: August 21, 2013, 05:00:59 am »


               I've recently joined a team of PW builders, and we are looking to build some web based tools for ourselves. Before we reinvent the wheel, I am wondering if other teams have done this and would be willing to share.

Wish #1:
Display of NWN data files (2DA and TLK) on a web page. 2DAs are text so this is easy, but it would be handy to have a 2DA parser that we can use in a web implementation and expand. TLK is not so easy as it is not pure text.

Wish #2:
Editing of NWN data files (2DA and TLK) via web interface, and an application to store edits in a versioning control system as well as write edits out to the file.

Anyone have projects that they'd be willing to share? I'd prefer to get them up on github and open source their development, but if you are willing to share with us we'll play by your rules.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #1 on: August 21, 2013, 06:05:15 am »


               Just a question: you want this to allow real time multi user accessing or for automatic changes in module? Because you need to distribute these changes to the clients which would need another tool. Not impossible either...
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #2 on: August 21, 2013, 06:35:21 am »


               This is not for real time changes to the module but to centralize the creation of documentation of rule changes on a PW. It also makes it easier for the team to work on rule changes together prior to exporting all of the changes to files for inclusion in HAKs.
               
               

               


                     Modifié par henesua, 21 août 2013 - 05:35 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #3 on: September 06, 2013, 12:52:56 am »


               Henesua, since nobody answered and I got skills to make this happen and I can also use a tool like this I plan to make the web-based 2DA editing tool.

It can be easily done via PHP and database with the option to generate 2DA output file. Versioning would be harder but the challenge is welcome. Not exactly sure when I start on this as I have other projects but I already thought it through.

Still leaving TLK alone...
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #4 on: September 06, 2013, 01:01:06 am »


               heh. cool. TLK and other GFF is the real trick, but I appreciate that you are putting this together.

Presently we are using mercurial CVS and I have TortoiseHG on my ubuntu box to plug into it. But none of that is using an application in a web browser to edit the files.

What I really want though is an application that can read a 2DA and a TLK and then generate the documentation. That is the holy grail for me. For example all of the spells also point to TLK entries describing the spell. It would be great to convert the TLK to text to store in a DB, and then when the DB is edited to change the TLK.
               
               

               


                     Modifié par henesua, 06 septembre 2013 - 12:03 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #5 on: September 07, 2013, 03:27:36 am »


               You can open 2da files in excel. If they are uploaded to skydrive you can then share them and edit them online.

Of course its always good to have a free option...
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #6 on: September 07, 2013, 03:40:04 am »


               Pstemarie, agreed but thats not the kind of feature that I am talking about. I want the web interface because it opens up the option to automate the creation of documentation of a custom ruleset rather than to create such a thing by hand.

Essentially if someone has the two tool I described above already made as a web application then I can also use them to generate the documentation that I want.

And it is this third thing - automation of documentation - that I really want. And the only difficult part of this for me is the TLK file. I'm not sure how to handle it as it is a binary file. If someone would share an application that converts a tTLK to text then we are cooking.
               
               

               


                     Modifié par henesua, 07 septembre 2013 - 02:41 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #7 on: September 07, 2013, 11:41:34 am »


               

henesua wrote...

Pstemarie, agreed but thats not the kind of feature that I am talking about. I want the web interface because it opens up the option to automate the creation of documentation of a custom ruleset rather than to create such a thing by hand.


Now that is something worth pursuing. Documentation is one of the most complex aspect of Custom Content. For me, I often get so involved in what I'm doing I plow on ahead then try to do the documentation afterwards... NOT FUN!
               
               

               
            

Legacy_painofdungeoneternal

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #8 on: September 07, 2013, 12:43:53 pm »


               

henesua wrote...

Pstemarie, agreed but thats not the kind of feature that I am talking about. I want the web interface because it opens up the option to automate the creation of documentation of a custom ruleset rather than to create such a thing by hand.

Essentially if someone has the two tool I described above already made as a web application then I can also use them to generate the documentation that I want.

And it is this third thing - automation of documentation - that I really want. And the only difficult part of this for me is the TLK file. I'm not sure how to handle it as it is a binary file. If someone would share an application that converts a tTLK to text then we are cooking.


Try never launcher. Not exactly what you are describing but it can get things out of game formats into text and mysql format. ( This program started as my toolbox for all the things i built to manage my PW so have a lot of features like this )

Open a TLK file ( either open file or drag and drop the tlk onto the file ).

Option 1, "extract SQL" menu under "Compare", saves text to a mysql dump.

( portion of created file from cep.tlk, not showing all 7000+ lines )

CREATE TABLE dialog (`dl_dlid` int(11)  default NULL,`LABEL` longtext default NULL,UNIQUE KEY  (`dl_dlid`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `dialog` (`dl_dlid`,`LABEL`) VALUES ('16807216', 'Community Expansion Pack');INSERT INTO `dialog` (`dl_dlid`,`LABEL`) VALUES ('16807217', 'Baseitems start here');INSERT INTO `dialog` (`dl_dlid`,`LABEL`) VALUES ('16807218', 'Trident*');INSERT INTO `dialog` (`dl_dlid`,`LABEL`) VALUES ('16807219', 'This simple weapon has its origins in the humble fishing villages on the coasts and inland rivers. Not your simple frogging trident though, this is a weapon of war -- its tines widely spaced and wickedly barbed.');INSERT INTO `dialog` (`dl_dlid`,`LABEL`) VALUES ('16807220', 'Base Damage: 1d8\\rBase Critical Threat: x2\\rBase Damage Type: Piercing\\rWeapon Size: Medium\\rFeats Required: Martial');
The above can get it so it's on the website.

Option 2:
The "Save All Entries" in the tlk editor ( you see it when you open the tlk file )

Create a folder for all the entires to go. This saves a single text file for each entry.

30000.en.upt  - this only supports english, but it's tlk id, language, then upt. I name it 30000.magicmissle.en.upt for example to keep track of it easier.

This file simply contains "Community Expansion Pack"

This is setup soas to merge things later on, but also works very well with svn type systems as it reduces things to plain text.

( to go the other way, go to build, select the "Merge Content" Button.

'Posted

It then traverses all the folders in the source folder which contain upt files, upd files, and raw resources, then saves content to the target folder, i've used this for managing custom content on a large PW and it's well tested, merging a lot of complex content, kaedrins for example, but this new interface is not perfected yet. Make sure the Target folder has nothing in it, since i rerun it i have it delete the folders content each time it's run. It can also let you choose to use custom tlk or dialog.tlk versions, name a custom tlk file, etc. )

( 2da's are dealt with using upd diff files, it also can extract a mysql dump but that does not deal with the problems of merging sets of 2da data )
               
               

               


                     Modifié par painofdungeoneternal, 07 septembre 2013 - 11:46 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #9 on: September 07, 2013, 03:45:10 pm »


               

henesua wrote...

And it is this third thing - automation of documentation - that I really want. And the only difficult part of this for me is the TLK file. I'm not sure how to handle it as it is a binary file. If someone would share an application that converts a tTLK to text then we are cooking.


We do this with letoscript, using a subversion repository for sharing. Take a look at the last letoscript in the sticky on Mass Editing and Datamining your Module in the scripting forum.

The overview: our dev environment uses VirtualBox, and can run any mod in our modules folder, using Lin (important for us because of our plugins). Acaos made it publicly available, here.

Our version also contains the repo, which saves files in subfolders in the NWN install. There's a folder for our custom hak, which also contains our documentation sections, another for the module, another for nwnx, and so on.  Someone wanting to make an edit simply modifies or creates a txt file in a given format in the appropriate folder. Here, for example, is ~/svn/hghak/doc/skill/bluff.txt:

Journal-Tags: skill_all

[doc]
{{ORANGE}}{{UND}}Bluff{{ENDUND}}{{END}}
- Can be used to lower the AB of an enemy, similar to how Taunt lowers AC. Bluff is used via the Taunt skill radial icon.
- The defender must make an opposed Concentration check; if it fails, its AB is lowered by the amount it failed the check by (to a maximum of -6) for 5 rounds.
- The {{PURPLE}}!opt tauntbluff{{END}} command toggles between Taunt and Bluff. The two cannot stack on the same target. As with Taunt, Bluffing is a free action.
.

[replace 8757]
Ability: Charisma
Requires Training: No.
Classes: All.

The character can make the outrageous or the untrue seem plausible. This skill encompasses acting, conning, fast talking, misdirection and misleading body language.

{{GOLD}}Bluff is used to lower the AB of an enemy, similar to how Taunt lowers AC. Bluff is used via the Taunt skill and the{{END}} {{PURPLE}}!opt tauntbluff{{END}} {{GOLD}}command toggles between them.

Check: The DC is a concentration check made by the target against the character's Bluff skill roll. It is a free action and considered an attack. If the Bluff is successful, the opponent suffers an Attack Bonus penalty equal to the difference between the bluff roll and the defender's roll (to a max of a -6 penalty) for 5 rounds.
Special: Bluff and Taunt penalties are not cumulative.
Use: Select Taunt skill and then target creature.{{END}}

{{GOLD}}This is a class skill for Shadowdancers in legendary levels.{{END}}
.



Note the replace 8757 bracket: that's the tlk table value, which it will swap that section (denoted by the single period on the line following) out for our custom tlk (the {{COLOR}} brackets are reformatted depending on what kind of file is being output - GOLD is for our custom edits). Using letoscript and text files like the one above, we're able to generate journal entries, tlk tables, and forum-formatted posts for our documentation, without having to re-type everything. Here's the final forum version containing that Bluff entry:

http://highergroundp...ummaries?page=1

So the tools you need - letoscript, and optionally NWNIAB, and svn, of course - have already been made publicly available, though it'll take some effort to shape them to the particulars of what you want. LMK if you have questions.

Funky
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #10 on: September 07, 2013, 03:49:36 pm »


               Sorry, early morning brainfart. The journal entries are done with letoscript; the tlk entries are processed with unix commands, which also output the .ls to be used for the journal entries. I'll ask acaos if he wants to share the particulars, as I'm still pretty noobish at lin.

Funky
               
               

               


                     Modifié par FunkySwerve, 07 septembre 2013 - 02:52 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #11 on: September 07, 2013, 04:02:21 pm »


               Wow... thanks, Funky. This looks like It! Thank you very much.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #12 on: September 07, 2013, 04:09:15 pm »


               Acaos isn't around, so I peeped the Makefile - this is all his doing, in case you haven't concluded as much already. '<img'> It uses perl, just so you know. More when I hear from him.

Funky
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #13 on: September 07, 2013, 10:38:27 pm »


               Acaos got back to me while I was out:

acaos: I use the xml tlk utilities, they were on the vault iirc

Funky
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
2DA and TLK editing via web interface
« Reply #14 on: September 09, 2013, 11:24:29 pm »


               thank you very much, Funky.