First, you can't refere to an object by the name of its object type in a create action. So CreateObject varAvailabTowers.at(ROW,COL) at (X,Y) isn't really possible like that.
However there's a work around: put all your different tower in different animation frame of the same object, and store this data in your array.
I don't have enough information to really grasp what you want to do, but it looks like you have a map in your array that holds the position of some towers.
So basically the creation process should look like:
[code]Global number gridX = 0 // X position of top left corner of the map
Global number gridY = 0 // Y position of top left corner of the map
Global number cs=32 // grid cell size
Global number cols = 10 // number of columns of the map
Global number rows = 10 // number of rows of the map
+ On Start of layout
+ For "y" from 0 to rows-1
+ For "x" from 0 to cols-1
-> Create mapObject at (gridX + loopindex("x")*cs , gridY + loopindex("y")*cs)
-> mapObject: set animation frame to map.At(loopindex("x"),loopindex("y"))[/code]
If your mapObjects have some animation, you should suffix the animation name with an ID and use a private variable to identify the object.
The last line would be changed to
[code] -> mapObject: set objID to map.At(loopindex("x"),loopindex("y"))[/code]
Then you will just have to always play your animation like that:
[code] -> mapObject: set animation to "Attack_"&mapObject.objID[/code]
With this technique you can not only place towers but any object you want to set (trees, bushes, rocks, etc) The only downside is that you can only have one object per cell (unless you use a 3D array for layering)
That's allYann2012-07-11 07:11:06