Game Development Community

Tilemap custom data retreival?

by Gavin Beard · in Torque Game Builder · 03/14/2008 (1:52 am) · 0 replies

Hi all,


probably very simple, i see there is a function getTileCustomData(int tileX, int tileY), how would i use this to get the custom data from a tile on the map that i click on, i have setup a function:

function mBaselyr::onMouseDown(%this, %modifier, %object, %mouseClicks)
{
%tmpVec= picktile(%object.x,%object.y);
echo (%this.getTileCustomData(%tmpVec.x,%tmpVec.y));
}

which works on the first few clicks, but is always a couple of tiles out, but after 3 - 4 clicks in the console, i get unable to find function PickTile

any ideas?

big thanks

*EDIT
skip that,
my own fault - this works:

function mBaselyr::onMouseDown(%this, %modifier, %worldPosition, %mouseClicks)
{
echo (%this.getTileCustomData(%this.picktile(worldPosition)));
}