Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[Idea] Morrowind Tool Kit


InsanitySorrow
 Share

[Idea] Morrowind Tool Kit  

6 members have voted

  1. 1. Would you like to see this App for Morrowind

    • Yes Please
      5
    • No thank You
      1
    • Other [If you are unsure], please state
      0


Recommended Posts

In programming terms, it can read any Morrowind-ish encoded file (4-byte record, 4-byte length, 8-byte flags, 4-byte subrecord type, 4-byte sub len, n-byte sub data) and store it into a linked list, so you can iterate through the records, select by type if you wanted, and just go through a whole file (it takes a second or two to load Tribunal.esm, which is 10s of thousands of records) and do whatever you want with the data, in a simple format.

In simpler terms, it simplifies loading of ES* files by programs. It handles all the reading and interpreting, and leaves your program with a nice neat list of records and their subrecords.

Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

In programming terms, it can read any Morrowind-ish encoded file (4-byte record, 4-byte length, 8-byte flags, 4-byte subrecord type, 4-byte sub len, n-byte sub data) and store it into a linked list, so you can iterate through the records, select by type if you wanted, and just go through a whole file (it takes a second or two to load Tribunal.esm, which is 10s of thousands of records) and do whatever you want with the data, in a simple format.

In simpler terms, it simplifies loading of ES* files by programs. It handles all the reading and interpreting, and leaves your program with a nice neat list of records and their subrecords.

Ah .. tesSnip-ish :P
Link to comment
Share on other sites

Easy...

If you understand classes and lists, really. I'm going to change from linked lists to plain lists (from C++ list to C++ vector, I think is the equivalent), if it makes it work better. But essentially, to note every NPC out of a mod, this is the code:


Datafile thatFile;

thatFile.load("yourmod.esp");


foreach ( Record cRec in thatFile.records )

 if ( cRec.type == "NPC_" ) printf("Found an NPC!\n");

It doesn't do much, but it shows how simple the system can be. To get a particular record:
datafile.records[index]
For subrecords in a record, you could use this (prints everything):

Datafile thatFile;

thatFile.load("yourmod.esp");


foreach ( Record cRec in thatFile.records )

{

 printf("Type: %s\n", cRec.type);

 foreach ( Subrecord sRec in cRec.sub )

 {

 printf(" Type: %s\n Data: %s\n", sRec.type, sRec.data);

 }

}

I'm having a few issues with .Net trying to use Unicode (2-byte) characters for stuff, which ruins the files (the ESP format uses only 1-byte, as far as I've seen). That's only related to saving, though.

Loading works, except for subrecords with flags (I haven't figured out which have them and don't, so ATM they get prepended to the data).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...