Active Tile Problem (TGB bug?)
by Johnny Sprada · in Torque Game Builder · 04/23/2009 (5:30 pm) · 4 replies
Hi,
I'm having trouble setting up active tiles, specifically, t2dGunTurret type. When I use the following code, the existing tile image is wiped out, and the new image isn't getting set. So my tiles are blacked out. When I getTileType, they are returned as the proper type, the image just isn't being set. Is this a bug, or am I doing something wrong?
Here's my code:
I'm having trouble setting up active tiles, specifically, t2dGunTurret type. When I use the following code, the existing tile image is wiped out, and the new image isn't getting set. So my tiles are blacked out. When I getTileType, they are returned as the proper type, the image just isn't being set. Is this a bug, or am I doing something wrong?
Here's my code:
%towerObj = %this.setActiveTile(%position, t2dGunTurret);
%towerObj.setImageMap("tilesImageMap", %adjustedTower);About the author
#2
The turret code can be found in engine\source\T2D\activeTiles\t2dGunTurret.h (.cc).
04/24/2009 (10:46 pm)
t2dGunTurret seems to be broken. I had some trouble with it myself (link). Meanwhile I bought the Pro update, fixed that rotation problem myself and wrote a turret behavior instead of getting deeper into the t2dGunTurret class.The turret code can be found in engine\source\T2D\activeTiles\t2dGunTurret.h (.cc).
#3
Did you apply your behavior to the active tile, or is it separate from the tilemap all together?
Would you, by chance, be willing to share your behavior, or bits of it?
Thank you.
04/25/2009 (8:22 am)
Ah yes, I saw your post a while back, and have been searching for it all night, looking for a fix. Did you apply your behavior to the active tile, or is it separate from the tilemap all together?
Would you, by chance, be willing to share your behavior, or bits of it?
Thank you.
#4
I don't use it with an active tile, just with a static sprite.
04/25/2009 (9:50 am)
I've just posted this resource.I don't use it with an active tile, just with a static sprite.
Torque Owner Johnny Sprada
I can get my active tile (t2dGunTurret) to display the proper image, but only if I set it to track an object.
I can only set it to track an object, if I set the objects name.
If the named object (enemy, in this case) gets deleted (killed) then ALL turrets set to track that enemy have their image disapear.
Has anyone else experienced this, or is it repeatable?
Can anyone please advise where to locate the C++ code that handles Active Tiles/t2DGunTurrets? I'm not afraid to get in there to take a peek, if I knew where it was.
Thank you.