| DustyPorViva |
12-12-2009 09:53 PM |
Customized Tileset Templates
Right now we have addtiledef(img,prefix,type). I suggest that servers are able to upload templates and access them via the type. How this can be done could possibly be via a special folder named TileTypes, where you can upload a txt file like so...
TileTemplate#.txt and use it like so: addtiledef(img,prefix,#);
Inside the file would be the arrays that store the tiles of your desired tile types in such a format:
PHP Code:
type_22 = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0x100,0x101,0x102,0x103,0x104,0x105,0x106,0x107,0x108,0x109,0x10A, 0x110,0x111,0x112,0x113,0x114,0x115,0x116,0x117,0x118,0x119,0x11A, 0x120,0x121,0x122,0x123,0x124,0x125,0x126,0x127,0x128,0x129,0x12A, 0x130,0x131,0x132,0x133,0x134,0x135,0x136,0x137,0x138,0x139,0x13A, 0x140,0x141,0x142,0x143,0x144,0x145,0x146,0x147,0x148,0x149,0x14A, 0x150,0x151,0x152,0x153,0x154,0x155,0x156,0x157,0x158,0x159,0x15A, 0x160,0x161,0x162,0x163,0x164,0x165,0x166,0x167,0x168,0x169,0x16A, 0x170,0x171,0x172,0x173,0x174,0x175,0x176,0x177,0x178,0x179,0x17A, 0x180,0x181,0x182,0x183,0x184,0x185,0x186,0x187,0x188,0x189,0x18A, 0x190,0x191,0x192,0x193,0x194,0x195,0x196,0x197,0x198,0x199,0x19A, 0x1A0,0x1A1,0x1A2,0x1A3,0x1A4,0x1A5,0x1A6,0x1A7,0x1A8,0x1A9,0x1AA, 0x1B0,0x1B1,0x1B2,0x1B3,0x1B4,0x1B5,0x1B6,0x1B7,0x1B8,0x1B9,0x1BA, 0x1C0,0x1C1,0x1C2,0x1C3,0x1C4,0x1C5,0x1C6,0x1C7,0x1C8,0x1C9,0x1CA, 0x1D0,0x1D1,0x1D2,0x1D3,0x1D4,0x1D5,0x1D6,0x1D7,0x1D8,0x1D9,0x1DA, 0x1E0,0x1E1,0x1E2,0x1E3,0x1E4,0x1E5,0x1E6,0x1E7,0x1E8,0x1E9,0x1EA, 0x1F0,0x1F1,0x1F2,0x1F3,0x1F4,0x1F5,0x1F6,0x1F7,0x1F8,0x1F9,0x1FA }; type_11 = { 0xB, 0xC, 0xD, 0xE, 0xF,0x200,0x201, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,0x210,0x211, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,0x220,0x221, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,0x230,0x231 }; type_9 = { 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,0x240,0x241, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,0x250,0x251, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,0x260,0x261, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,0x270,0x271, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,0x280,0x281, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,0x290,0x291, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,0x2A0,0x2A1, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,0x2B0,0x2B1, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,0x2C0,0x2C1, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,0x2D0,0x2D1, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,0x2E0,0x2E1, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,0x2F0,0x2F1 };
The numbers reflect the default values:
0 nonblocking
2 hurting underground
3 chair
4 bed upper side
5 bed lower side
6 swamp
7 lava swamp
8 near water
9 near lava
11 water
12 lava
20 throw-through (fences)
21 jumping stone
22 blocking tile
However, alternatively, there could be a much more simpler system where an image is used... color values can represent tiletypes(like how the level generator does). People can lay out a template over a regular sized tileset and shrink it so that each tile is represented by a single pixel, like so:
http://i48.tinypic.com/33k8a4n.png
I guess ideally Graal would download and encrypt these definitions on a per-server basis. Either way, I'd love either one of these suggestions to be implemented. The image template seems like the easiest for anyone to work with though may be more complicated for Stefan to work with as it would involve translating an image into an array and such. Though if the first is implemented, it would be fairly easy to make a script that would process an image template and sort it into arrays.
Would be really cool to allow us to customize our own tileset layouts, though.
|