Game Development Community

Simple scripting question

by James Petruzzi · in Torque Game Builder · 04/26/2007 (10:18 pm) · 2 replies

I'm sure this is completely simple, but how to do you grab one value from a list returned from a function? i'm calling getTileCollision(%tileX, %tileY) and its returning a bunch of values in a string

my code is something like:

%tmp = mainTileMap.getTileCollision(%x, %y);

%tmp then has: active xScale yScale edgeCount x1 y1 x2 y2.. how do i assign just one of those values, namely active, to a variable?

thanks!

#1
04/27/2007 (4:15 am)
The getWord function is what you are looking for.

%tmp = mainTileMap.getTileCollision(%x, %y);
%isactive = getWord(%tmp,0);
%xscale = getWord(%tmp,1);
etc..

G
#2
04/27/2007 (6:22 am)
Exactly what i was looking for :)

Thanks!!