[Release] D2TxtImporter - Automatic Documentation Generation

This would be the forum for questions about how to work with mod making tools which can be a problem of its own.

Moderator: Paul Siramy

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

[Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Sat Dec 07, 2019 5:33 pm

I have for a while now worked on a project for automatically documenting Diablo 2 mods. I have never made a mod myself, but I have played plenty and the lack of documentation for many of them have infuriated me many times. After a little talk with the creator of the mod Diablo II Enriched (Ascended1962), I started working on this project.

Output Example
Image

Information:
  • The import part of it is very very strict regarding your .txt files. You may have to update them a bit to follow these standards, it should not have any impact on your mod what so ever. A message will be displayed if there are any issues.
  • An example of the output can be downloaded on github. This output is 100% auto generated from 1.13c.
  • A guide can be found on the github page.
  • The output website can be opened directly from the .html file, so feel free to ship it along with your mod or publish it to a web server.
  • Credit where credit is due and if you feel like buying me a cup of coffee (when I get it working of course) I have added a donate button to the github page, since I spend more time on this than I care to admit.
Todo:
  • I have not implemented all output for Item Properties, as I have only had the vanilla .txt files for 1.13c to work with, so I need help testing and implementing the rest. If you manage to get an output search the output for "todo" and if there is a hit, it means that functionality is not implemented. Please open a github issue and provide adequate .txt and .tbl files for me to reproduce the problem as well as an example of how it is supposed to look and I will fix it.
  • Internet Explorer is a no go and I hate it with my entire body so the output works in Chrome and maybe other browsers.
  • You will probably find bugs along the way, please create issues for them on github with adequate information.
  • Cube recipes are not done. You should use the optional checkbox to use the Description instead and then write a proper description.
Release notes:
1.6
- Fixed exception handling bug
1.5
- Added option to continue running even when error occurs so you can debug all items in one go
- Added better exception handling when calculating per level item properties
- Fixed issue with replacing rune names for cube description
- Added better cube recipe generation
- Fixed All Resistance showed as Fire Resistance
1.4
- Added rune effects to runewords
- Added support for runewords with multiple types
- Fixed per level calculation
1.3
- Lessened json output again
- Fixed searching in set items on the website
- Added proper exception handling when using description for cube recipes
- Fixed Runes were displayed with the Rune affix on the website
- Using translation for items
- Fixed colors of set items on the website
- Added error log file. Cleaned up error output
- Fixed coloring of runes on website
1.2
- Added way better exception handling.
- Added randclassskill<d> support, for example randclassskill5.
- Fixed an issue with damage not being displayed on a new line on the website.
1.1
- Fixed getting columns in .txt files by column name instead of index.
1.0
- Initial release

Source: https://github.com/Elmegaard/D2TxtImporter
Download: https://github.com/Elmegaard/D2TxtImporter/releases
Last edited by Elmegaard on Mon Dec 09, 2019 7:13 pm, edited 2 times in total.

User avatar
Sloth-
Posts: 6
Joined: Wed Jul 27, 2016 6:02 am
Argentina

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Sloth- » Sun Dec 08, 2019 1:38 pm

Good job! Thanks for taking the time to do this, it is very useful.

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Sun Dec 08, 2019 5:54 pm

Glad to hear that! Have you successfully gotten an output? I am looking for feedback for it, as I'm sure there are plenty of bugs that needs to be resolved.

Conqueror
Posts: 25
Joined: Mon Oct 23, 2017 8:03 pm

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Conqueror » Sun Dec 08, 2019 5:55 pm

I don't understand how it works: c

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Sun Dec 08, 2019 6:01 pm

Download the client version of the tool. Paste in the paths to your mod files, "Excel Directory" is the directory containing your .txt files. "Table Directory" is the directory containing your .tbl files. Then chose an ouput folder (where you want the output to go). Hit export and done deal. You now have a website exported that the players of your mod can use to browse your changes.

Conqueror
Posts: 25
Joined: Mon Oct 23, 2017 8:03 pm

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Conqueror » Sun Dec 08, 2019 8:20 pm

Ty, now I'm experiencing

Conqueror
Posts: 25
Joined: Mon Oct 23, 2017 8:03 pm

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Conqueror » Sun Dec 08, 2019 8:46 pm

I have this error:

Code: Select all

System.InvalidOperationException: El objeto que acepta valores Null debe tener un valor.
   en System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   en D2TxtImporter.lib.Model.ItemStatCost.CalculatePerLevel(String parameter, Nullable`1 op, Nullable`1 op_param, String stat) en E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Dictionaries\ItemStatCost.cs:línea 404
   en D2TxtImporter.lib.Model.ItemStatCost.PropertyString(Nullable`1 value, Nullable`1 value2, String parameter, Int32 itemLevel) en E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Dictionaries\ItemStatCost.cs:línea 230
   en D2TxtImporter.lib.Model.ItemProperty..ctor(String property, String parameter, Nullable`1 min, Nullable`1 max, Int32 index, Int32 itemLevel) en E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:línea 71
   en D2TxtImporter.lib.Model.ItemProperty.GetProperties(String[] properties, Int32 itemLevel) en E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:línea 83
   en D2TxtImporter.lib.Model.SetItem.Import(String excelFolder) en E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Items\SetItem.cs:línea 92
   en D2TxtImporter.lib.Importer.LoadData() en E:\Git\D2TxtImporter\D2TxtImporter.lib\Importer.cs:línea 57
   en D2TxtImporter_console.Program.<>c.<Main>b__0_0(Options o) en E:\Git\D2TxtImporter\D2TxtImporter.console\Program.cs:línea 18
   en CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   en D2TxtImporter_console.Program.Main(String[] args) en E:\Git\D2TxtImporter\D2TxtImporter.console\Program.cs:línea 12

:cry:

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Sun Dec 08, 2019 9:44 pm

You have an item with something that gives something per character level, which does not have the parameter field set. The popup message you are getting should have more information about which item it is. Post the entire errorlog.txt and it will make more sense. I have added some more debugging for this exact error for the next version.

Edit:
Here is the output I get when I force the error you just wrote:

Code: Select all

Message:
Could not get set properties for item 'Civerb's Cudgel' in SetItems.txt

Message:
Could not generate properties for property 'dmg/lvl' with parameter '8' min '' max '' index '0' itemlvl '13'

Message:
Nullable object must have a value.
This gives all the info you need to debug your code and it is obviously a bug in the mod. In this case, I know it's in SetItems.txt and the item is Civerb's Cudgel. The problem is the property "dmg/lvl" in this case and it is the first property of that item, as indicated by the index value "0". You have all the information right there to solve your bug.

Conqueror
Posts: 25
Joined: Mon Oct 23, 2017 8:03 pm

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Conqueror » Sun Dec 08, 2019 11:04 pm

Elmegaard wrote:
Sun Dec 08, 2019 9:44 pm
You have an item with something that gives something per character level, which does not have the parameter field set. The popup message you are getting should have more information about which item it is. Post the entire errorlog.txt and it will make more sense. I have added some more debugging for this exact error for the next version.

Edit:
Here is the output I get when I force the error you just wrote:

Code: Select all

Message:
Could not get set properties for item 'Civerb's Cudgel' in SetItems.txt

Message:
Could not generate properties for property 'dmg/lvl' with parameter '8' min '' max '' index '0' itemlvl '13'

Message:
Nullable object must have a value.
This gives all the info you need to debug your code and it is obviously a bug in the mod. In this case, I know it's in SetItems.txt and the item is Civerb's Cudgel. The problem is the property "dmg/lvl" in this case and it is the first property of that item, as indicated by the index value "0". You have all the information right there to solve your bug.
In original d2 'Civerb's Cudgel' have dmg/lvl with parameter '8' and min-max index 0.
I do'nt understand.

http://prntscr.com/q80ynb

:cry:

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Mon Dec 09, 2019 12:04 am

Yes, I just forced the issue by changing Civerbs to that. So the screenshot you sent is one of the things I'm working on. I don't have any .txt files that has an item that uses that kind of stat in-game, as it is not used in standard Diablo. If you can send me how it is supposed to look in game I can fix it for you.

User avatar
Darkquake
Posts: 52
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Darkquake » Mon Dec 09, 2019 4:39 pm

It doesn't like rep-dur being a range value rather than a set value.
"Could not generate properties for property 'rep-dur' with parameter '' min '10' max '12' index '2' itemlvl '84'"

Also an option to skip(and list) items that throw errors would be awesome. That way I could see what the outputs look like for the WIP/Bugged items without everything needing to be 100% perfect. Tool looks super promising though and I look forward to it saving me LITERALLY hundreds of hours :)
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Mon Dec 09, 2019 4:44 pm

I will look into the rep-dur problem, can you send me a full error log? You should have a file called errorlog.txt, that would help me.

I have considered the "skip" option to list all errors. I will check if it is possible with my current solution, it might require a bit of an overhaul, but I don't think so.

Glad you like it :)

User avatar
Darkquake
Posts: 52
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Darkquake » Mon Dec 09, 2019 5:32 pm

Of course here you go:

Code: Select all

Message:
Could not get properties for unique 'Siggard's Stealth' in UniqueItems.txt

Stacktrace:
   at D2TxtImporter.lib.Model.Unique.Import(String excelFolder) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Items\Unique.cs:line 95
   at D2TxtImporter.lib.Importer.ImportModel() in E:\Git\D2TxtImporter\D2TxtImporter.lib\Importer.cs:line 89

Message:
Could not generate properties for property 'rep-dur' with parameter '' min '10' max '10' index '2' itemlvl '84'

Stacktrace:
   at D2TxtImporter.lib.Model.ItemProperty..ctor(String property, String parameter, Nullable`1 min, Nullable`1 max, Int32 index, Int32 itemLevel, String suffix) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:line 99
   at D2TxtImporter.lib.Model.ItemProperty.GetProperties(List`1 properties, Int32 itemLevel) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:line 118
   at D2TxtImporter.lib.Model.Unique.Import(String excelFolder) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Items\Unique.cs:line 65

Message:
Nullable object must have a value.

Stacktrace:
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at D2TxtImporter.lib.Model.ItemStatCost.PropertyString(Nullable`1 value, Nullable`1 value2, String parameter, Int32 itemLevel) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Dictionaries\ItemStatCost.cs:line 155
   at D2TxtImporter.lib.Model.ItemProperty..ctor(String property, String parameter, Nullable`1 min, Nullable`1 max, Int32 index, Int32 itemLevel, String suffix) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:line 92

Seems like it was just expecting a value in the param rather than a min/max.
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Mon Dec 09, 2019 6:10 pm

I'm a bit unsure if that is correct behavior though. Am I supposed to use min/max or are you supposed to use the parameter field? :)

User avatar
Darkquake
Posts: 52
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Darkquake » Tue Dec 10, 2019 8:45 am

You can do either. The flat param input will super seed the min-max inputs, however either are valid. You can do the same thing with most if not all properties.
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Tue Dec 10, 2019 8:59 am

I see. I will make the change later then, for other parameters, I guess I will take it as people get issues with it, unless there is a list of properties I can do it for. I added the "continue on error" you were asking for in the latest version.

User avatar
Darkquake
Posts: 52
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Darkquake » Tue Dec 10, 2019 9:15 am

Should work with every property that only takes one type of value. Examples:

"enr" would work because it's only looking for one value type, whether it's param or min-max inputs it's still getting that value
"enr/lvl" would work because it's only looking for one value type.
"gethit-skill" wouldn't work because it's looking for multiple value types, it needs a skill#, %Chance and Level inputs
"dmg-pois" also wouldn't work because it's looking for multiple value types, it needs Length(Frames) and min-max inputs
Elmegaard wrote:
Tue Dec 10, 2019 8:59 am
...I added the "continue on error" you were asking for in the latest version.
Sweet :D
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Tue Dec 10, 2019 9:20 am

I'll take a look at it.

User avatar
Darkquake
Posts: 52
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Darkquake » Tue Dec 10, 2019 2:57 pm

Even using v1.6 and checking "continue on exception" it doesn't generate once it hits an exception.

Code: Select all

Message:
Could not get properties for unique 'Dashing Bolt' in UniqueItems.txt

Stacktrace:


Message:
Could not find property 'extra-light' parameter '' min '15' max '15' index '5' itemlvl '85' in Properties.txt

Stacktrace:
   at D2TxtImporter.lib.Model.ItemProperty..ctor(String property, String parameter, Nullable`1 min, Nullable`1 max, Int32 index, Int32 itemLevel, String suffix) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:line 34
   at D2TxtImporter.lib.Model.ItemProperty.GetProperties(List`1 properties, Int32 itemLevel) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Types\ItemProperty.cs:line 127
   at D2TxtImporter.lib.Model.Unique.Import(String excelFolder) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Items\Unique.cs:line 75



Message:
Value cannot be null.
Parameter name: source

Stacktrace:
   at System.Linq.OrderedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IComparer`1 comparer, Boolean descending)
   at System.Linq.Enumerable.OrderBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
   at D2TxtImporter.lib.Model.Unique.AddDamageArmorString(Item unique) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Items\Unique.cs:line 119
   at D2TxtImporter.lib.Model.Unique.Import(String excelFolder) in E:\Git\D2TxtImporter\D2TxtImporter.lib\Model\Items\Unique.cs:line 98
   at D2TxtImporter.lib.Importer.ImportModel() in E:\Git\D2TxtImporter\D2TxtImporter.lib\Importer.cs:line 133



It also spends a long time "hanging" without letting the user know it's working, not a problem just feedback.
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Tue Dec 10, 2019 3:33 pm

Huh, that is weird, I'll take a look. It worked when I was debugging it.

Yeah I kinda "forgot" to implement something that gave feedback on it loading since everything takes less than 0.3 seconds on the default .txt files so you don't even notice it. But I should implement that for sure.

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Tue Dec 10, 2019 5:18 pm

I just tested it with the client version of the tool and it seems to work fine with the "continue on error" checkbox. There are exceptions that it cannot show you even if it continues as they may happen later on in the same item for example, it is one exception per item I think currently. It could be that it is the last error you have as well.

User avatar
Darkquake
Posts: 52
Joined: Tue Feb 20, 2018 3:38 pm
Australia

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Darkquake » Tue Dec 10, 2019 5:33 pm

Removed the item to test if it was just that but it still doesn't work over other exceptions. All the ones I've seen personally have been related to using min-max instead of a set param, similar to the ones above.
I make things? I make things.
Image
https://www.moddb.com/mods/darkquake

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Tue Dec 10, 2019 11:00 pm

I see, I will try and take a look at the min max stuff.

User avatar
tmuhlhausen
Posts: 14
Joined: Sat Aug 24, 2019 6:43 pm
Canada

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by tmuhlhausen » Tue Dec 10, 2019 11:52 pm

Great job, looks promising. Much appreciated

Elmegaard
Posts: 22
Joined: Mon Nov 25, 2019 9:14 am
Denmark

Re: [Release] D2TxtImporter - Automatic Documentation Generation

Post by Elmegaard » Wed Dec 11, 2019 9:27 am

Glad you like it. Right now I still have a lot to do I think. I would very much like input on the output it generates to make sure everything is as it should be as well as implement the remaining missing functions.

Darkquake: I had an epiphany last night while I was falling a sleep. It makes sense why you are not getting all errors. I will take a look at it tonight.

Post Reply

Return to “Tools”