Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Website] Character Display for MapleStory v134

Junior Spellweaver
Joined
Dec 21, 2008
Messages
108
Reaction score
69
The top is in the bottom corner, so maybe that needs some fixing also
The tops are fine. It's only happening because your script doesn't understand one or more of the items it's trying to show. That's why there is no body. If the body was there, then the top would be in the right place. Again, I'm guessing it's probably being caused by a weapon that your character has that isn't supported by your script, but I could be wrong. If you let me know what item numbers that character has, then I can reproduce the problem and then fix it.

As for the hair, replace this folder with your other hair folder. It will fix it:
Code:
http://www.filedropper.com/hair_1

Basically, all I did was update the script to include hairBelowBody:
Code:
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/vector/@name"/>.x <xsl:value-of select="canvas[@name='hairBelowBody']/vector/@x"/>
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/vector/@name"/>.y <xsl:value-of select="canvas[@name='hairBelowBody']/vector/@y"/>
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/@name"/>.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@name"/>.x <xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@x"/>
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/@name"/>.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@name"/>.y <xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@y"/>

I have updated the links on the first post to include the hair fix.

If anyone finds any other items that do not display properly, please share so I can update it.
 
Last edited:
Experienced Elementalist
Joined
Jul 19, 2011
Messages
288
Reaction score
32
The tops are fine. It's only happening because your script doesn't understand one or more of the items it's trying to show. That's why there is no body. If the body was there, then the top would be in the right place. Again, I'm guessing it's probably being caused by a weapon that your character has that isn't supported by your script, but I could be wrong. If you let me know what item numbers that character has, then I can reproduce the problem and then fix it.

As for the hair, replace this folder with your other hair folder. It will fix it:
Code:
http://www.filedropper.com/hair_1

Basically, all I did was update the script to include hairBelowBody:
Code:
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/vector/@name"/>.x <xsl:value-of select="canvas[@name='hairBelowBody']/vector/@x"/>
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/vector/@name"/>.y <xsl:value-of select="canvas[@name='hairBelowBody']/vector/@y"/>
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/@name"/>.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@name"/>.x <xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@x"/>
default.hairBelowBody.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/@name"/>.<xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@name"/>.y <xsl:value-of select="canvas[@name='hairBelowBody']/imgdir/vector/@y"/>

I have updated the links on the first post to include the hair fix.

If anyone finds any other items that do not display properly, please share so I can update it.
Not sure which weapons they have. Also I noticed that there is a blank first line on each of the index.txt files, would that mess something up?
 
Junior Spellweaver
Joined
Dec 21, 2008
Messages
108
Reaction score
69
Not sure which weapons they have. Also I noticed that there is a blank first line on each of the index.txt files, would that mess something up?
It won't mess anything up, but I guess I may as well remove it to save one byte per file.

Here's my updates that I will be sharing within the next few days:

-hairBelowHead is fixed
-Some NX overalls and tops were not displaying properly, now they are!
-All NX weapons of ID 170+ were not working due to unique numbers, now they are!
-Deleted thousands on useless PNGs from the GD
-Removed unnecessary line at the top of every index.txt

I just want to test it a little more to make sure there are no more bugs! I would also like to get Mercedes ears working like iAkira mentioned.

Here's a couple samples. Imageshack cropped these into rectangles. they are actually 96x96 images.
Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums

Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums
 
Last edited:
Experienced Elementalist
Joined
Jul 19, 2011
Messages
288
Reaction score
32
It won't mess anything up, but I guess I may as well remove it to save one byte per file.

Here's my updates that I will be sharing within the next few days:

-hairBelowHead is fixed
-Some NX overalls and tops were not displaying properly, now they are!
-All NX weapons of ID 170+ were not working due to unique numbers, now they are!
-Deleted thousands on useless PNGs from the GD
-Removed unnecessary line at the top of every index.txt

I just want to test it a little more to make sure there are no more bugs! I would also like to get Mercedes ears working like iAkira mentioned.

Here's a couple samples. Imageshack cropped these into rectangles. they are actually 96x96 images.
Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums

Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums
As for mercedes ears, an idea would be to get the coordinates, and check for mercedes. Or if the server turns mercedes ears on/off, check for the toggle?
 
Junior Spellweaver
Joined
Dec 21, 2008
Messages
108
Reaction score
69
As for mercedes ears, an idea would be to get the coordinates, and check for mercedes. Or if the server turns mercedes ears on/off, check for the toggle?
I've got Mercedes ears working now for that job only. As for a toggle, I can add that to the admin panel in the CMS I'm working on. So after a little more bug testing, I will release the update.

I also realized that I was missing a couple of NEW skin colors, so I've added those also.

Edit: Also, I just fixed one small issue in my script with dual bow guns. The right one was displaying on top of the hand which is not supposed to happen. Taken care of.

Edit2: Here's 4 character I created to test several new things. As far as I know, pretty much everything is working. So I will probably post the new download links tonight or tomorrow morning. NX has been tricky, but I'm fairly confident that it is 100% done.

Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Junior Spellweaver
Joined
Dec 21, 2008
Messages
108
Reaction score
69
I couldn't find any more issues so as long as there are no major bugs mentioned here, I think this is my final GD release (at least for a while). It's working perfectly for me.

Now I Can finally get back to my MaplePress project in the dev section. I will be using this GD in that project and may update it again before I release MaplePress.

Here's a list of changes from my first release a few days ago:

New Additions
  • Mercedes Ears
  • All Skins
  • info_icons folder (updated)
Fixes
  • Dual Bow Guns Display
  • hairBelowHead coordinates
  • All NX Items
Maintenance
  • Removed thousands of useless PNG files
  • Cleaned indexes (not perfect)
Possible Future Updates
  • Update to latest GMS Version
  • Pet Support
  • Bug Fixes (none that I am aware of)
  • Cleaner indexes

Download (links in first post have been updated):
Code:
http://www.filedropper.com/gd
Code:
http://speedy.sh/6WBVn/GD.7z

And of course, all I can say is thank you Holthelper. :thumbup:
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
your welcome but the real credit that kick started the display would be Darkmagic, i just MASSIVELY improved his design

as for pets gl with equip coords

@EDIT:
i HIGHLY suggest you look into my v100 release, i have made edits you might want to look into.
**yes i do understand my xmls are generated differently its to compress them while still outputting the required info**

ex:
Code:
    public function setWeapon($z) {
        $wepArray = array(
		$wepArray = array(
            "weapon"                    => array( "weapon" ),
            "weaponBelowArm"            => array( "weapon", "weaponBelowArm" ),
            "weaponBelowBody"           => array( "weapon", "weaponBelowBody" ),
            "weaponOverArm"             => array( "weapon", "weaponOverArm", "string" ),
            "weaponOverArmBelowHead"    => array( "weapon" ),
            "weaponOverBody"            => array( "weapon", "weaponOverBody", "weaponL" ),
            "weaponOverGlove"           => array( "weapon" ),
            "weaponOverHand"            => array( "weapon", "weaponOverHand" ),
            "weaponWristOverGlove"      => array( "weapon", "weaponWrist" ),
            "armBelowHeadOverMailChest" => array( "weapon" ),
        );
        if(isset($this->Weapon['xml'])) {
            $snd = "stand".$this->stand;
            if($wepNUM = $this->Weapon['xml']->_info->$snd->NUM) { $wepNUM .= ".";}


            foreach( $wepArray[$z] as $type ) {
                if($this->Weapon['xml']->_info->z->value == $z) {
                    $wepX = self::mainX + $this->Weapon['xml']->_weapon->$snd->x;
                    $wepY = self::neckY + $this->Weapon['xml']->_weapon->$snd->y;


                    self::useImage("Weapon/0".$this->Weapon['ID'].".img/".$wepNUM.$snd.".0.".$type.".png", $wepX, $wepY);
                }
            }
        }
    }
replaces your 300+ lines and still gives the same results
 
Last edited:
Newbie Spellweaver
Joined
Sep 13, 2012
Messages
41
Reaction score
2
anyone that kind hearted can tell me how make it works ?
 
Junior Spellweaver
Joined
Dec 21, 2008
Messages
108
Reaction score
69
your welcome but the real credit that kick started the display would be Darkmagic, i just MASSIVELY improved his design

as for pets gl with equip coords

@EDIT:
i HIGHLY suggest you look into my v100 release, i have made edits you might want to look into.
**yes i do understand my xmls are generated differently its to compress them while still outputting the required info**

ex:
Code:
    public function setWeapon($z) {
        $wepArray = array(
		$wepArray = array(
            "weapon"                    => array( "weapon" ),
            "weaponBelowArm"            => array( "weapon", "weaponBelowArm" ),
            "weaponBelowBody"           => array( "weapon", "weaponBelowBody" ),
            "weaponOverArm"             => array( "weapon", "weaponOverArm", "string" ),
            "weaponOverArmBelowHead"    => array( "weapon" ),
            "weaponOverBody"            => array( "weapon", "weaponOverBody", "weaponL" ),
            "weaponOverGlove"           => array( "weapon" ),
            "weaponOverHand"            => array( "weapon", "weaponOverHand" ),
            "weaponWristOverGlove"      => array( "weapon", "weaponWrist" ),
            "armBelowHeadOverMailChest" => array( "weapon" ),
        );
        if(isset($this->Weapon['xml'])) {
            $snd = "stand".$this->stand;
            if($wepNUM = $this->Weapon['xml']->_info->$snd->NUM) { $wepNUM .= ".";}


            foreach( $wepArray[$z] as $type ) {
                if($this->Weapon['xml']->_info->z->value == $z) {
                    $wepX = self::mainX + $this->Weapon['xml']->_weapon->$snd->x;
                    $wepY = self::neckY + $this->Weapon['xml']->_weapon->$snd->y;


                    self::useImage("Weapon/0".$this->Weapon['ID'].".img/".$wepNUM.$snd.".0.".$type.".png", $wepX, $wepY);
                }
            }
        }
    }
replaces your 300+ lines and still gives the same results

Hmm, you know I was just using the GD that was included in the CMS I was building on. it does look like your v100 release is quite a bit cleaner. I may go ahead and see if I can't update it the same way. It definitely looks like something I can do fairly quickly at first quick. I just need to get the xml to turn into your coords.xml files. That shouldn't be too bad. Then I can transfer my new code for mercedes ears and dual bow guns over. Then if anything else is missing, I will see if I can't fix it.
 
Last edited:
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Well yesterday I finished transferring all my work to my new laptop and began working on this again
PHP:
[+]Head and body now shows
[+]Added Mercedes ears with correct coordinates(tested)
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Hats and Hair completely done.

I made a huge mistake on the code for hair I put here, I missed a few values so my hair coordination was messed up.. here is the new code(dont use this just use it for educational purposes):
PHP:
<?php 
if ($handle = opendir('Hair')) { 

		function ODhairOverHead($coord) {
			global $data;
			if(array_key_exists('default.hairOverHead.map.brow.'.$coord, $data)) {
				return $data['default.hairOverHead.origin.'.$coord] + $data['default.hairOverHead.map.brow.'.$coord];
			} else {
				return $data['default.hairOverHead.origin.'.$coord];
			}
		}
			
			//hairOverHead
		function ODhairBelowBody($coord) {
			global $data;
			if(array_key_exists('default.hairBelowBody.map.brow.'.$coord, $data)) {
				return $data['default.hairBelowBody.origin.'.$coord] + $data['default.hairBelowBody.map.brow.'.$coord];
			} else {
				return $data['default.hairBelowBody.origin.'.$coord];
			}
		}
			
		//hairShade
		function ODhairShade($coord) {
			global $data;
			if(array_key_exists('default.hairShade.0.map.brow.'.$coord, $data)) {
				return $data['default.hairShade.0.origin.'.$coord] + $data['default.hairShade.0.map.brow.'.$coord];
			} else {
				return $data['default.hairShade.0.origin.'.$coord];
			}
		}
			
			//hairShade
		function ODhair($coord) {
			global $data;
			if(array_key_exists('default.hair.map.brow.'.$coord, $data)) {
				return $data['default.hair.origin.'.$coord] + $data['default.hair.map.brow.'.$coord];
			} else {
				return $data['default.hair.origin.'.$coord];
			}
		}	
    while (false !== ($entry = readdir($handle))) { 
        if ($entry != "." && $entry != "..") { 
            // Get Data 
            $getData = file_get_contents("Hair/{$entry}/index.txt", FILE_USE_INCLUDE_PATH); 
            $result = array_values(array_filter(explode(" ", str_replace("\n", " ", $getData)),'strlen')); 
     
            // Put name with their values 
            for($i=0, $data=[]; $i < count($result); $i++) { 
                if ($i % 2 == 0){ 
                    $data[$result[$i]] = $result[$i+1]; 
                } 
            } 
             
            //These don't have X/Y coordinate.. but I do know it's from Kanna's patch 
            if($entry == "00036320.img" || $entry == "00036321.img") { 
                continue; 
            } 
			   //Gather needed information 
            $arr = [ 
                'hairBelowBody_x' =>    (array_key_exists('default.hairBelowBody.origin.x',$data) ? ODhairBelowBody('x')*-1 : 0),  
                'hairBelowBody_y' =>    (array_key_exists('default.hairBelowBody.origin.y',$data) ? ODhairBelowBody('y')*-1 : 0),  
                
				'hairShade_x' =>        (array_key_exists('default.hairShade.0.origin.x',$data) ? ODhairShade('x')*-1 : 0), 
                'hairShade_y' =>        (array_key_exists('default.hairShade.0.origin.y',$data) ? ODhairShade('y')*-1 : 0), 
               
				"hair_x"=>               ODhair('x')*-1, 
                "hair_y"=>               ODhair('y')*-1,
                
				"hairOverHead_x"=>       (array_key_exists('default.hairOverHead.origin.x',$data) ? ODhairOverHead('x')*-1 : 0), 
                "hairOverHead_y"=>       (array_key_exists('default.hairOverHead.origin.y',$data) ? ODhairOverHead('y')*-1 : 0), 
     
            ]; 
			
     
            // Save to JSON 
            file_put_contents("Hair/{$entry}/".str_replace(".img", "", $entry).".json", json_encode($arr)); 
         
            // Delete old data 
            unlink("Hair/{$entry}/index.txt"); 
        } 
    }
    closedir($handle); 
} 
?>

My progress:
Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
@iakira
i HIGHLY suggest you use a xml parser to get the coords instead of going about it through "default.hairBelowBody.origin" that method is old and not update friendly.
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
I really hate using anything related to XML.. not familiar with it much.. that is why I do this method and convert it to JSON files..
Update:
Accessory done
Cape done
Shield done
Shoes done
Overalls done
Top done
Pants done
 
Last edited:
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Done with everything but the weapons, need to clean the coding a lot..and still gotta fix a few bugs I ran into.. but the end results is promising:
Basis - [Website] Character Display for MapleStory v134 - RaGEZONE Forums
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
yeah this is going to be implemented to the public version of MapleByte as well, I needed an alternative to put in because i didn't want to release ian gd without his permission lolol

Hmph.. it seems gloves is the hardest one of all.. I still haven't been able to get a proper script to run for it.. it's just soo much information x.x...
 
Experienced Elementalist
Joined
Jul 19, 2011
Messages
288
Reaction score
32
Nice progress both of you 2 have been doing, hope it works. I'm done w/ MapleStory development so I won't try this out. Sorry :C
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
This annoying butt script I made took forever.. first the glove's index.txt had vlues stuck together so I had to seperate them then I saw this had more than 12 values and what not ugh.. at least I'm done..
Glove.php
PHP:
<?php 
$type = "Glove";
if ($handle = opendir($type)) {

	// Shorten the poop out of this script thanks to this function..
	function valueGen($name) {
		global $data, $arr;
		for($a=1; $a < 3; $a++) {
			for($i=0, $dirc = ['l','r']; $i < 2; $i++) {
				if(array_key_exists("stand{$a}.0.{$dirc[$i]}{$name}.origin.x", $data)) {
					$xb = "stand{$a}.0.{$dirc[$i]}{$name}.map.navel.x";
					$yb = "stand{$a}.0.{$dirc[$i]}{$name}.map.navel.y";
					$arr["stand{$a}_{$dirc[$i]}{$name}_x"] = ($data["stand{$a}.0.{$dirc[$i]}{$name}.origin.x"] + (array_key_exists($xb, $data) ? $data[$xb] : 0))*-1;
					$arr["stand{$a}_{$dirc[$i]}{$name}_y"] = ($data["stand{$a}.0.{$dirc[$i]}{$name}.origin.y"] + (array_key_exists($yb, $data) ? $data[$yb] : 0))*-1;
				}
			}
		}
	}
	
	// Loop
    while (false !== ($entry = readdir($handle))) { 
        if ($entry != "." && $entry != "..") {
            $getData = file_get_contents("{$type}/{$entry}/index.txt", FILE_USE_INCLUDE_PATH); 
			$FixSpacing = preg_replace("/(\\d)([a-z])/i", "$1\n$2", $getData);//4 values were in one line had to seperate them
	
			$result = array_values(array_filter(explode(" ", str_replace("\n", " ", $FixSpacing)),'strlen')); 
     
            // Put name with their values 
            for($i=0, $data=[]; $i < count($result); $i++) { 
                if ($i % 2 == 0){ 
                    $data[$result[$i]] = $result[$i+1]; 
                } 
            } 
			$arr = [];
			valueGen('Wrist');
			valueGen('Glove');
			
			// Special values for some items
			if(array_key_exists('stand1.0.gloveOverBody.origin.x',$data)) {
				$arr['stand1_gloveOverBody_x'] = ($data['stand1.0.gloveOverBody.origin.x']+$data['stand1.0.gloveOverBody.map.navel.x'])*-1;
                $arr['stand1_gloveOverBody_y'] = ($data['stand1.0.gloveOverBody.origin.y']+$data['stand1.0.gloveOverBody.map.navel.y'])*-1;
			}
			if(array_key_exists('stand1.0.gloveOverHead.origin.x',$data)) {
				$arr['stand1_gloveOverHead_x'] = ($data['stand1.0.gloveOverHead.origin.x']+$data['stand1.0.gloveOverHead.map.navel.x'])*-1;
                $arr['stand1_gloveOverHead_y'] = ($data['stand1.0.gloveOverHead.origin.y']+$data['stand1.0.gloveOverHead.map.navel.y'])*-1;
			}
			if(array_key_exists('stand2.0.gloveOverHand.origin.x',$data)) {
				$arr['stand2_gloveOverHand_x'] = ($data['stand2.0.gloveOverHand.origin.x']+$data['stand2.0.gloveOverHand.map.navel.x'])*-1;
                $arr['stand2_gloveOverHand_y'] = ($data['stand2.0.gloveOverHand.origin.y']+$data['stand2.0.gloveOverHand.map.navel.y'])*-1;
			}
			
			if(array_key_exists('stand2.0.lGlove2.origin.x',$data)) {
				$arr['stand2_gloveOverHand_x'] = ($data['stand2.0.lGlove2.origin.x']+$data['stand2.0.lGlove2.map.navel.x'])*-1;
                $arr['stand2_gloveOverHand_y'] = ($data['stand2.0.lGlove2.origin.y']+$data['stand2.0.lGlove2.map.navel.y'])*-1;
			}

			// Save to JSON 
            file_put_contents("{$type}/{$entry}/".str_replace(".img", "", $entry).".json", json_encode($arr)); 
         
            // Delete old data 
            unlink("{$type}/{$entry}/index.txt"); 
			
        } 
    }
    closedir($handle); 
}
?>
 
Junior Spellweaver
Joined
Dec 21, 2008
Messages
108
Reaction score
69
I've completed updating Holthelper's v100 GD to v134. I do not plan to release it at this time though. I will when I finish my CMS.
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
This annoying butt script I made took forever.. first the glove's index.txt had vlues stuck together so I had to seperate them then I saw this had more than 12 values and what not ugh.. at least I'm done..
Glove.php
PHP:
<?php 
$type = "Glove";
if ($handle = opendir($type)) {

    // Shorten the poop out of this script thanks to this function..
    function valueGen($name) {
        global $data, $arr;
        for($a=1; $a < 3; $a++) {
            for($i=0, $dirc = ['l','r']; $i < 2; $i++) {
                if(array_key_exists("stand{$a}.0.{$dirc[$i]}{$name}.origin.x", $data)) {
                    $xb = "stand{$a}.0.{$dirc[$i]}{$name}.map.navel.x";
                    $yb = "stand{$a}.0.{$dirc[$i]}{$name}.map.navel.y";
                    $arr["stand{$a}_{$dirc[$i]}{$name}_x"] = ($data["stand{$a}.0.{$dirc[$i]}{$name}.origin.x"] + (array_key_exists($xb, $data) ? $data[$xb] : 0))*-1;
                    $arr["stand{$a}_{$dirc[$i]}{$name}_y"] = ($data["stand{$a}.0.{$dirc[$i]}{$name}.origin.y"] + (array_key_exists($yb, $data) ? $data[$yb] : 0))*-1;
                }
            }
        }
    }
    
    // Loop
    while (false !== ($entry = readdir($handle))) { 
        if ($entry != "." && $entry != "..") {
            $getData = file_get_contents("{$type}/{$entry}/index.txt", FILE_USE_INCLUDE_PATH); 
            $FixSpacing = preg_replace("/(\\d)([a-z])/i", "$1\n$2", $getData);//4 values were in one line had to seperate them
    
            $result = array_values(array_filter(explode(" ", str_replace("\n", " ", $FixSpacing)),'strlen')); 
     
            // Put name with their values 
            for($i=0, $data=[]; $i < count($result); $i++) { 
                if ($i % 2 == 0){ 
                    $data[$result[$i]] = $result[$i+1]; 
                } 
            } 
            $arr = [];
            valueGen('Wrist');
            valueGen('Glove');
            
            // Special values for some items
            if(array_key_exists('stand1.0.gloveOverBody.origin.x',$data)) {
                $arr['stand1_gloveOverBody_x'] = ($data['stand1.0.gloveOverBody.origin.x']+$data['stand1.0.gloveOverBody.map.navel.x'])*-1;
                $arr['stand1_gloveOverBody_y'] = ($data['stand1.0.gloveOverBody.origin.y']+$data['stand1.0.gloveOverBody.map.navel.y'])*-1;
            }
            if(array_key_exists('stand1.0.gloveOverHead.origin.x',$data)) {
                $arr['stand1_gloveOverHead_x'] = ($data['stand1.0.gloveOverHead.origin.x']+$data['stand1.0.gloveOverHead.map.navel.x'])*-1;
                $arr['stand1_gloveOverHead_y'] = ($data['stand1.0.gloveOverHead.origin.y']+$data['stand1.0.gloveOverHead.map.navel.y'])*-1;
            }
            if(array_key_exists('stand2.0.gloveOverHand.origin.x',$data)) {
                $arr['stand2_gloveOverHand_x'] = ($data['stand2.0.gloveOverHand.origin.x']+$data['stand2.0.gloveOverHand.map.navel.x'])*-1;
                $arr['stand2_gloveOverHand_y'] = ($data['stand2.0.gloveOverHand.origin.y']+$data['stand2.0.gloveOverHand.map.navel.y'])*-1;
            }
            
            if(array_key_exists('stand2.0.lGlove2.origin.x',$data)) {
                $arr['stand2_gloveOverHand_x'] = ($data['stand2.0.lGlove2.origin.x']+$data['stand2.0.lGlove2.map.navel.x'])*-1;
                $arr['stand2_gloveOverHand_y'] = ($data['stand2.0.lGlove2.origin.y']+$data['stand2.0.lGlove2.map.navel.y'])*-1;
            }

            // Save to JSON 
            file_put_contents("{$type}/{$entry}/".str_replace(".img", "", $entry).".json", json_encode($arr)); 
         
            // Delete old data 
            unlink("{$type}/{$entry}/index.txt"); 
            
        } 
    }
    closedir($handle); 
}
?>
this is why i say use xml......
Code:
foreach( $xml->imgdir as $imgdir ) {
    $stand = (string) $imgdir['name'];
    if(in_array($stand, $imgArray)) {
        foreach( $imgdir->imgdir->canvas as $canvas ) {
            $name = (string) $canvas['name'];
            
            $originX = $canvas->vector['x'];
            $originY = $canvas->vector['y'];
            $browX = $canvas->imgdir->vector['x'];
            $browY = $canvas->imgdir->vector['y'];
        }
    }
}
cycles through all canvas and gets respective coords.
 
Back
Top