Newbie Spellweaver
- Joined
- Jul 2, 2015
- Messages
- 8
- Reaction score
- 0
hi,
I'm currently developing a simple pets imaging script.
In all this post, the pet SWF used is cat.swf.
To draw my pets, I just get the layers from the pet visualization.xml file:
so I get the images. In our case it'll be:
We don't need the layer id = 3 as it's the "emoticon" as called by habbo here:
I also get the x & y coordinates from cat_cat_assets.bin, In our case it'll be:
So here I have my cat and everything is OK. Except the colors!
So as we can see, our cat SWF contains a lot of .dat palette files. You can learn how to parse these files here
So here's a parsed palette (id = 8 as cat_palette_8.bin) file stored as an JSON file:
Now, my question is: what do I need to do with these colors? What color(s) I need to colorize what layer(s) ?
Thanks
I'm currently developing a simple pets imaging script.
In all this post, the pet SWF used is cat.swf.
To draw my pets, I just get the layers from the pet visualization.xml file:
Code:
[/COLOR]
[COLOR=#222222] <direction id="0"> <layer id="0" z="0"/> <layer id="1" z="10"/> <layer id="2" z="10"/> <layer id="3" z="11"/></direction>[/COLOR]
[COLOR=#222222]
so I get the images. In our case it'll be:
- cat_cat_64_a_0_0.png
- cat_cat_64_b_0_0.png
- cat_cat_64_c_0_0.png
We don't need the layer id = 3 as it's the "emoticon" as called by habbo here:
Code:
[/COLOR]
[COLOR=#222222] <layers> <layer id="0" tag="body"/> <layer id="1" tag="head"/> <layer id="2" tag="tail"/> <layer id="3" tag="emoticon"/></layers>[/COLOR]
[COLOR=#222222]
I also get the x & y coordinates from cat_cat_assets.bin, In our case it'll be:
Code:
[/COLOR]
[COLOR=#222222] <asset name="cat_64_a_0_0" usesPalette="1" x="14" y="22"/>[/COLOR]
[COLOR=#222222] <asset name="cat_64_b_0_0" usesPalette="1" x="5" y="18"/>[/COLOR]
[COLOR=#222222] <asset name="cat_64_c_0_0" usesPalette="1" x="9" y="20"/>[/COLOR]
[COLOR=#222222]
So here I have my cat and everything is OK. Except the colors!
So as we can see, our cat SWF contains a lot of .dat palette files. You can learn how to parse these files here
So here's a parsed palette (id = 8 as cat_palette_8.bin) file stored as an JSON file:
Code:
[/COLOR]
[COLOR=#222222] [ "000000", "d10000", "d16854", "f2f2f2", "7f7f7f", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "000000", "555555", "4b4b4b", "414141", "383838", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "8e8e8e", "7e7e7e", "6f6f6f", "5f5f5f", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "6f6f6f", "5f5f5f", "555555", "4c4c4c", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "6f6f6f", "636363", "575757", "4b4b4b", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "8e8e8e", "7f7f7f", "6f6f6f", "5f5f5f", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "232323", "989898", "b7b7b7", "8e8e8e", "dadada", "dadada", "7e7e7e", "989898", "b7b7b7", "8e8e8e", "7f7f7f", "6f6f6f", "5f5f5f", "a3a3a3", "232323", "3a3a3a", "6e6e6e", "acacac", "4d4d4d", "747474", "9a9a9a", "232323", "7d7d7d", "b2b2b2", "e8e8e8", "5a5a5a", "979797", "d5d5d5", "232323", "777777", "b4b4b4", "f2f2f2", "777777", "b4b4b4", "f2f2f2", "bdbdbd", "dbdbdb", "f8f8f8", "bdbdbd", "dbdbdb", "f8f8f8", "5f5f5f", "767676", "8e8e8e", "ffffff"][/COLOR]
[COLOR=#222222]
Now, my question is: what do I need to do with these colors? What color(s) I need to colorize what layer(s) ?
Thanks