The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TUTORIAL] Updating and/or Merging Arts & Tiledata to SA or HS
Author Message
Crusader
Master
**

Posts: 254
Likes Given: 7
Likes Received: 19 in 12 posts
Joined: Apr 2012
Reputation: 6

Erehwon New Hera

Post: #1
[TUTORIAL] Updating and/or Merging Arts & Tiledata to SA or HS
Special Thanks
- to Staticz that helped me to understand all these stuff and guided me through the russian Uofiddler+!
- Eriminator for the moral support XD

Programs Needed
- Uofiddler+
- Uofiddler
- Excel or Calc
- Mulpatcher
- A good text editor (I use EditPlus)
- A good Hex Editor (only for Animdata.mul)

With the new versions of Stygian Abysss and High Seas lots of people faced the problem to have their own muls not really compatible with the new ones, so use the new Features of the updated version is impossible.
Luckly, we can manage to 'merge' our files with the new version, in order to prevent the loss of mental sanity and precious time Smile
But...we can do that only with clients <= 7.0.8.2 because higer clients have a different structure of packets so we need to know a bit of theory:

Code:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 26, Pack = 1)]
       private unsafe struct OldLandData : LandData.IRawData
       {
           private uint       _Flags;
           private ushort     _TexID;
           private fixed byte _Name[20];
than items
old data
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 37, Pack = 1)]
       private unsafe struct OldItemData : ItemData.IRawData
       {
           private uint       _Flags;
           private byte       _Weight;
           private byte       _Quality;
           private ushort     _Miscdata;
           private byte       _Unk1;
           private byte       _Quantity;
           private ushort     _Animation;
           private byte       _Unk2;
           private byte       _Hue;
           private byte       _StackingOff;
           private byte       _Value;
           private byte       _Height;
           private fixed byte _Name[20];
new data
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Size = 41, Pack = 1)]
       private unsafe struct NewItemData : ItemData.IRawData
       {
           [MarshalAs(UnmanagedType.U8)]
           private TileFlag   _Flags;
           private byte       _Weight;
           private byte       _Quality;
           private ushort     _Miscdata;
           private byte       _Unk1;
           private byte       _Quantity;
           private ushort     _Animation;
           private byte       _Unk2;
           private byte       _Hue;
           private byte       _StackingOff;
           private byte       _Value;
           private byte       _Height;
           private fixed byte _Name[20];
So since the packets are larger compared with the previous oness the result is that everything we see in the game will disappear and map will become 'scrambled'.

But if we use the 7.0.8.2 client or below...we'll have no problem, and still we can offer a good updated shard. In any case we need to know something else:
Art.mul, Artidx.mul, Tiledata.mul 'till the ML version have indexes = 0x3FFF. Which means that u can have 16000 (around) items stored in your Art files and its Tiledata. The version Stygian Abysss doubled this index, such that the limit is now 0x7FFF, and with High Seas, the limit is even bigger, it arrives at 0xFFFF (and also, ofc, for the tiledata indexes)
[Image: 1.png]
So from now on, we will refer to the Art and tiledatafile with ArtML, ArtSA, ArtHS (and same for tiledata).

The idea is to completely copy the ArtML in the ArtSA or ArtHS. So we will keep our custom arts, we have no problem of compatibility and thus we have all the gargoyle/hs stuff at our disposal and a lot of new free space slots.
This guide is divided in 3 parts, because in order to merge the muls you have to first merge the ARTfiles (items) then the ArtLand (landfiles) and finally fix the Tiledata and the Animdata.

How to do this:
Open Uofiddler+ (it may requires the installation of other stuff like Centred+). Badly this program is in russian, but has very interesting features, in any case, just follow the screens:
Put as base files the HS or SA CLEAN installation, you can do it in settings:
[Image: 2.png]
Then go in items.

In here you should follow what my screens points:
[Image: 3.png]

And you will arrive here:
[Image: 4.png]
so, in the bottom left, put the path of your CUSTOM arts (artsml probably and remember to have also radarcol and tiledata in the folder) and press LOAD.

After a while you will see on the left side, the SA or HS Arts, and on the right side, your custom arts.
Now, select on the RIGHT side the first Artfile, then go in the end of artwindows (scroll down) and press shift and select the last (in order to select EVERYTHING) so, after some loading (wait a while), you'll have all you right side selected.
Now click on an item of the right side and the following menu will appear, choose to 'copy 2 to 1'
[Image: 5.png]
This will take a long while and will seems that the programm crashed, just wait faithfully and go bring your dog out.
When done, move your mouse in the LEFT side, RIGHT CLICK and SAVE like i show you below:
[Image: 6.png]
And the FIRST part is done.

Now, we need to import our custom Landtiles, so close Uofiddler+ and keep the new art.mul, artidx.mul, radarcol and tiledata (merged) in some folder.

Open Mulpatcher and Load your CustomArt and Tiledata.
go in Tiledata (M) and do Save MapTiles to TextFile.
Do the same for Tiledata (S). We'll need this later.
Now go in the Features Tab, and on the left side, under Extract, select Art(M) and click on "Start".
You'll be able to save all ur arts in bmp format in a folder, in bmp format...but, the problem is that we can't really use this bmp files, because bmp has no transparency, so...we have to delete everything we extracted.
"So, why we do that?" It's because of the file that Mulpatcher generates, it's a file that has inside all the Indexes of the extracted Landtiles and their image.
Now, close Mulpatcher and open Uofiddler. Load your custom files (the old ones again) and go in Landtiles.
Under Misc. (top right) click and choose "Extract as" selecting Tiff format.
Tiff format can manage transparency, so we will not have tiles that scrambles and lose details like the mulpatcher bmp ones.

Now we have all the tiles in tiff format in a folder and the txt file in another one. The idea is to use the MassImport Plugin of the UoFiddler to import all our Landtiles inside the Merged Artfile.
to do that we have to create a special file, but this would be long done one by one, and here we will use first the Editor that allows 'column selection' like this:

[Image: 7.png]

then paste the selected column in a excel/calc doc, that we will format in a certain way (according with Xml generated by the massimport) and should be something like this:

[Image: 8.png]

Once we finished that, let's copy all our columns in the calc to a new text file, and with "Find & Replace" we fix it in order to have the perfect format necessary to the MassImport Plugin:

[Image: 9.png]
(in this screen, i show how i imported the bmp files from mulpatcher, but it was my mistake...remember to import TIFF format files!)

If done and everything is perfect, we should open again Uofiddler, but putting in the proper PATH the merged arts file that we created before with the UoFiddler+, and then use the MassImport plugin to load inside all the Landtiles.
Remember that in this case the landtiles of the custom version will be written on the merged file, so, every Landtile of the SA/HS version will be overwrite, and not merged. If u want to do a 'merged version' (not suggested) you should extract the Tiff files also from the SA/HS art and move the indexes in a new index inside the txt file, keeping the indexes of the Custom ArtML in the same index and just shifting the indexes of the HS/SA.

So now our merged file contains the merged arts in both items and landtiles sides. But we need to add the tiledata instructions, otherwise they will be not showed properly and the map would appear 'scrambled'.
remember the Tiledata text files that i make you save last before? good. No we do it again (with different filename) for the HS/SA Artfile & tiledata.
So open mulpatcher, go in Tiledata(S) and Tiledata(M), save text files.
Open the Custom Text file of the Tiledata(s), copy everything.
Open the SA/HS text file of the Tiledata(s), select everything from the beginning to the index 0x3FFF (included) and PASTE. Save.
You don't have to do in Tiledata(m) because that Tiledata(m) has already 0x3fff indexes and didn't changed in the most recent versions, so it's ok.
Now, load ur merged tiledata in mulpatcher and load in Tiledata(s) and (m) the Merged txtfile that you just made.
Congratulation! Also your tiledata now is merged!


Third Part, Animdata.
Now, in SA and HS there are new items ofc and so also new item-animations. In order to merge your animdata with the last one you have to:
- Open the Hex Editor and load your custom MLAnimdata.
- Once it's opened, select all, and copy.
- Open now the HS/SA Animdata with the same Hex Editor
- Paste with Overwrite from the beginning of the file.
- Save.
Also ur animdata is now saved and merged.
Congratulation! Everything is done!
(This post was last modified: 04-02-2015 03:52 AM by Crusader.)
11-09-2013 01:07 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 6 users Like Crusader's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)