Any Way to expand InventoryTXT?

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Any Way to expand InventoryTXT?

Post by devurandom » Mon Jun 05, 2017 10:57 am

I was able to compile and direct replace InventoryTXT all working fine.
Attempted to add new (4)columns and BOOM!! :x game loaded but everything displayed by inventory was scrambled.


Is it possible to expand InventoryTXT without rewriting a gazillion other functions?
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: Any Way to expand InventoryTXT?

Post by Necrolis » Mon Jun 05, 2017 4:10 pm

devurandom" wrote:I was able to compile and direct replace InventoryTXT all working fine.
Attempted to add new (4)columns and BOOM!! :x game loaded but everything displayed by inventory was scrambled.
Inventory.txt is unique in that it is never used directly, the game looks up the appropriate record(s) and them memcpy's sections of them into a set of globals for later use.

devurandom" wrote:Is it possible to expand InventoryTXT without rewriting a gazillion other functions?
A gazillion? no, but you need to replace every reference that uses it, else you cannot alter the structure (cause the record size will change). The better way is to create a separate memory table from the same txt file (read the same txt but pass only the new columns, and save this as a different tanble to inventory.txt)
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Any Way to expand InventoryTXT?

Post by devurandom » Mon Jun 05, 2017 6:33 pm

Necrolis" wrote: The better way is to create a separate memory table from the same txt file (read the same txt but pass only the new columns, and save this as a different tanble to inventory.txt)
Very Interesting, thanks for sharing your wisdom!
:)
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Any Way to expand InventoryTXT?

Post by kidpaddle94 » Fri Jun 09, 2017 2:34 am

You can lookup how D2 handles levels.bin & leveldefs.bin for an example of this. Just be aware that you will run into problems with files that already have 256 (or 255?) columns in vanilla. Monstats and Skills for example.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Any Way to expand InventoryTXT?

Post by devurandom » Fri Jun 09, 2017 12:41 pm

Thanks for the tip, I'll see what I can do.
:)
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

Return to “Code Editing”