Aller au contenu

Photo

2DA and TLK editing via web interface


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
henesua

henesua
  • Members
  • 3 861 messages
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.

#2
Shadooow

Shadooow
  • Members
  • 4 465 messages
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...

#3
henesua

henesua
  • Members
  • 3 861 messages
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 .


#4
Shadooow

Shadooow
  • Members
  • 4 465 messages
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...

#5
henesua

henesua
  • Members
  • 3 861 messages
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 .


#6
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
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...

#7
henesua

henesua
  • Members
  • 3 861 messages
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 .


#8
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

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!

#9
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages

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 Image

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 .


#10
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#11
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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 .


#12
henesua

henesua
  • Members
  • 3 861 messages
Wow... thanks, Funky. This looks like It! Thank you very much.

#13
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Acaos isn't around, so I peeped the Makefile - this is all his doing, in case you haven't concluded as much already. :P It uses perl, just so you know. More when I hear from him.

Funky

#14
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Acaos got back to me while I was out:

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

Funky

#15
henesua

henesua
  • Members
  • 3 861 messages
thank you very much, Funky.

#16
Tarot Redhand

Tarot Redhand
  • Members
  • 2 670 messages
I don't often look in so missed this earlier. If all that you wanted to do had been to display a 2da file in a table on a web page I would have suggested you use my 2da-csv from my silly little utilities project as that is one of the things it enables. It can (amongst other things) convert (without affecting the original) a 2da file into an html file with the 2da data  in a table.

TR

#17
henesua

henesua
  • Members
  • 3 861 messages
Nope. Thats not it, Tarot. Scroll up and look at what Funky is offering. That is exactly what I was asking for. I thought I would have to build it for myself so that is why asked for the two pieces I would need to build it for myself. Nevertheless, Funky pointed me in a direction that would give me everything I wanted.

Thanks.

#18
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Should hunt down elven too. His library is very cool at how it deals with all the formats.

I think most PW admins have something like that eventually, hard part is that usually it's not something done so it's portable. ( Dex had it as well, even let you see your character sheet and how many times you were killed, but it was all in CFML and never got it all into PHP )

Modifié par painofdungeoneternal, 09 septembre 2013 - 11:53 .