Game Development Community

RC2: Can any1 get tile count with the getTileCount() function?

by Leroy Frederick · in Torque Game Builder · 06/12/2006 (4:31 am) · 2 replies

As the title suggests, i keep getting the error message 'wrong number of arguments' even though the 'getTileCustomData()' requires the same amount/type of arguments and works without problem.

Can any1 else confirm/refute this, and if you can get it to work/have a work around, please share :)

EDIT: just in case i'm scripting it wrong, here's my syntax:

$LayerNum.getTileCount($TileNum));

where $LayerNum contains a value such as "2644"
where $TileNum contains a value such as "10 14"

EDIT 2:

Ok, sorry, i got it wrong it's meant to be like this:

$LayerNum.getTileCount());

Although i thought this would give the amount of actual painted/filled tiles as oppose to the width & height count.

#1
06/12/2006 (4:41 am)
Try:
echo ($layerNum.getTileCount());
You don't pass anything into getTileCount. It will then return a string like "10 14" indicating the number of tiles in the X and Y directions.
#2
06/12/2006 (4:55 am)
Hey Philip, you posted the solution while i was editing, snap! Thanks anyway :)

It's the reference doc that confused me, while some entrie have just a 'getWhateverData();' others have things like 'getWhateverData(Argument1,Argument2);' such as getTileCount(%tileX, %tileY) in the ref doc. Perhaps that's where the error/bug lies as it could confuse other users too!

EDIT:
I'm off to look for myself, but in case any knows the answer already, what command am i looking for to find out how many active/filled tiles there are in a layer?