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!

[Development] GD Generation v2.0

may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606

Alright so, in the next few months or so I will build a new GD little by little since my old one was just scripts thrown to the public with not much instructions on how to use it or build it. Instead of doing everything privately and quick, I will take my time to not mess up on these scripts. The old ones weren't good since they didn't generate all the images and was handled badly all while I tried optimizing it at the same time. Hope to be finish with this in about .. 4 months or so? I will dedicate about 2-3 hours on the weekends(currently attending UCF and being a stem major is rough so I apologize on the lack of time I spend). For now I will add my scripts here and update them best I can. Also make them user friendly to understand.


Information:

  • Testing: v169.1 GMS
  • Coding: SimpleXML(output JSON)
  • Database for testing GD: IntrinsicMS(Thanks to @Lynx1213 )
  • Extractor: Harepacker 4.3(+maplelib.dll fix)
  • v1.0(old): here

Accessory:
V.2.0
PHP:
<?php 
	/**
	 * Accessories JSON Creation
	 * @author iAkira
	 *                    [USER=316612]Version[/USER] 2.0
	 */
	ini_set('max_execution_time', 14000); // Extend execution timing.
	/**
	 * @vslot 
	 * Af = AccessoryFace
	 * Ay = AccessoryEyes
	 * Ae = AccessoryEars
	 * Pe = Pendant
	 * Be = Belt
	 * Me = Medal
	 * Sh = Shoulder
	 * Po = Pocket
	 * Ba = Badge
	 * Si = Emblem
	 **/
	//Locate access and delivery folders.
    $dir = 'XML/'; // Location of your XML files.
	$output = 'RhaArias/'; // Output location for JSON files.
	
	// Don't touch this.
    $storage = [];
	$skip = ['Pe','Be','Me','Sh','Po','Ba','Si']; // Not shown on character.
	
	// Creates output folder if doesn't exist.
	if (!file_exists($output)) {
		mkdir($output, 0777, true);
	}
	// Don't touch anything beyond this point unless you know what you're doing.
	foreach(array_slice(scandir($dir), 2) as $id) {
		// ID of current interation iteration.
		$pureID = substr($id, 0, -8);
		// Jump transparent cash item.
		if($pureID == '01022048'){ 
			continue;
		}
		foreach (simplexml_load_file($dir.$id)->imgdir as $parent) {
			if($parent['name'] == 'info'){
				// Jump over items not shown on character.
				foreach($parent->children()->string as $vslot){
					if(in_array((string)$vslot['value'], $skip)) {
						continue 3;
					}
				}
			} else if($parent['name'] == 'default') {
				$cache = $parent->children()[0];
				$storage['x'] = -((int)$cache->vector['x'] + (int)$cache->imgdir->vector['x']);
				$storage['y'] = -((int)$cache->vector['y'] + (int)$cache->imgdir->vector['y']);
				$storage['z'] = (string)$parent->children()[0]->string[0]['value'];
				// Finding the source image if it contains a source attribute.
				if(isset($parent->children()[0]->string[1])){
					$rawSource = $parent->children()[0]->string[1]['value'];
					$pureSource = explode('/', $rawSource);
					$pureSourceID = mb_strimwidth(preg_replace('/[^0-9]/','', $rawSource), 0, 8, '');
					// Checks if source image is an icon.
					if(in_array('iconRaw', $pureSource)) {
						$location = in_array($pureID.'.img', $pureSource)? $id : $pureSourceID.'.img.xml';
						$storage['d'] = (string)simplexml_load_file($dir.$location)->imgdir[0]->canvas[1]['basedata'];
					// Checks if the source image is located outside the current item ID through a pattern (default/default).
					} else if((count($pureSource) != count(array_count_values($pureSource)))){
						$location = simplexml_load_file($dir.$pureSourceID.'.img.xml')->imgdir[0]->canvas[1]['basedata'];
						foreach (simplexml_load_file($dir.$pureSourceID.'.img.xml')->imgdir as $parent2) {
							if($parent2['name'] == 'default'){
								$storage['d'] = (string)$parent2->children()[0]['basedata'];
								break;
							}
						}
					// Unique source image location requires more checks.
					} else {
						//Character/Accessory/01012025.img/blaze/0/default
						//Checks if source image is in Accessories or not.
						if($pureSource[1] == substr($dir, 0, -1)) {
							foreach (simplexml_load_file($dir.$pureSourceID.'.img.xml')->imgdir as $parent2) {
								//Checks specific imgdir
								if($parent2['name'] == $pureSource[3]){
									$storage['d'] = (string)$parent2->children()[0]['basedata'];
									echo (string)$parent2->children()[0]['basedata'];
									break;
								}
							}
						}
					}
				} else {
					$storage['d'] = (string)$parent->children()[0]['basedata'];
				}
			break;
			}
		}
		// Creates JSON file of current ID.
		$file = fopen($output.$pureID.'.json', 'w'); 
		fwrite($file, json_encode($storage, JSON_UNESCAPED_SLASHES)); 
		fclose($file); 
		
		// Something some keys are left over so wiping the storage is needed.
        $storage = [];
	}
?>

(Interesting finding while debunking a bit was that none of the released GD have the fully vslot support for caps which is extremely important)
Cap:
Vslot information:
PHP:
<?php 
	/**
	 * Accessories JSON Creation
	 * @author iAkira
	 *             [USER=316612]Version[/USER] 2.0
	 */
	 /**
	 * @vSlot
	 * CpH1H2H3H4H5H6HfHsHbHc = Replaces Hair
	 * CpH1H2H3H4H5H6HfHbHxHs = Replaces Hair
	 * CpH1H2H3H4H5H6HfHsHbHx = Replaces Hair
	 * CpH1H2H3H4H5H6HfHsHb = Replaces Hair
	 * CpH1H2H3H4H5H6HsHb = replace Hair
	 * CpHdH1H2H3H4H5HfHsFcAfAyAsAfAe = no overhead/ or face / or accessories
	 * CpH1H2H3H4H5H6HfHsHbHcAfAyAsAfAe = Replaces Hair/ no acceosries
	 * CpHdH1H2H3H4H5H6HsHfHbAfAyAsAe = Replaces Hair/ no acceosries but has faces 
	 * CpH1H2H3H4H5H6HfHsHbAe = Replaces Hair and no earrings
	 * CpH1H2H3H4H5HfHsHbAe = No hairoverhead no ears
	 * CpH1H3H4H5H6HfHsHbAe = no earring no overheadhair (noshade?)
	 * CpH1H3H4H5H6HfHbAe = no earrings or overhead
	 * CpH1H2H3H5HfHsAfAyAsAeHbH4H6 = no earring and no hair(Replace hair no accessories)
	 * CpH1H2H3H4H5H6HfHsHbHcAe = unknown
	 * CpHdH1H2H3H4 = unknown (could be no overhead/no face/ no accessories MAYBE earring itemid: 01002470)
	 * CpH5 = allow hairoverhead
	 * Cp = Allow everything(even earrings) allow hairoverhead
	 * CpH1H4 = no overhead
	 * CpH1H5 = no overhead
	 * CpH2H5 = no overhead
	 * CpH1H5Hb = no overhead/ Hb may = defaultAc
	 * CpHdH1H2H3H5HfHsFcAfAyAsAfAe = no face/accessories/ or hair
	 * CpH1H2H3H4H5H6HsHfHbAfAyAsAe = No Hair no accessories
	 * CpH1H5FcAfAyAsAfAe = no overhead no face no accessories
	 * CpH1H5AyAs = no overhead/ no accessory eyes / As?
	 * CpH1H5AfAyAsAe = no overhead or accessories
	 * CpH1H2H5Hs = remove all hair and accessories(someone test itemid:01002583)
	 * CpH1H2H3H4H5HfHsAeAs = remove hair, eye accessories.(some one test itemid: 01002241)
	 * CpH5Ae = allow hairoverhead/ remove ear accessories
	 * '2' = allow everything(test itemid:01003104) but no overhead
	*/
	
?>
Script:
PHP:
<?php 
	/**
	 * Cap JSON Creation
	 * @author iAkira
	 *         [USER=316612]Version[/USER] 2.0
	 */
	// Unique items like Teddy Ribbon & Warm Bao support added as well
	ini_set('max_execution_time', 14000);
    $dir = 'XML/';
	$output = 'RhaArias/';
	$storage = [];
	//default back -> hairoverhead -> default
	//"z_defaultB": "accessoryEar", (01003108)
	//defaultacc (id:01003657 look into it but for now can be excluded)
	//a0-b3 (01004533 items Nexon never advertised, so idk how it looks in game, excluded for now)
	$getInfo = 	['default','defaultAc','defaultBelowBody','defaultAC','defaultTail','defaultBack','defaultB','acc','defaultback','0','hairBelowBody','defaultAcc'];
	$uniqueIDs = ['01003862', '01004414'];
	if (!file_exists($output)) {
		mkdir($output, 0777, true);
	}
	foreach(array_slice(scandir($dir), 2) as $id) {
		$xml = simplexml_load_file($dir.$id);
		$pureID = substr($id, 0, -8);
		// Just Icon, so we skip it.
		if(!isset($xml->imgdir[1])) {
			continue;
		}
		// Loop all nodes to find 'Default'(couldnt assume it was at 1 like in accessories since the info[0] sometimes is last.)
	
		foreach ($xml->imgdir as $parent0) {
			$stance = (in_array($pureID, $uniqueIDs)) ? 'walk1' : 'default';
			if ($parent0['name'] == 'info') {
				// 5th Anniversary Giant Cake Hat has more strings.
				$storage['vslot'] = (string) $parent0->string[($id == '01003104.img.xml') ? 5 : 1]['value'];
				if(count($storage) > 1) {
					break;
				}
			} else if ($parent0['name'] == $stance) {
				$imgdir =($stance =='walk1') ? $parent0->imgdir[0]->canvas : $parent0->canvas;
				foreach ($imgdir as $parent1) {
					if(in_array($parent1['name'], $getInfo)) {
						// Blank image, skip it.
						if((int)$parent1['width'] == 1) {
							continue;
						} else {
							$storage['x_'.$parent1['name']] = -((int)$parent1->vector[0]['x'] + (int)$parent1->imgdir[0]->vector[0]['x']);
							$storage['y_'.$parent1['name']] = -((int)$parent1->vector[0]['y'] + (int)$parent1->imgdir[0]->vector[0]['y']);
							$storage['z_'.$parent1['name']] = (string)$parent1->string[0]['value'];
							// Check if it contains source.
							if(isset($parent1->string[1])) {
								$rawSource = $parent1->string[1]['value'];
								$pureSource = explode('/', $rawSource);
								$pureSourceID = mb_strimwidth(preg_replace('/[^0-9]/','', $rawSource), 0, 8, '');
								//usually default sourcing only not Ac
								//check if only default/default and check if current id or not.
								if((count($pureSource) != count(array_count_values($pureSource)))){
									foreach (simplexml_load_file($dir.$pureSourceID.'.img.xml')->imgdir as $parent2) {
										if($parent2['name'] == 'default'){
											$storage['d_'.$parent1['name']] = (string)$parent2->children()[0]['basedata'];
											break;
										}
									}
								} else if(in_array('icon', $pureSource) || in_array('iconRaw', $pureSource)){
									$parent2 = ($pureSourceID != preg_replace('/[^0-9]/','', $id)) ? simplexml_load_file($dir.$pureSourceID.'.img.xml')->imgdir : $xml->imgdir;
									//removed because never called
									/*if($parent2[0]['name'] != 'info') {
										echo $id.'<br />';
										foreach ($parent2 as $parent3) {
											if($parent3->canvas['name'] == 'info'){
												$info = $parent3->canvas;
												echo $id.'<br />';
												break;
											}
										}
									} else {*/
									$info = $parent2[0]->canvas;
									$canvas = in_array('icon', $pureSource) ? $info[0] : $info[1];//icon or iconRaw
									$storage['d_'.$parent1['name']] = (string)$canvas['basedata'];
								} else if (in_array('defaultBelowBody', $pureSource) || in_array('defaultBack', $pureSource) || in_array('defaultAc', $pureSource) || in_array('acc', $pureSource)){
									$parent2 = simplexml_load_file($dir.$pureSourceID.'.img.xml')->imgdir;
									foreach ($parent2 as $parent3) {
										if($parent3['name'] == $pureSource[count($pureSource)-2]) {
											foreach ($parent3->canvas as $parent4) {
												if($parent4['name'] == $pureSource[count($pureSource)-1]) {
													$storage['d_'.$parent1['name']] = (string)$parent4['basedata'];
													break;
												}	
											}
											break;
										}
									}
								}
							} else {
								$storage['d_'.$parent1['name']] = (string)$parent1['basedata'];
							}
						}
					}//else are the rejected nodes
				}
				// itemID that only consist of vslot(all nodes had width of 1 so doesn't need a JSON file)
				if(count($storage) == 1) {
					continue 2;
				} else if(array_key_exists('vslot', $storage)) {
					break;
				}
			}
		}
		$file = fopen($output.$pureID.'.json', 'w'); 
		fwrite($file, json_encode($storage, JSON_UNESCAPED_SLASHES)); 
		fclose($file); 
		$storage = [];
	}
?>
JSON File result:
{
"vslot": "CpH5",
"x_default": 5,
"y_default": -15,
"z_default": "capOverHair",
"d_default": "iVBORw0KGgoAAAANSUhEUgAAABoAAAAbCAYAAABiFp9rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJKSURBVEhLrVQLlYMwEMTCWcBCLWChFmohFrCABSxgIRZiIRb2ZvaTBo5yfXedx7xAsplJNhuGf0A6/hm9yJmQSBVl3eqrmEvoJE5WIUf0M8Ch/RqnLy3mLejENvkEjIk4XUix/oCP/4q2iyuzOttizmKoYVLXsOjXHg01FakrAgvIeDYwpoZJXcNUjqAYmb1l83Aj9pF8nkZvGbq6IwzIFQdC4snTghTiZeGHp5K7ZDrxkNQyyXOYAcEJNKJ42qTeV6XMWbbbQ+ojQzzDDNwilT7PQT2TPUdblU6kSGdUYbKMk9TxIfmWpE4wp9nq83rgm3om+xOWCpKrxI7UAILb16RcvKWZZBjQJFo3CFLPZPfQAS1hMlUpSFW5LzuTZbhBc5KSniZ81+8eMOqKpMFHHUwbWHDI65iaSWIcxEO4p7AYjjjsynsdjGchMH3YUcWOwiREF7wH8zTbOXmp7/DD6BigRlZxZUpSxrsahXgaRvALO71rsWh10oiZCLgm9c3kDHqHouJmFWT6KB6c8b1hAVZ1zDPmUdwNAm8YgavdlcKVo8pWCPeFsaLEebdsjjW9UV8MzxvdgybsZ/pY4tgZV59hxrvEVLKtM/r1T2FX4pVJwIdOwLmYQFJQ/xKJfwici6csxvs/O0ldk9/DVhMrivfOqOCXw1bPgzvVXXu+Ig5m1HK+RBM/muxSQ22eYTDAYcRQx+Su0a9ox2Z0BYx7/J/xuxHHPmBEPI16w77vY0aBg5HuFmCMhf4fKhirV6Blv/Oj6IXfMBiGb567zd/OoHxnAAAAAElFTkSuQmCC"
}
Cape:
PHP:
<?php 
	/**
	 * Cape JSON Creation
	 * @author iAkira
	 *       [USER=316612]Version[/USER] 2.0
	 */
	ini_set('max_execution_time', 14000);
    $dir = 'XML/';
	$output = 'RhaArias/';
	$storage = [];
	if (!file_exists($output)) {
		mkdir($output, 0777, true);
	}
	foreach(array_slice(scandir($dir), 2) as $id) {
		$xml = simplexml_load_file($dir.$id)->imgdir;
		$pureID = substr($id, 0, -8);
		$path = '';
		// Only icon Jump.
		if(!isset($xml[1])) { continue; }
		// [New]Pathing
		// uol are basically a 'redirect' of the FULL information rather then partial info.
		// Source is a partial redirect to the base64 image, but uol is a redirect on x,y,z, and base64.
		foreach($xml as $parent0) {
			if($parent0['name'] == 'stand1') {
				$path = isset($parent0->imgdir[0]->uol) ? 'default' : 'stand1';
				break;
			}
		}
		// Collection data
		foreach($xml as $parent) {
			if($parent['name'] == $path) {
				// Empty node
				if(!isset($parent->imgdir[0]) && !isset($parent->canvas[0])){
					continue;
				}
				// Some itemID arent animated so they don't have the imgdir[0,1,2,3,4, etc] since the cape is static.
				$type = isset($parent->canvas[0]) ? $parent : $parent->imgdir[0];
				foreach($type->canvas as $parent1) {
					// Jump canvas with width 1(blank image)
					if((int) $parent1['width'] == 1) { continue; }
					$storage['x_'.$parent1['name']] = -((int)$parent1->vector[0]['x'] + (int)$parent1->imgdir[0]->vector[0]['x']);
					$storage['y_'.$parent1['name']] = -((int)$parent1->vector[0]['y'] + (int)$parent1->imgdir[0]->vector[0]['y']);
					$storage['z_'.$parent1['name']] = (string)$parent1->string[0]['value'];
					//Character/Cape/01100000.img/walk1/0/cape
					//<ignore>/<ignore>/<location>/<imgdir>/<position>/<canvas>
					if(isset($parent1->string[1])) {
						$rawSource = $parent1->string[1]['value'];
						$pureSource = explode('/', $rawSource);
						// It's okay to remove the mb_strimwidth function since the ALL source are all the same template as above.
						// No icon sourcing found.
						// While checking source, found out the $pureSource is the same for every ID. So no if statements are needed.
						$source = (preg_replace('/[^0-9]/','', $pureSource[2]) != $pureID) ? simplexml_load_file($dir.$pureSource[2].'.xml')->imgdir : $xml;
						foreach($source as $parent2) {
							if($parent2['name'] == $pureSource[3]) {
								//find canvas name(some might have more than one canvas ex.capeArm)
								foreach($parent2->imgdir[(int)$pureSource[4]]->canvas as $parent3) {
									if($parent3['name'] == $pureSource[5]) {
										$storage['d_'.$parent1['name']] = (string)$parent3['basedata'];
										break 2;
									}
								}
							}
						}
					} else {
						$storage['d_'.$parent1['name']] = (string)$parent1['basedata'];
					}
				}
				break;
			}
		}
		if(count($storage) != 0) {
			$file = fopen($output.$pureID.'.json', 'w'); 
			fwrite($file, json_encode($storage, JSON_UNESCAPED_SLASHES)); 
			fclose($file); 
		}
		$storage = [];
	}
?>
Hair:
Version 2.0.0
PHP:
<?php 

	ini_set('max_execution_time', 14000); // Extend execution timing.
    $dir = 'XML/'; // Location of your XML files.
	$output = 'RhaArias/'; // Output location for JSON files.
    $storage = [];
	//check all the hair name values
	// Creates output folder if doesn't exist.
	if (!file_exists($output)) {
		mkdir($output, 0777, true);
	}
	foreach(array_slice(scandir($dir), 2) as $id) {
		$xml = simplexml_load_file($dir.$id)->imgdir;
		foreach($xml as $parent) {
			if($parent['name'] == 'default') {
				foreach ($parent->canvas as $parent2){
					if((int)$parent2['width'] == 1){ continue; }
					$storage['x_'.$parent2['name']] = -((int)$parent2->vector[0]['x'] + (int)$parent2->imgdir[0]->vector[0]['x']);
					$storage['y_'.$parent2['name']] = -((int)$parent2->vector[0]['y'] + (int)$parent2->imgdir[0]->vector[0]['y']);
					$storage['z_'.$parent2['name']] = (string)$parent2->string[0]['value'];
					//Character/Hair/00030100.img/default/hairOverHead
					//Character/Hair/00030741.img/default/hair(same id backhair redirect to hair)(do a check to remove because it's the same backhair and hair with the same image?)
					//itemid(00030741) ^
					//Character/00002000.img/blink/0/body(blank image)
					//width="1" height="1" remove these from creation and loop.
					if(isset($parent2->string[1])){
						echo $id;
						break 2;
					}
				}
			}
		}
		$storage = [];
	}
	//print_r($storage);
?>
Version: 2.0.1
PHP:
<?php 
	// Supports the Kanna hair which were an event by Nexon in creations.
	// Supports hairOverHead, hairShade(hate Nexon..), hairBelowBody, Hair, and hairBelowHead
	ini_set('max_execution_time', 14000); // Extend execution timing.
    $dir = 'XML/'; // Location of your XML files.
	$output = 'RhaArias/'; // Output location for JSON files.
    $storage = [];
	
	// Remove duplicated images.
	$removal = [];
	$removal['hairBelowBody'] = array_merge(range(32660,32667), [38920]);
	$removal['hairBelowHead'] = range(33390,33397);
	$removal['hairOverHead'] = array_merge(range(31200,31217), range(30740,30747));
	
	//These are useless images that are either slighty modified or cut off a bit.(experimental images I believe).
	$exception =['hairOverHeadProne','hairBelowBodyProne','hairBelowBody_prone', 'hairProne'];
	if (!file_exists($output)) {
		mkdir($output, 0777, true);
	}
	foreach(array_slice(scandir($dir), 2) as $id) {
		$xml = simplexml_load_file($dir.$id)->imgdir;
		$pureID = substr($id, 0, -8);
		foreach($xml as $parent) {
			if($parent['name'] == 'default') {
				//hairshade is a god damn imgdir. really nexon..
				if(isset($parent->imgdir[0]->canvas[0])){
					$cache0 = $parent->imgdir[0]->canvas[0];
					if((int)$cache0['width'] != 1){
						$storage['x_hairShade'] = -((int)$cache0->vector[0]['x'] + (int)(isset($cache0->imgdir[0]->vector[0]['x']) ? $cache0->imgdir[0]->vector[0]['x'] : 0));
						$storage['y_hairShade'] = -((int)$cache0->vector[0]['y'] + (int)(isset($cache0->imgdir[0]->vector[0]['y']) ? $cache0->imgdir[0]->vector[0]['y'] : 0));
						$storage['d_hairShade'] = (string)$cache0['basedata'];
						if(isset($cache0->string)) {
							foreach($cache0->string as $parent1) {
								if($parent1['name'] == 'source') {
									$storage['d_hairShade'] = sourceImage($parent1['value'], $pureID, $xml, true);
									break;
								}
							}
						}
					}
				}
				foreach ($parent->canvas as $parent2){
					if((int)$parent2['width'] == 1 || in_array($parent2['name'], $exception)){ 
						continue; 
					}
					foreach($removal as $revType => $revID) {
						if(in_array((int)$pureID, $revID) && $parent2['name'] == $revType) {
							continue 2;
						}
					}
					//There is a unique canvas named hairBelowHead but some z value rename this to hairBelowBody.
					//So $type variable does the following:"x_hairBelowHead" to "x_hairBelowBody" if the statement exist.
					$type = ($parent2['name'] == 'hairBelowHead' && (string)$parent2->string[0]['value'] == 'hairBelowBody') ? 'hairBelowBody' : $parent2['name'];
					$storage['x_'.$type] = -((int)$parent2->vector[0]['x'] + (int)$parent2->imgdir[0]->vector[0]['x']);
					$storage['y_'.$type] = -((int)$parent2->vector[0]['y'] + (int)$parent2->imgdir[0]->vector[0]['y']);
					$storage['d_'.$type] = (isset($parent2->string[1])) ? sourceImage($parent2->string[1]['value'], $pureID, $xml, false) : (string) $parent2['basedata'];
				}
				break;
			}
		}
		//It's greater than 0 over 3 because some hairID only have 3 things(default hair x,y, and d)
		if(count($storage) > 0) {
			$file = fopen($output.$pureID.'.json', 'w'); 
			fwrite($file, json_encode($storage, JSON_UNESCAPED_SLASHES)); 
			fclose($file); 
		}
		$storage = [];
	}

	
	function sourceImage($value, $currentID, $currentIDData, $isShade) {
		$data = '';
		$pureSource = explode('/', $value);
		$pureSourceID = preg_replace('/\D/', '', $pureSource[2]);
		$path = ($pureSourceID == $currentID) ? $currentIDData : simplexml_load_file('XML/'.$pureSource[2].'.xml')->imgdir;
		foreach($path as $parent3) {
			if($parent3['name'] == $pureSource[3]) {
				if(isset($parent3->canvas) && !$isShade) {
					$path2 = [$parent3->canvas, 4];
				} else if(isset($parent3->imgdir)){
					$cache = $parent3->imgdir;
					for ($i = 0, $o = -1; $i < count($cache); $i++){
						if($cache[$i]['name'] == $pureSource[4]) {
							$o = $i;
							break;
						}
					}
					$path2 = [$cache[$o]->canvas, 5];
				}
				foreach($path2[0] as $parent4) {
					if($parent4['name'] == $pureSource[$path2[1]]) {
						$data = (string) $parent4['basedata'];
						break 2;
					} 
				}
			}
		}
		return $data;
	}
?>

Kappa123.
 
Last edited:
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
That's awesome, keep up the good work :)
I hope I will lol.

----
Update: I added a bit of my research of caps which is about vslots which no one has added fully in a public GD(only partially). The vslot in cap I found to be a very important thing. It's an "if" argument written in secret which tell what items type are removed when worn. Some GD support the basic "CPH5, CP, and H1H2H3H4H5H6" but that' about it.

There are a few vslots arguments I'm not too sure and added the itemID for them and was wondering whoever has a server to test those items and see what happens and if the description supplied matches what happens when you wear the cap.(example like, when wearing cap the earrings are removed from view, some of your hair is removed[hairoverhead], etc).
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Update:
-Fully working Caps for everything(ALL itemID's are taken into account)(tested every value, unique values, and every single line has been checked very well to not exclude any items out).
-Caps now have vslot data included.
-Included example of dump

Harepacker dumped 2006 XML caps, I was able to generate 2001 caps with the script. I will test in the future if anything is wrong , but I will give it my 99.9% approval that the cap generation file works 100% better compared to the v1.0(which was a shitload of if statements and added H1 automatically to everything, stupid old me lol).

[STRIKE]Only know issue: default node doesn't have any carvas check, but I've check if default exist and info, but not the children. Will add asap.[/STRIKE]



Update 2:
Alright so I updated the cap script again and added support to those with no children in the imgdir default node. (Teddy Ribbon & Warm Bao) To support those imgdir with no children, I went with the walk1 node instead of default for those two. Also while fixing this small hole, I noticed there were files being created with only had vslot in the storage(only way this happens if the canvas's width size is 1 which is a blank image), since they are blank images and only a vslot, I removed them from being created. So out of the 2,006 files harepacker dumped, 1,980 files are converted to JSON(optimization op :) )
 
Last edited:
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Cool man, i've always enjoyed your GD work.
Thanks man, hopefully I can provide a decent GD.

Amazing, keep it up!
Thanks will do!
----------------------------
Update:
-Added Cape generation

Looking upon some of the XML of the cape, I notice this weird parent called "uol". What uol does is that it redirect the reading completely of the information. Source imaging is partial redirecting, it redirect the reading for the Base64 image only. So knowing uol are in the Cape XML, I had to take a different approach of my looping and coding. I found the ost efficient way of doing so by finding the path first then looping. I tried various options and that was the best one that came to mind.

Also I would like to take this time to explain something about "all files are taken into account", I check 100% at the end of finishing the script if the total count of XML that the script reads is the same as if I take a count of all id through the if statements. So say there is 5000 files total in the folder and only 4500 came out. I add a ($count++) to every if statement that "jumps" the creation of the JSON files(Example there are a bunch of if statements that does a continue argument which jumps the creation part of the script to the next ID) and see if I add 4500 + ($count) = 5000. I sometimes don't get 5000, so I go back and double check every line to see which loop isn't reading the files or where did I miss adding the $count++. So far the three scripts posted checks all files to the end.

Last thing I will add is that, some may think I grab my old scripts and try to revamp it, but the truth is, it's very complex and puzzling trying to read through a shitload of loops. There is a major difference between v1.0 and v2.0, v1.0 the arrays and loops are converted to JSON arrays since back then I didn't know how to use simpleXML functions, v2.0 all my scripts are done through simpleXML functions, which is why you see a lot of "imgdir->canvas". I found this way is a lot easier to read the array compared to JSON. Alrighty wall of text done.
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Sorry for not adding anything yesterday, been busy with new years stuff. Added Hair without base64 will do it soon.
(incomplete but have an idea how I debug, and check for information)(missing:base64 data)
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Showoff:
Alright so I finished off Hair(that was long..), Body, and Face. I finished creating a vslot function that follows EVERY item and shows proper images. The current on in Maplebit which is the following:
PHP:
public function setHair($z) {
		switch($z) {
			case "hair":
				if (!strpos($this->vSlot, 'H3'))
					self::setAHair($z);
				break;
			case "hairBelowBody":
				if (!strpos($this->vSlot, 'H4'))
					self::setAHair($z);
				break;
			case "hairBelowHead": //H2 or H6 - idk. Need to figure this out
				if (!strpos($this->vSlot, 'H2'))
					self::setAHair($z);
				break;
			case "hairOverHead":
				if (!strpos($this->vSlot, 'H5'))
					self::setAHair($z);
				break;
			case "hairShade":
				if (!strpos($this->vSlot, 'H1'))
					self::setAHair($z);
				break;
			default: //Hf Hs Hb. Wat is dis!!??
				break;
			}
	}
This breaks a lot of of character with the hairs. the Hf is actually needed. Hs is hairshade but I dont use it because once you remove hair the hairshade is removed as well. having the H values seperate like that is very very bad. Here is my vslot function after debugging it for 2 full days. It met all the vslots and images.
vSlot Values:
PHP:
01000000.img.xml || CpH1H5
01000003.img.xml || CpHdH1H2H3H4H5HfHsFcAfAyAsAfAe
01000005.img.xml || CpH1H2H3H4H5H6HfHsHbHcAfAyAsAfAe
01000006.img.xml || CpH1H2H3H4H5H6HfHsHbHcAe
01000009.img.xml || CpH1H2H3H5HfHsAfAyAsAeHbH4H6
01000021.img.xml || CpH1H2H3H4H5H6HfHsHbHc
01000030.img.xml || CpH1H2H3H4H5H6HfHbHxHs
01000060.img.xml || Cp
01000069.img.xml || CpH5
01000090.img.xml || CpH1H3H4H5H6HfHsHbAe
01001005.img.xml || CpH1H2H3H4H5H6HfHsHb
01001006.img.xml || CpH1H2H3H4H5H6HfHsHbAe
01001038.img.xml || CpH1H2H3H4H5H6HfHsHbHx
01001066.img.xml || CpH1H3H4H5H6HfHbAe
01002002.img.xml || CpH1H4
01002005.img.xml || CpHdH1H2H3H5HfHsFcAfAyAsAfAe
01002024.img.xml || CpH1H5FcAfAyAsAfAe
01002025.img.xml || CpH1H5AyAs
01002224.img.xml || CpH1H2H5Hs
01002241.img.xml || CpH1H2H3H4H5HfHsAeAs
01002266.img.xml || CpH5Ae
01002357.img.xml || CpH1H2H3H4H5HfHsHbAe
01002470.img.xml || CpHdH1H2H3H4
01002479.img.xml || CpHdH1H2H3H4H5H6HsHfHbAfAyAsAe
01002837.img.xml || CpH1H5AfAyAsAe
01002953.img.xml || CpH1H5Hb
01003145.img.xml || CpH2H5
01003272.img.xml || CpH1H2H3H4H5H6HsHb
01004392.img.xml || CpH1H2H3H4H5H6HsHfHbAfAyAsAe

Here is my vslot function that follows ALL those vslots functions and doesn't "accidentally" remove some things that aren't suppose to be removed. Also added support for accessory removal which the MapleBit's GD doesnt have at all. Also has face removal as well.
PHP:
	/**
	 *
	 * vSlot Checker(Erase image)
	 *
	 * @type	@value
	 * 0		Checks if has HairOverHead
	 * 1		Checks if has HairBelowBody
	 * 2		Checks if has Hair( and HairShade )
	 * 3		Checks if has any Hair
	 * 4		Checks if has Face
	 * 5		Checks if has selected accessories
	 *
	 *     [USER=2000183830]para[/USER]m    int  $type 	 Determines which image it might remove.
	 *     [USER=850422]return[/USER]   boolean
	 *
	 */
	private function vslotCheck($type, $accType=null) {
		$vslot = $this->info['vslot'];
		$ret = true;
		switch($type){
			case 0:
				if(
					(strpos($vslot,'H1') !== false && strpos($vslot,'H4') !== false) || 
					(strpos($vslot,'H1') !== false && strpos($vslot,'H5') !== false)
				) { $ret = false; }
				break;
			case 1:
				if(strpos($vslot,'H2') !== false && strpos($vslot,'H3') !== false) {
					$ret = false;
				}
				break;
			case 2:
				if(
					(strpos($vslot,'H2') !== false && strpos($vslot,'Hf') !== false) || 
					(strpos($vslot,'Hd') !== false)
				){ $ret = false; }
				break;
			case 3:
			case 4:
				if(strpos($vslot,($type == 3 ? 'H1H2H3H4H5H6' : 'Fc')) !== false){ 
					$ret = false;
				}
				break;
			case 5:
				$removal = [['Ae', 'Ears'], ['Ay', 'Eyes'], ['Af', 'Mask']];
				foreach($removal as $parent){
					if (strpos($vslot,$parent[0]) !== false && ($accType == $parent[1])) {
						$ret = false;
					}
				}
				break;
		}
		return $ret;
	}
Some images with body, hair, and accessories.
QmUwTwW - [Development] GD Generation v2.0 - RaGEZONE Forums
3XDgwxR - [Development] GD Generation v2.0 - RaGEZONE Forums

At this point I was refrain from using v1.0 since I didn't add full vslot support. I will add my scripts up soon. I need to debug 2 items and fix my scripts a bit more.
 

Attachments

You must be registered for see attachments list

Rey

The Shrewd
Member
Joined
Oct 29, 2011
Messages
1,336
Reaction score
196
Good job about the hard work and the amazing update, but this is creepy as duck mate :
QmUwTwW - [Development] GD Generation v2.0 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Elite Diviner
Joined
Mar 24, 2015
Messages
426
Reaction score
416
Excuse my ignorance but not 100% sure what you're making here. Is it something that composes characters for rankings? If so I think you should be able to just have one script for equipment, no need to have a seperate one for 'cap', 'cape' and 'accessory'.

Good job about the hard work and the amazing update, but this is creepy as duck mate :
QmUwTwW - [Development] GD Generation v2.0 - RaGEZONE Forums

I know this player because I've played Intrinsic. He's about as charming as his chararacter looks.
 

Attachments

You must be registered for see attachments list
Joined
Jul 12, 2011
Messages
1,229
Reaction score
475
This is looking promising. If you can package your generation in so that everything is handled in one initial function call (a la MapleBit style), I will definitely replace the current system with yours.
 
Last edited:
Junior Spellweaver
Joined
Jun 3, 2010
Messages
164
Reaction score
41
Cool man. Cant wait to take ur vslot fuction to improve my GD Generation. Can i? xDD
Btw, how can you debug the vslot things in newer versions like GMS 1.69.1?You have a local server to see how its work in game or something like that?
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Good job about the hard work and the amazing update, but this is creepy as duck mate :
QmUwTwW - [Development] GD Generation v2.0 - RaGEZONE Forums
Yeah sorry lol, in the original Maplebit version GD the overhead hair is removed by "accident".

Excuse my ignorance but not 100% sure what you're making here. Is it something that composes characters for rankings? If so I think you should be able to just have one script for equipment, no need to have a seperate one for 'cap', 'cape' and 'accessory'.



I know this player because I've played Intrinsic. He's about as charming as his chararacter looks.
What I'm doing is basically you dump all XML regarding equips. When you finish dumping all XML it's like over 70,000ish files(hair alone was 5k), and each file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<imgdir name="01010000.img">
<imgdir name="info">
<canvas name="icon" width="26" height="28" basedata="iVBORw0KGgoAAAANSUhEUgAAABoAAAAcCAYAAAB/E6/TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAI1SURBVEhLtZSBdYMwDESzQlZgBVZgBVZgBVbwCqzACqzAClmhK7j6JwvcvNJA2uq9e06MfeeTZN9ORH7Cv0ZOY5snA78L/iVyGto8Ds0G5vzT34aRF6G+yUMB8/75b0IifXfXSAoRfFfsaLHqksamjI74fVXsu4Wag2RKXV6mPi9zn+dt7CR2tV4iYgzMRg6SkUC6zkNel2ET4T+iOA2UvT+GhKa0pwUX6zK6EwPEjyXlx2pzX8Q6OaJ+7IPLKY9DDkIE8ocJScyIw9FjTdsBWMvIvqGzWpkYPE53HEY4aDMpUZoQg9iElhmHu5jWWgaAUmjd2LXWlScaQ6fWCSUUTvr8sYm5y3AYDSFBG2kcUgiXUx6HnXbSaRFSPaiFXHi65FQiCLsrbwavL0JnxCTgbqIefnKE4jff3Ll1po3P9+q8K+uudYaYLpu2NKkh5MJSZtAVCLHyYjBeusDeWZFCik/7OymOeIqmEUFq5PPxDl65wIQE9lqQIid2JxC7i0gbo98pBxxO9TrkaD+xk3lLVy4MkTZeEhc6V6c6JAYpZBupQRfcALHexPIdcKfY6xTnQ5s8hf7khGDUqDMHurA2j2hrv9vmPTFCGyVmZBCSLqXTgDPEwuFvhCKCoNTD3ZFKxiptgUtxP8AzaY0fIwiaCm1BdwGxh/3wbRHkQdgbhoKxQvoG9fca7IUHTomFSAjEwiCaXqAWDRwKvXJyhFgbpIFI32HqAix6Rp37GvU+AFegxO32Cei94zkQWZLRAAAAAElFTkSuQmCC">
<vector name="origin" x="-4" y="28"/>
</canvas>
<canvas name="iconRaw" width="24" height="23" basedata="iVBORw0KGgoAAAANSUhEUgAAABgAAAAXCAYAAAARIY8tAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHqSURBVEhLtZQNlYQwDITXwlnAAhawgAUsYKEWsIAFLGABC2ehl2/SALc/LHu7l/fyAqWdSSYplxOWr/xfLKe+zoM5z8U/ajl1de67anXW/NNnzEALQVvlrjjr/vk9E3jbfCkiFUSvkjzaJN1TX5XoHs9nSe5t0BqHh9TkaWjzNLZ5XGMjkrP9EAAxfDRQPNlhwOaxy/PUreC8Q0Zl4eXsXRPBkLbyyXqees/cHMBlSnmZbe0XSaMK6A/nwHLIW1PGAQ7oYgQiMcCoYJnTSsxeIue6xnphJOA43K0ZUKdDlC45IAHQCKaRijYS7bWKcUll09XUNmUHDVeWykgEkXmbv1cSryoqikaLyCIDgVRgOeStWXaDsoNAeqO1snZZVJnAIfQqvMnePwiOSATs2YfenikE8cw3r9QmzeL1vXhehU3LPALI1AyrHGq0sjZpzDXKQVJuOPHUxfNJCaloKmPsYFTAL2PoIaIHvh7/qTMXDxPwpjVSOKBnDqBnHfIQ/U64g+FQj00VbBk6iI/mLmvzkIeb7wTHfdibSAADZAUz18U0B1D/rPId505w1iGemza7VP5rCKLoQWMZ66LZOmS1PdfVaySYDojEQABCFslmTiWQREV/IQiLg0VvrwbJiDt5wt+ya7C9m10uP2C6vOjCW4FqAAAAAElFTkSuQmCC">
<vector name="origin" x="-4" y="28"/>
</canvas>
<string name="islot" value="Af"/>
<string name="vslot" value="Af"/>
<int name="reqJob" value="0"/>
<int name="reqLevel" value="0"/>
<int name="reqSTR" value="0"/>
<int name="reqDEX" value="0"/>
<int name="reqINT" value="0"/>
<int name="reqLUK" value="0"/>
<int name="cash" value="1"/>
</imgdir>
<imgdir name="default">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABaSURBVChTYwCC/yACDwDL/797pgND4e6ZLv870pRA4ghFMEF0Gq7o/7vdYIUwSRCGaYQpAgG4QhANUwgSh0hDAFwRLlNgAEURiA8RxgQ4TUAHBBWAAJoiBgYA0ZhpMTO6aIoAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
</canvas>
</imgdir>
<imgdir name="blink">
<imgdir name="0">
<uol name="default" value="../../default/default"/>
</imgdir>
<imgdir name="1">
<uol name="default" value="../../default/default"/>
</imgdir>
<imgdir name="2">
<uol name="default" value="../../default/default"/>
</imgdir>
</imgdir>
<imgdir name="hit">
<imgdir name="0">
<uol name="default" value="../../default/default"/>
</imgdir>
</imgdir>
<imgdir name="smile">
<imgdir name="0">
<canvas name="default" width="11" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAABi8KSDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABoSURBVChTYwCC/yCCCABW9//umQ4wBguhgY40pf+7Z7rA5eCKQYIwSXQapA6iHMj4/243WANMEoRhBoDkIcogAKwYpgFEwzSA5CBKUAFcMT5TkQGKYhAfIowbEDQRHRCtEASwKGZgAADeynTQGkCPSAAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-45"/>
</imgdir>
<string name="z" value="accessoryFace"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="troubled">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABdSURBVChTYwCC/yACDwDL/9890wWrwo40JZA4RNHdMx3/oQJwANKIouj/u91whSBJEAbxoTbANcMVgmiYQpA4RBoC4IpwmQIDKIpAfIgwJsBpAjogqAAE0BQxMAAAGEBexOWPLLMAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-8" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="cry">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-9" y="-42"/>
</imgdir>
<string name="z" value="accessoryFace"/>
<string name="source" value="Character/Accessory/01010000.img/default/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="angry">
<imgdir name="0">
<canvas name="default" width="11" height="15" basedata="iVBORw0KGgoAAAANSUhEUgAAAAsAAAAPCAYAAAAyPTUwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABvSURBVChTYyAGdKQp/YcyGeAMXACqGKxuECnGqwFF8d0zHTgVIyuEAbCG3TNd/oMk0WmQPEQZBPz//243WANMEQjDDADJQ5QhAFwDiIZpAIlDpFEBXDEhU2EARTGIDxHGDQiaiA6IVggCWBQzMAAAD7Z7653xSnYAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-43"/>
</imgdir>
<string name="z" value="accessoryFace"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="bewildered">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABcSURBVChTYwCC/yACDwDL/9890wWrwo40JZA4RNHdMx0YikAaURT9f7cbrBAkCJIEYRAfagPcALhCEA1TCBKHSEMAXBEuU2AARRGIDxHGBDhNQAcEFYAAmiIGBgDM6Vy1eAxbFwAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="stunned">
<imgdir name="0">
<uol name="default" value="../../bewildered/0/default"/>
</imgdir>
</imgdir>
<imgdir name="vomit">
<imgdir name="0">
<canvas name="default" width="2" height="6" basedata="iVBORw0KGgoAAAANSUhEUgAAAAIAAAAGCAYAAADpJ08yAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAeSURBVBhXY4CC/wwdaUr/URm7Z7pAGDACBIAMBgYAbzsMsKTHifkAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-18" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="oops">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-8" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
<string name="source" value="Character/Accessory/01010000.img/troubled/0/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="cheers">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-44"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
<string name="source" value="Character/Accessory/01010000.img/default/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="chu">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-8" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
<string name="source" value="Character/Accessory/01010000.img/troubled/0/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="wink">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-9" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
<string name="source" value="Character/Accessory/01010000.img/troubled/0/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="pain">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-8" y="-44"/>
</imgdir>
<string name="z" value="accessoryFace"/>
<string name="source" value="Character/Accessory/01010000.img/troubled/0/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="glitter">
<imgdir name="0">
<uol name="default" value="../../default/default"/>
</imgdir>
<imgdir name="1">
<uol name="default" value="../../default/default"/>
</imgdir>
</imgdir>
<imgdir name="shine">
<imgdir name="0">
<canvas name="default" width="9" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAOSURBVChTYxgFdAUMDAABcgABpYaz3QAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-43"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
<string name="source" value="Character/Accessory/01010000.img/default/default"/>
</canvas>
</imgdir>
</imgdir>
<imgdir name="blaze">
<imgdir name="0">
<canvas name="default" width="10" height="8" basedata="iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABQSURBVChTYyAEds90+Q+kQJjh//93u//fPdPxvyNN6T9IAoRBfGRFIABWCFMMomGKQXIQJQgAV4jLNGSAohDEhwhjB3hNQgdEKQIBLAoZGAAnNlF8FTx2EgAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-13" y="-47"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="love">
<imgdir name="0">
<canvas name="default" width="10" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABiSURBVChTYwCC/yACH+hIUwKr+X/3TMf/3TNdMDSAxKCK4HJwxSAJdBokD1EGZPx/txusGKYAhJFsgisEAbhiEA1TDBKHSCMAXCE+02AARSGIDxHGDvCahA6IUgQCaAoZGADZ0mzYXfbgMAAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-46"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="despair">
<imgdir name="0">
<canvas name="default" width="9" height="11" basedata="iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAYAAACtWacbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABcSURBVChTYyAC/IcT2EBHmhJIDqLo7pkODIW7Z7r8x1AEEgRxQAAkiaHo/7vdYIUwSRBG0gjXDFcIomEKQeIQaQiAK8JlCgygKALxIcKYAKcJ6ICgAhBAU8TAAADsLmeZ7S+FDgAAAABJRU5ErkJggg==">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-12" y="-45"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="hum">
<imgdir name="0">
<canvas name="default" width="10" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVChTYxgFgxIwMAAAAZoAAXcn7CgAAAAASUVORK5CYII=">
<vector name="origin" x="16" y="27"/>
<imgdir name="map">
<vector name="brow" x="-11" y="-48"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
<string name="source" value="Character/Accessory/01010000.img/love/0/default"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="bowing">
<imgdir name="0">
<canvas name="default" width="10" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVChTYxgFgxIwMAAAAZoAAXcn7CgAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-46"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
<string name="source" value="Character/Accessory/01010000.img/love/0/default"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="hot">
<imgdir name="0">
<canvas name="default" width="10" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVChTYxgFgxIwMAAAAZoAAXcn7CgAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-46"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
<string name="source" value="Character/Accessory/01010000.img/love/0/default"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
<imgdir name="dam">
<imgdir name="0">
<canvas name="default" width="10" height="10" basedata="iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVChTYxgFgxIwMAAAAZoAAXcn7CgAAAAASUVORK5CYII=">
<vector name="origin" x="15" y="25"/>
<imgdir name="map">
<vector name="brow" x="-10" y="-46"/>
</imgdir>
<string name="z" value="accessoryFaceBelowFace"/>
<string name="source" value="Character/Accessory/01010000.img/love/0/default"/>
</canvas>
</imgdir>
<imgdir name="1">
<uol name="default" value="../0/default"/>
</imgdir>
</imgdir>
</imgdir>
Putting that into perspective, to download the dump it would need a good 2-3GB. That is inefficient as hell. So what I do, is eliminate files that are considered blank images, icon image only, etc. Also I narrow down what each file contains to below:
{"x":-5,"y":19,"z":"accessoryFace","d":"iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABaSURBVChTYwCC/yACDwDL/797pgND4e6ZLv870pRA4ghFMEF0Gq7o/7vdYIUwSRCGaYQpAgG4QhANUwgSh0hDAFwRLlNgAEURiA8RxgQ4TUAHBBWAAJoiBgYA0ZhpMTO6aIoAAAAASUVORK5CYII="}
This is a lot easier to read, and doesn't have useless information. Now to accomplish this I need scripts to apply to each type of XML since every category has their own style(just check the scripts in the main post and try comparing them, they are handled differently due to how Nexon wanted to read them).

The reason why I separate them is the execution time takes a while due to the shitload of files that each style of equip dumps(Accessories:2090 files, Cap 2006 files, Hair:5880 files). I'll use accessories for example, my first loop is to read all 2090 files, then with that I add more loops to read through the file to find 'default' (which has the image I'm looking for) then another loop for all the canvas found inside this(default, defaultAc, etc) and store the x,y,and basedata and write a JSON file. After the JSON file it goes on to the next ID and does all of that again. PHP tends to hang after awhile which is why all my scripts has " ini_set('max_execution_time', 14000);" to allow longer execution time. Now imagine it takes a good 8-9 seconds or so to create the accessory files. I would need more or less a good 4 minutes of non stop executing to dump ALL the JSON files. PHP doesn't allow that long of a execution time. Plus putting all of my scripts into one file would be kind of..bad. I might consider it and give it a try..after I finish making all my scripts, but for now since I debug stuff I rather not do that.

This is looking promising. If you can package your generation in so that everything is handled in one initial function call (a la MapleBit style), I will definitely replace the current system with yours.
Yeah I plan on making a page that runs all of these scripts one at a time and use jQuery and stuff. Also I will implement it to your rankings since your CMS is the most updated.

Cool man. Cant wait to take ur vslot fuction to improve my GD Generation. Can i? xDD
Btw, how can you debug the vslot things in newer versions like GMS 1.69.1?You have a local server to see how its work in game or something like that?
Uhh by all mean, you can use it, just be careful not to use it wrong. I debugged the vslot by what the cap, and what part of the hair is needed to be removed, some of it was common sense because when I added a hat on a character it was clear the hairOverHead was removed because it overflow from the cap. Others I needed to test how it looks in game, so I let Lynx1213 test the items in game in his server. I recently told him to test two items because I was trying to figure out a pattern on when to remove the hairBelowBody. like is it when vslot has H2, or H2Hf, or H1H5, etc. Once I find a patter there were two items that didn't have my predicted pattern and yet it looked like belowbodyhair should be removed, then he provides me with how the item looks in game and it turns out the hairbelowbody doesnt get removed, so my vslot pattern still holds and my vslot pattern doesn't break.

I thought this item needed to remove the below body but it turns out it doesn't but it looked like it did due to it being a damn hood(lol nexon):
Lp3SzDK - [Development] GD Generation v2.0 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list

Rey

The Shrewd
Member
Joined
Oct 29, 2011
Messages
1,336
Reaction score
196
Yeah but like, he looks like an alien version of Heihachi Mishima from Tekken, lol.

Anyways great job mate, keep going i like your work!
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Update:
Alright so I'm still fixing up my hair script to be 100% optimized, and I found an unused canvas which I haven't called yet, named "hairBelowHead", upon check all the IDs that have this canvas(only 15 hair id have them[the original + the original in different colors], I noticed the z value of some of them is "hairBelowBody" So I decided when writing the JSON file, the hairBelowHead acts like hairBelowBody. Plus, if you have hairBelowHead, the hairBelowBody image is blank so it's safe to replace belowbody with belowhead.

Then the remaining would be the "hairBelowHead" with z value "hairBelowHead". When I checked almost all of them(98% of them redirect to) call for this image below:
GfzOgiW - [Development] GD Generation v2.0 - RaGEZONE Forums
This image is literally covered by the hair at all times, the hairShade cover this so this image technically is useless to get info on(I check with and without this image on characters and there was absolutely no difference). So in the end of the day I will add support to "hairBelowHead" but to only the ones wit hz value "hairBelowBody", otherwise I will skip this information and it's useless.

Next Task: Now I am checking the actual storage at the end before writing the JSON file and check for duplicate imaging, which I would check if I should remove them or not since they are duplicate imaging being stored but with different values, I already found all the IDs with duplicate images below:
PHP:
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030740.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030741.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030742.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030743.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030744.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030745.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030746.img.xml ||| 1
Array ( [0] => d_hair [1] => d_hairOverHead ) 00030747.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031200.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031201.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031202.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031203.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031204.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031205.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031206.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031207.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031210.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031211.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031212.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031213.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031214.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031215.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031216.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hair ) 00031217.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032660.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032661.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032662.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032663.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032664.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032665.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032666.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00032667.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033390.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033391.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033392.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033393.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033394.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033395.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033396.img.xml ||| 1
Array ( [0] => d_hairBelowBody [1] => d_hairBelowHead ) 00033397.img.xml ||| 1
Array ( [0] => d_hairOverHead [1] => d_hairBelowBody ) 00038920.img.xml ||| 1
I'm going to debug these soon to check if I should remove duplicated images or not. For those that dont understand the above, it prints the two values that have the same base64 image and the id. Also if you noticed it's really 4 different styles of hair but each of those hair have different colors.

Conclusion: I am going very in depth on this to make this the most optimized GD to not break from one version to the next. The whole point for this type of GD is to not download huffy GD that is like 1.2 GB or so. I am going out of my way to optimize this from every part. I dont want useless image being called when the character is created. rip.
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Jul 12, 2011
Messages
1,229
Reaction score
475
So if I'm understanding this correctly, you're parsing the WZ files (XML) to generate item JSONs with positions and the base64 encoded image? If so, I was just wondering why you decided to use PHP for this (over Java/Python)
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
So if I'm understanding this correctly, you're parsing the WZ files (XML) to generate item JSONs with positions and the base64 encoded image? If so, I was just wondering why you decided to use PHP for this (over Java/Python)
I could of done Java honestly, however since this is a GD for a website, I rather work with web languages to keep it simple, I dont want people to download a Java IDE just to run multiple java codes. Besides the one extra line needed to prolong the execution time, I see no problem using PHP over Java. Python I have no experience with yet so that's out of the picture lol. Also PHP is one of my strongest web languages, followed by C#(learning for two semester at my college)
 
Last edited:
(O_o(o_O(O_O)o_O)O_o)
Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
I could of done Java honestly, however since this is a GD for a website, I rather work with web languages to keep it simple, I dont want people to download a Java IDE just to run multiple java codes. Besides the one extra line needed to prolong the execution time, I see no problem using PHP over Java. Python I have no experience with yet so that's out of the picture lol.

Could pack it in an executable, most people would have JRE available anyway, but meh, i'm good with php.

Sounds to me like it's a language you're comfortable with, if you know you can easily do it in this language, that's reason enough to use it over another.
 
may web.very maple.pls.
Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Could pack it in an executable, most people would have JRE available anyway, but meh, i'm good with php.

Sounds to me like it's a language you're comfortable with, if you know you can easily do it in this language, that's reason enough to use it over another.
Yeah, PHP is one of my strongest web languages, followed by C#(learning for two semester at my college) atm. If I were to move to Java I would actually be slower on debugging and what not trying to remember/relearn most of the Java functions, but it's doable.

Novak
Out of curiosity can Java replicate this code? I feel it lacks some of the array function and flexibility that PHP has :
PHP:
print_r(array_diff(array_slice(scandir('greater_than_0/'), 2), array_slice(scandir('greater_than_3/'), 2)));
Array_diff compares two array and find the difference, array_slice removes the first two values in the array(./, and ../), and scandir scan all the files inside a folder. Just curious on how much Java can do in terms of array manipulations since I play with a shitload of arrays in these scripts.
 
(O_o(o_O(O_O)o_O)O_o)
Member
Joined
Apr 9, 2009
Messages
1,088
Reaction score
322
Yeah, PHP is one of my strongest web languages, followed by C#(learning for two semester at my college) atm. If I were to move to Java I would actually be slower on debugging and what not trying to remember/relearn most of the Java functions, but it's doable.

Novak
Out of curiosity can Java replicate this code? I feel it lacks some of the array function and flexibility that PHP has :
PHP:
print_r(array_diff(array_slice(scandir('greater_than_0/'), 2), array_slice(scandir('greater_than_3/'), 2)));
Array_diff compares two array and find the difference, array_slice removes the first two values in the array(./, and ../), and scandir scan all the files inside a folder. Just curious on how much Java can do in terms of array manipulations since I play with a shitload of arrays in these scripts.

Commons Collection ListUtils can do the same as array_slice in 1 line iirc. But as far as i know you can't scan an entire directory as easily. I've never really enjoyed the java file utils.

You'd probably have to write a small fileSearcher and call that in order to keep it as one liners on all those lines. I'm convinced java can do the same as PHP, and probably more, but it's not always tailored to specific use as much :p
 
Back
Top