The Dink Network

Reply to Tile Bounds test (600x550 tileset placing)

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
July 18th 2021, 01:28 PM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
AS some may know, and credit where credit is due, as firstly properly documented by magicman here:
error in map_tile documentation

It was determined that the DinkC Reference was wrong when it comes to the map_tile command.
It was also determined that even though all editors currently show a maximum of 8 rows for a tileset, you could actually have 11 (with the 11th row having 8 tiles), since the engine counts 128 tiles per tileset.

Magicman mentioned in that thread you may be able to access these extra tiles with scripting (since you can't in the editor), if the engine doesn't do any bounds checks on the tile rows. I haven't seen anyone test this out, so I decided to do it, and you can indeed use all the extra tiles, including the 8 on row 11.

I used the following tileset, which is 600 by 550:
ts17 (600 x 550)

I then wrote the following script that will take tile number 2084, which is tile 1 of row 4 on the tileset I created and paste it in map tile position 1 of the screen. I started with row 4 so we can actually see what we are trying to achieve, since a screen would not be able to show a tileset that big and we would run out of room. the "&tsmax" local variable basically just makes it stop pasting tiles when it gets to the last tile of the tileset I created. Here's the script:
tileex.c

and indeed, you can access the extra tiles! Here's the result:
Accessing extra map tiles with "map_tile()"

Based on this test being succesful, I have edited my "Get Tile" google sheet. Here's my updated Google Sheet for calculating a tile number, with the ability to enter a max row of 11 (and Max column of 8 if row = 11):
Get Tile Number for "map_tile" function