Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Level Design (https://forums.graalonline.com/forums/forumdisplay.php?f=6)
-   -   Getting tile location (https://forums.graalonline.com/forums/showthread.php?t=134267682)

sssssssssss 12-29-2012 04:46 PM

Getting tile location
 
In the graal editor you can view a tile location like 0x1A2, where its not just the tiles[x,y] since number as 412.

Unless there is some magic I can't get a tileset type 1 to load in the graal editor, so I went to gonstruct. Gonstruct just gives the single number like 421 as far as I saw, so how do yall get these locations?

Might be better served in the scripting part. Wasn't sure...

zerxusgraal 12-29-2012 04:52 PM

You can load type 1 in editor
Just add
Addtiledef tileset.png,,1;

sssssssssss 12-29-2012 04:57 PM

I did that its just black and no tileset loaded. I also made sure it's the right name and all, and even moved it to the folder with the levels in it.

mewtoo18 12-29-2012 05:01 PM

I am asumming you are trying to figure out where the tile is on the tileset.. like how many tiles to the left and down to find the tile you see in the level.. It would take be a bit to explain but if you understand php maybe you can cut out what you need from this:

http://pastebin.com/f74418c73

But to try and explain it simply.

PHP Code:

  $base64 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  
$temp $test[$k][$i]; // your tile number
  
$tile dechex(strpos($base64,$temp[0])*64+strpos($base64,$temp[1])); // the hex value for tile
  
$tilex hexdec(substr($tile0, -1)) % 32;
  
$tiley floor(hexdec(substr($tile0, -1))/32)*16 hexdec(substr($tile, -1)); 

But I think I may have had my x and y backwards.. either way it should give you the positions.. this is kinda old.. wish I could find the post that explained it on the the forums..

zerxusgraal 12-29-2012 05:02 PM

There is a color limit or filesize limit im not sure but its 1 of those
Take you tileset and make it indexed color in ps

scriptless 12-29-2012 05:07 PM

Quote:

Originally Posted by zerxusgraal (Post 1711087)
There is a color limit or filesize limit im not sure but its 1 of those
Take you tileset and make it indexed color in ps

It used to be 256 color's. But I don't know if that only applies to the offline Editor of if the online Game itself can handle more.. might also be filesize tho. dunno

sssssssssss 12-29-2012 05:09 PM

That did it. xD

Thank you.

scriptless 12-29-2012 05:13 PM

Which part was helpful?

Gos_pira 12-29-2012 05:44 PM

The offline editor only supports 256 colors. (the official one)

That editor is basically a downscaled Graal v2.3 client. Images with more colors wasn't introduced until Graal v4. The level editor hasn't been updated since then.

sssssssssss 12-29-2012 05:50 PM

Quote:

Originally Posted by scriptless (Post 1711091)
Which part was helpful?

Taking the tileset and indexing the color instead to 256.

zerxusgraal 12-29-2012 06:16 PM

Cool :)


All times are GMT +2. The time now is 01:11 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.