Standalone avatar image generator + JavaScript Closets [Rev35]

Page 1 of 3 123 LastLast
Results 1 to 15 of 40
  1. #1
    Hardcore Member Tsuka is offline
    MemberRank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Standalone avatar image generator [R63]

    Standalone avatar image generator + JavaScript Closets [Rev35]
     

    Is there a demand for now I do'nt know but, it was released because I almost completed.
    I hope you will find it helpful.

    Is not dependent on the generator of official server, I made a generator of complete standalone.
    It works by using the GD library in PHP.
    It is extracted from SWF of revision 63 figure image used for resource.

    use image cast revision: LASTEST



    * This JavaScript is one of the use cases. To use the PHP code that is distributed, must be incorporated into the code yourself.

    Habbo Standalone Avatar Generator | HABOX LABS


    Update

    * need first run "resourse_update.php".

    May.10.2015 / version 1.2.8 beta release
    - supports more options for part-generator
    - fixed alpha blend
    - fixed renderer for large size
    - fixed resource_update.php
    - fixed bugs (indicated by Jer)

    Apr.14.2015 / version 1.2.5 release

    - support R63 casts.
    - rewrite many code for processing speed. (successful to less than 100ms)
    - included swf dump tool "resource_update.php".
    Last edited by Tsuka; 10-05-15 at 11:08 AM. Reason: version 1.2.8 beta release


  2. #2
    Hardcore Member Tom Lammers is offline
    MemberRank
    Dec 2012 Join Date
    Westerzicht, ZeLocation
    144Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Nice! I'm going to put this on retroripper.com

  3. #3
    :joy: Jonteh is offline
    GammaRank
    Apr 2007 Join Date
    New York, USALocation
    3,372Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Needed something like this for a while. Hopefully someone can extract the r63 clothes for you so we can start using our own hosted avatars.

    Big ups, Tsuka - surprised you're still around. I remember using your customs and hotel views when I was 12 and 13. Being Japanese, I can see why you base your stuff around cars :P
    C# and PHP developer by night, guy being a dude by day.




  4. #4
    ☮ツヅ↓6☭ seanrom is offline
    True MemberRank
    Nov 2009 Join Date
    1,004Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Creds for the json structures? ^^

    I could extract from r63

  5. #5
    :joy: Jonteh is offline
    GammaRank
    Apr 2007 Join Date
    New York, USALocation
    3,372Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by oleaa View Post
    Creds for the json structures? ^^

    I could extract from r63
    Please do! This is probably one of the most worthwhile projects in the Habbo section right now.
    C# and PHP developer by night, guy being a dude by day.




  6. #6
    Registered anb505 is offline
    MemberRank
    Dec 2006 Join Date
    3Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Very nice project!

    I have a similar script who uses SWF and XML files. Its development is not finished yet so there are still some errors, but extraction from SWF works fine. If you need help I am available ;)

    Here is the thread of my project (on a French board):

  7. #7
    <insert title here> Shorty is offline
    Alpha MaleRank
    Feb 2007 Join Date
    United KingdomLocation
    1,859Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Holy fuck, can we all just take a moment to all hail Tsuka?

  8. #8
    "(still lacks brains)" NoBrain is offline
    Alpha MaleRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Jesus, that must have taken a while to do. Looks good



  9. #9
    not a DEVELOPER Droppy is offline
    DeveloperRank
    Feb 2012 Join Date
    /home/droppyLocation
    2,033Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Jesus Tsuka! Nice job you've maded in there! Each day we are progressing, and needing less of habbo resources!

    I'll open a oldskool and I'll embed this in register/image change (and make via RCON to exec the :poof command automactly)!

    Thanks a lot for this man!

    Disclaimer: I will never ask you for money for any purposes nor sell you game files (either inside or outside the forums).
    Subscribe | Rules
    PM Me | Add Me

    Developer
    &
    Ex-Moderator


  10. #10
    Hardcore Member Tsuka is offline
    MemberRank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by oleaa View Post
    Creds for the json structures? ^^

    I could extract from r63
    I wrote a program that automatically output unique JSON format... :P
    and performance problems, it might change in the method to read the XML directly.

    Now developing program that generates resources by automatically dump the SWF of R63.

    - - - Updated - - -

    Quote Originally Posted by anb505 View Post
    Very nice project!

    I have a similar script who uses SWF and XML files. Its development is not finished yet so there are still some errors, but extraction from SWF works fine. If you need help I am available ;)

    Here is the thread of my project (on a French board):
    good. similar project :D

    my project is likely take a long time, because I don't know the figure parts structure of R63.
    I'll unhurriedly analyzes... :P

  11. #11
    En Français? Bjork is offline
    True MemberRank
    Apr 2007 Join Date
    853Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    That's a very unique project, and interesting stuff here since a while! Nice work Tsuka :)
    Sorry for my bad English, I'm french ;)


  12. #12
    Account Upgraded | Title Enabled! PR0 is offline
    True MemberRank
    Mar 2007 Join Date
    1,199Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    TSUKA! Konnichiwa!

    Good to see you back on here :) This has made my day. I have no idea what this can be used for though because I'm a junior dev.

    Can anyone explain in noob-friendly detail with what this is for, what it does, and what it is used for?


    Thanks! !!!
    @Tsuka

    Hey so I check into your blogs that you have every once in a while and they always have the most unique development I can find on there! Can you give an update to some new and unique features you've made so far?

    That's a cool driving simulation setup you have too btw. haha.
    Last edited by PR0; 30-03-15 at 08:39 PM.
    Vivid imagination is key for building a successful game!

  13. #13
    Alpha Member Emily is offline
    Alpha MaleRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,398Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Tsuka, goddamn! I've always loved your resources and this is a very useful one. I can't thank you enough for this!
    We sail onwards. We don't know where we'll end up, but we'll go where the river takes us. Past everything we fought for, past all memories, onto something new. You'll be missed, my old friend, but it's time to part ways.

  14. #14
    Registered anb505 is offline
    MemberRank
    Dec 2006 Join Date
    3Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    @Tsuka: I can send you my avatar imager for the body parts if you want.

    I've written a little script to extract data from SWF files.
    Maybe it can help you or someone else to understand how SWF files are structured ;)

    Spoiler:
    PHP Code:
    <?php

    /**
     * Extraction of tags from SWF file
     *
     * @author Antoinee <anb505.spam@outlook.fr>
     * [MENTION=316612]Version[/MENTION] 0.0-20150804
     * [MENTION=585868]Lice[/MENTION]nse [url]http://opensource.org/licenses/MIT[/url] MIT License
     */

    define('INPUT_FILE''input.swf');
    define('OUTPUT_DIRECTORY''./output');

    chdir(__DIR__);

    function 
    swf_read_DefineBitsLossless2($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 7;

        
    // Assuming that BitmapFormat = 5
        
    $tag unpack('vsymbol_id/Cformat/vwidth/vheight'$raw_data);
        
    $data gzuncompress(substr($raw_data7));

        if (
    $tag['format'] != 5) {

            echo 
    "BitmapFormat = {$tag['format']}\tSkip this tag\r\n";
            return [];
        }

        
    $im imagecreatetruecolor($tag['width'], $tag['height']);
        
        
    imagefill($im000x7fffffff);

        for (
    $y 0$y $tag['height']; $y++) {

            for (
    $x 0$x $tag['width']; $x++) {

                list(, 
    $color) = unpack('N'$data);
                
    $data substr($data4);

                
    imagesetpixel($im$x$y$color);
            }
        }

        
    $tag['im'] = $im;

        return 
    $tag;
    }

    function 
    swf_read_SymbolClass($raw_data) {

        
    // Read the number of symbols
        
    list(, $number_of_symbols) = unpack('v'substr($raw_data02));

        
    $raw_data substr($raw_data2);

        
    // Read all symbols
        // for ($symbols = []; count($symbols) < $number_of_symbols; ) {
        
    for ($symbols = []; strlen($raw_data); ) {

            
    extract(unpack('vsymbol_id/Z*symbol_value'$raw_data));
            
    $symbols[$symbol_id] = $symbol_value;

            
    $raw_data substr($raw_datastrlen($symbol_value) + 1);
        }

        return 
    $symbols;
    }

    function 
    swf_read_DefineBinaryData($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 6;

        return 
    unpack('vsymbol_id/V/Z' $data_length 'data'$raw_data);
    }

    function 
    swf_extract($swf_file) {

        
    // Read SWF file
        
    $raw_data file_get_contents($swf_file);

        
    // Uncompress SWF data
        
    if (substr($raw_data03) == 'CWS') {

            
    $raw_data 'F' substr($raw_data17) . gzuncompress(substr($raw_data8));
        }

        
    // File length
        
    list(, $file_length) = unpack('V'substr($raw_data44));

        
    // Header length
        
    $header_length ceil(((ord($raw_data[8]) >> 3) * 3) / 8) + 4;

        
    // Output arrays
        
    $pngs = [];
        
    $xmls = [];

        
    // Read tags
        
    for ($cursor $header_length$cursor $file_length; ) {

            
    // Read tag header
            
    list(, $tag_header) = unpack('v'substr($raw_data$cursor2));
            
    $cursor += 2;

            list(
    $tag_code$tag_length) = [$tag_header >> 6$tag_header 0x3f];

            
    // Read long tag header
            
    if ($tag_length == 0x3f) {

                list(, 
    $tag_length) = unpack('V'substr($raw_data$cursor4)); // Must be signed!
                
    $cursor+= 4;
            }

            
    // Read tag body
            
    switch ($tag_code) {

                
    // DefineBitsLossless2
                
    case 36:
                    
    $tag swf_read_DefineBitsLossless2(substr($raw_data$cursor$tag_length));
                    
    $pngs[$tag['symbol_id']] = $tag['im'];
                break;

                
    // SymbolClass
                
    case 76:
                    
    $symbols swf_read_SymbolClass(substr($raw_data$cursor$tag_length));
                break;

                
    // DefineBinaryData
                
    case 87:
                    
    $tag swf_read_DefineBinaryData(substr($raw_data$cursor$tag_length));
                    
    $xmls[$tag['symbol_id']] = $tag['data'];
                break;
            }

            
    // Go to the next tag
            
    $cursor+= $tag_length;

            
    // Exit loop if End tag
            // $tag_code != 0 ? : break;
        
    }

        foreach (
    $xmls as $symbol_id => $xml) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.xml')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    file_put_contents(OUTPUT_DIRECTORY '/' $name '.xml'$xml);
        }

        foreach (
    $pngs as $symbol_id => $png) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.png')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    imagepng($pngOUTPUT_DIRECTORY '/' $name '.png');
        }
    }

    swf_extract(INPUT_FILE);

  15. #15
    Hardcore Member Tsuka is offline
    MemberRank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by anb505 View Post
    @Tsuka: I can send you my avatar imager for the body parts if you want.

    I've written a little script to extract data from SWF files.
    Maybe it can help you or someone else to understand how SWF files are structured ;)

    Spoiler:
    PHP Code:
    <?php

    /**
     * Extraction of tags from SWF file
     *
     * @author Antoinee <anb505.spam@outlook.fr>
     * [MENTION=316612]Version[/MENTION] 0.0-20150804
     * [MENTION=585868]Lice[/MENTION]nse [url]http://opensource.org/licenses/MIT[/url] MIT License
     */

    define('INPUT_FILE''input.swf');
    define('OUTPUT_DIRECTORY''./output');

    chdir(__DIR__);

    function 
    swf_read_DefineBitsLossless2($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 7;

        
    // Assuming that BitmapFormat = 5
        
    $tag unpack('vsymbol_id/Cformat/vwidth/vheight'$raw_data);
        
    $data gzuncompress(substr($raw_data7));

        if (
    $tag['format'] != 5) {

            echo 
    "BitmapFormat = {$tag['format']}\tSkip this tag\r\n";
            return [];
        }

        
    $im imagecreatetruecolor($tag['width'], $tag['height']);
        
        
    imagefill($im000x7fffffff);

        for (
    $y 0$y $tag['height']; $y++) {

            for (
    $x 0$x $tag['width']; $x++) {

                list(, 
    $color) = unpack('N'$data);
                
    $data substr($data4);

                
    imagesetpixel($im$x$y$color);
            }
        }

        
    $tag['im'] = $im;

        return 
    $tag;
    }

    function 
    swf_read_SymbolClass($raw_data) {

        
    // Read the number of symbols
        
    list(, $number_of_symbols) = unpack('v'substr($raw_data02));

        
    $raw_data substr($raw_data2);

        
    // Read all symbols
        // for ($symbols = []; count($symbols) < $number_of_symbols; ) {
        
    for ($symbols = []; strlen($raw_data); ) {

            
    extract(unpack('vsymbol_id/Z*symbol_value'$raw_data));
            
    $symbols[$symbol_id] = $symbol_value;

            
    $raw_data substr($raw_datastrlen($symbol_value) + 1);
        }

        return 
    $symbols;
    }

    function 
    swf_read_DefineBinaryData($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 6;

        return 
    unpack('vsymbol_id/V/Z' $data_length 'data'$raw_data);
    }

    function 
    swf_extract($swf_file) {

        
    // Read SWF file
        
    $raw_data file_get_contents($swf_file);

        
    // Uncompress SWF data
        
    if (substr($raw_data03) == 'CWS') {

            
    $raw_data 'F' substr($raw_data17) . gzuncompress(substr($raw_data8));
        }

        
    // File length
        
    list(, $file_length) = unpack('V'substr($raw_data44));

        
    // Header length
        
    $header_length ceil(((ord($raw_data[8]) >> 3) * 3) / 8) + 4;

        
    // Output arrays
        
    $pngs = [];
        
    $xmls = [];

        
    // Read tags
        
    for ($cursor $header_length$cursor $file_length; ) {

            
    // Read tag header
            
    list(, $tag_header) = unpack('v'substr($raw_data$cursor2));
            
    $cursor += 2;

            list(
    $tag_code$tag_length) = [$tag_header >> 6$tag_header 0x3f];

            
    // Read long tag header
            
    if ($tag_length == 0x3f) {

                list(, 
    $tag_length) = unpack('V'substr($raw_data$cursor4)); // Must be signed!
                
    $cursor+= 4;
            }

            
    // Read tag body
            
    switch ($tag_code) {

                
    // DefineBitsLossless2
                
    case 36:
                    
    $tag swf_read_DefineBitsLossless2(substr($raw_data$cursor$tag_length));
                    
    $pngs[$tag['symbol_id']] = $tag['im'];
                break;

                
    // SymbolClass
                
    case 76:
                    
    $symbols swf_read_SymbolClass(substr($raw_data$cursor$tag_length));
                break;

                
    // DefineBinaryData
                
    case 87:
                    
    $tag swf_read_DefineBinaryData(substr($raw_data$cursor$tag_length));
                    
    $xmls[$tag['symbol_id']] = $tag['data'];
                break;
            }

            
    // Go to the next tag
            
    $cursor+= $tag_length;

            
    // Exit loop if End tag
            // $tag_code != 0 ? : break;
        
    }

        foreach (
    $xmls as $symbol_id => $xml) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.xml')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    file_put_contents(OUTPUT_DIRECTORY '/' $name '.xml'$xml);
        }

        foreach (
    $pngs as $symbol_id => $png) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.png')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    imagepng($pngOUTPUT_DIRECTORY '/' $name '.png');
        }
    }

    swf_extract(INPUT_FILE);
    thats interesting.

    I also developed process of similar dump program before, but more of your code is light.
    I developing extract tool now using it.


    http://labs.habox.org/figuredata_dump.php



Page 1 of 3 123 LastLast

Advertisement