LightbulbDatabase Dye/Cloth ID discover collaboration

Posts 1–15 of 20 · Page 1 of 2
Database Dye/Cloth ID discover collaboration
I'm very busy this week. I decided I want you guys to work with me to discover how to get the Integer IDs of the Dyes and Cloths that have to be inserted in the tex1 and tex2 columns in the database (characters table).
For now I know that they have to be integers, that 0 is null (of course) and 1 is White.
If we can understand what to put, I can fix the dyes and cloths items.
Post down here your ideas etc.
Sorry again, but I'm very, very busy (buttsecs)!

Also, congratulations to myself as I was asked from the guys at MMOE to collaborate in the code porting to Linux! (not official yet I guess, but I'm sooo excited)
__________________________________________________ __________________________________________________ __________

We discovered that dyes/cloths IDs are hexadecimal, and that cloths need an extra 0 after the 0x.
The tex1 value is equal to tex2. The database only accepts integers.
I've already made the conversion class.

The problem is: the Dye item type isn't recognized by the server. Ideas? I'll check creepylava's repo, there was a discussion about this.
Congratulations I want help you so much but I can`t becouse I can`t code anything what need more copy and paste :P I can only in prv serv add new items, texturing , adding new monster and nothing more
I can only support you in the spiritual path
Hmm......

/2short
Well, in the dat16.xml file there is a list of all of the dyes. You can take any of the tex1 or tex2 values from one of the dyes, convert from hex to decimal and use that. although, if you do this, white (0x01FFFFFF) is 33554431. These values can be put into the tex1 and 2 columns and they do work.
Quote Originally Posted by rvanw9 View Post
Well, in the dat16.xml file there is a list of all of the dyes. You can take any of the tex1 or tex2 values from one of the dyes, convert from hex to decimal and use that. although, if you do this, white (0x01FFFFFF) is 33554431. These values can be put into the tex1 and 2 columns and they do work.
I was writing a comment about that, but I got ninjaed :3 Great job, I hope we could fix the dyes
How do you guys extract the XML files from the game? SWFTools? Swfdec?

I am currently extracting the XML chunks from the uncompressed game client and combine them to 3-4 larger XML files and it works like a charm but I figure you guys do it with some tool? Hence I got all the dye stuff in the Objects XML file ...

Code:
C:\rotmg\xml>perl extractXml.pl
Protips 1x
Regions 1x
GroundTypes 1x
Tutorial 1x
Objects 39x
processing Objects ...
processing Protips ...
processing Regions ...
processing GroundTypes ...
processing Tutorial ...
Code:
C:\rotmg\xml>perl combine.pl
Loading ./data/Objects_0.xml ...
Loading ./data/Objects_1.xml ...
Loading ./data/Objects_10.xml ...
Loading ./data/Objects_11.xml ...
Loading ./data/Objects_12.xml ...
Loading ./data/Objects_13.xml ...
Loading ./data/Objects_14.xml ...
Loading ./data/Objects_15.xml ...
Loading ./data/Objects_16.xml ...
Loading ./data/Objects_17.xml ...
Loading ./data/Objects_18.xml ...
Loading ./data/Objects_19.xml ...
Loading ./data/Objects_2.xml ...
Loading ./data/Objects_20.xml ...
Loading ./data/Objects_21.xml ...
Loading ./data/Objects_22.xml ...
Loading ./data/Objects_23.xml ...
Loading ./data/Objects_24.xml ...
Loading ./data/Objects_25.xml ...
Loading ./data/Objects_26.xml ...
Loading ./data/Objects_27.xml ...
Loading ./data/Objects_28.xml ...
Loading ./data/Objects_29.xml ...
Loading ./data/Objects_3.xml ...
Loading ./data/Objects_30.xml ...
Loading ./data/Objects_31.xml ...
Loading ./data/Objects_32.xml ...
Loading ./data/Objects_33.xml ...
Loading ./data/Objects_34.xml ...
Loading ./data/Objects_35.xml ...
Loading ./data/Objects_36.xml ...
Loading ./data/Objects_37.xml ...
Loading ./data/Objects_38.xml ...
Loading ./data/Objects_4.xml ...
Loading ./data/Objects_5.xml ...
Loading ./data/Objects_6.xml ...
Loading ./data/Objects_7.xml ...
Loading ./data/Objects_8.xml ...
Loading ./data/Objects_9.xml ...
Loading ./data/GroundTypes_0.xml ...
Code:
  <Object type="4096" Activate="Dye" Class="Dye" Description="{dye.clothing_description}" DisplayId="{dyes.Alice_Blue_Clothing_Dye}" SlotType="10" Sound="use_potion" Tex1="0x01F0F8FF" id="Alice Blue Clothing Dye">
    <Consumable></Consumable>
    <Item></Item>
    <Mask File="lofiObj3" Index="0x18" />
    <Soulbound></Soulbound>
    <Texture File="lofiObj3" Index="0x10" />
  </Object>
I open the XMLs in the server source using Visual C#.
Quote Originally Posted by Owlupus View Post
I open the XMLs in the server source using Visual C#.
Well that is great but not the way to obtain the XML from the client in the first place ... I was asking for the common method for doing that. I wrote my own parser that rips out the 20 (or so) XML junks from the unpacked client ... but there ought to be a more elegant way.
Quote Originally Posted by eth0nic View Post
Well that is great but not the way to obtain the XML from the client in the first place ... I was asking for the common method for doing that. I wrote my own parser that rips out the 20 (or so) XML junks from the unpacked client ... but there ought to be a more elegant way.
I use swftools:
Code:
swfextract --outputformat "%03d.xml" -b 1- <filename>
(some of the binary files are not xmls though)
You can find out the linkings with swfdump (-u switch).
So SWFTools? I thought there might be a more elegant way ... I guess I'll stick with my own parser ;-) Thank you!
Quote Originally Posted by eth0nic View Post
So SWFTools? I thought there might be a more elegant way ... I guess I'll stick with my own parser ;-) Thank you!
What's wrong with SWFTools? I check the file I want to extract, and extract it (or alternatively I can extract all the files and use grep to find what I want to).
Anyway that doesn't mean there are no other "more elegant" ways to do it, (I still don't understand what you mean by elegant, it does the job just as well if not better that you script) others probably use sothink swf debugger.
I am not familiar with how embedding files in .swf works ... i thought you can restore the original file names as well. If SWFTools is also only capable of ripping out the embedded data but not restoring the original files I can just stick with my own little script.

p.s.: I need the XML file in some nice format to use it with my own standalone client/bots ... having a random collection of files not knowing what objects/groundTypes/etc. are in what files is kind of pointless so I combine them to Objects.XML and GroundTypes.XML
Quote Originally Posted by eth0nic View Post
I am not familiar with how embedding files in .swf works ... i thought you can restore the original file names as well. If SWFTools is also only capable of ripping out the embedded data but not restoring the original files I can just stick with my own little script.

p.s.: I need the XML file in some nice format to use it with my own standalone client/bots ... having a random collection of files not knowing what objects/groundTypes/etc. are in what files is kind of pointless so I combine them to Objects.XML and GroundTypes.XML
So that's what you meant.. Obviously data embedded in swfs has no filenames, rather it has IDs, but you can find out what they are linked to with swfdump which is also part of the SWFTools package:
Code:
                exports 0001 as "kabam****tmg.assets.EmbeddedData_DyesCXML"
                exports 0002 as "kabam****tmg.assets.EmbeddedData_GhostShipCXML"
                exports 0003 as "kabam****tmg.assets.EmbeddedData_WillemTestingCXML"
                exports 0004 as "kabam****tmg.assets.EmbeddedData_EncountersCXML"
                exports 0005 as "kabam****tmg.assets.EmbeddedData_ForbiddenJungleCXML"
                exports 0006 as "kabam****tmg.assets.EmbeddedData_CandyLandCXML"
                exports 0007 as "kabam****tmg.assets.EmbeddedData_PermapetsCXML"
                exports 0008 as "kabam****tmg.assets.EmbeddedData_EquipCXML"
                exports 0009 as "kabam****tmg.assets.EmbeddedData_TutorialObjectsCXML"
                exports 0010 as "kabam****tmg.assets.EmbeddedData_GroundCXML"
                exports 0011 as "kabam****tmg.assets.EmbeddedData_TravisTestingCXML"
                exports 0012 as "kabam****tmg.assets.EmbeddedData_StaticObjectsCXML"
                exports 0013 as "kabam****tmg.assets.EmbeddedData_HauntedCemeteryCXML"
                exports 0014 as "kabam****tmg.assets.EmbeddedData_MountainsCXML"
                exports 0015 as "kabam****tmg.assets.EmbeddedData_TombOfTheAncientsCXML"
                exports 0016 as "kabam****tmg.assets.EmbeddedData_PlayersCXML"
                exports 0017 as "kabam****tmg.assets.EmbeddedData_OryxChamberCXML"
                exports 0018 as "kabam****tmg.assets.EmbeddedData_ShoreCXML"
                exports 0019 as "kabam****tmg.assets.EmbeddedData_OceanTrenchCXML"
                exports 0020 as "kabam****tmg.assets.EmbeddedData_TutorialScriptCXML"
                exports 0021 as "kabam****tmg.assets.EmbeddedData_MidCXML"
                exports 0022 as "kabam****tmg.assets.EmbeddedData_TextilesCXML"
                exports 0023 as "kabam****tmg.assets.EmbeddedData_MadLabCXML"
                exports 0024 as "kabam****tmg.assets.EmbeddedData_ProjectilesCXML"
                exports 0025 as "kabam****tmg.assets.EmbeddedData_HighCXML"
                exports 0026 as "kabam****tmg.assets.EmbeddedData_ForestMazeCXML"
                exports 0027 as "kabam****tmg.assets.EmbeddedData_AbyssOfDemonsCXML"
                exports 0028 as "kabam****tmg.assets.EmbeddedData_UndeadLairCXML"
                exports 0029 as "kabam****tmg.assets.EmbeddedData_ManorOfTheImmortalsCXML"
                exports 0030 as "kabam****tmg.assets.EmbeddedData_ObjectsCXML"
                exports 0031 as "kabam****tmg.assets.EmbeddedData_CaveOfAThousandTreasuresCXML"
                exports 0032 as "kabam****tmg.assets.EmbeddedData_SnakePitCXML"
                exports 0033 as "kabam****tmg.assets.EmbeddedData_MonstersCXML"
                exports 0034 as "kabam****tmg.assets.EmbeddedData_PetsCXML"
                exports 0035 as "kabam****tmg.assets.EmbeddedData_RegionsCXML"
                exports 0036 as "kabam****tmg.assets.EmbeddedData_LowCXML"
                exports 0037 as "kabam****tmg.assets.EmbeddedData_SpriteWorldCXML"
                exports 0038 as "kabam****tmg.assets.EmbeddedData_OryxCastleCXML"
                exports 0039 as "kabam****tmg.assets.EmbeddedData_TestingObjectsCXML"
                exports 0040 as "kabam****tmg.assets.EmbeddedData_TempObjectsCXML"
                exports 0041 as "kabam****tmg.assets.EmbeddedData_OryxWineCellarCXML"
                exports 0042 as "kabam****tmg.assets.EmbeddedData_PirateCaveCXML"
You can write a little script that reads the swfdump output, finds these lines, export the ids with swfexport and rename it. A simple bash script can do it with sed and/or awk..

If you are on windows then that sothink debugger or whatever can export these files as "kabam****tmg.assets.EmbeddedData_ObjectsCXML" e.g..

I don't think swftools is that bad, and it's simplier to make a little shellscript than a whole XML exporter that looks up the names of the files.
My XML exporter is like 5 lines ... and the joiner like 20 lines ... but now that I know that know about those ids I will write a wrapper ... thank you! That is what i was looking for. And I use perl ... no need for bash scripts, sed or awk :-P Thank you for pointing that possibility out!
@rvanw9 Thanks, that's exacly what I was looking for. May you indentify the exact format of the input value? 0xZZZZZ looks like Unicode Hexadecimal to me but I'm not sure, and as I'm currently without a pc (at work, writing from the iPhone and trying to convert these values with a DYI calculator lol) I can't check by myself. When I have this information I can convert it and add the tex1/2 element to the XML descriptors, to make the dyes/cloths items work.

EDIT: I tried to try to convert the Large Pinstripe Cloth tex1 value to int (0x4000000 to 67108864). It turned out to be 0x04000000 instead. Using 67108864 it works tho. Will try to see if the xml files I have should be corrected (or I could simply change all the tex values directly to int, this would be longer but would work).

EDIT2(swag): it looks like that all cloths (not dyes) need another zero after 0x. I've made the converting class, I'm working on the items behavior.
Posts 1–15 of 20 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

Need help?