Getting RTSUnitTypeName from the engine
by Liu Yi · in RTS Starter Kit · 05/22/2006 (2:43 am) · 2 replies
Hi, i'm kinda new to torque and am working on a city building game based on the rts starter kit
I need to get the RTSUnitTypeName from the datablock (shown below) in the engine but i don't really know how to access it...
using the following code,
is there any way to retrieve the string "ResidentialTile" from the engine?
regards
Liuyi
I need to get the RTSUnitTypeName from the datablock (shown below) in the engine but i don't really know how to access it...
datablock RTSUnitData(r_tileBlock : UnitBaseBlock)
{
shapeFile = "~/data/shapes/tiles/r_tile.dts";
RTSUnitTypeName = "ResidentialTile";
boundingBox = "32.0 32.0 6.0";
};using the following code,
RTSUnit* unit = dynamic_cast<RTSUnit*>(ri.object);
Con::printf("ClassName = %s",unit->getClassName() ); //gives me RTSBuilding
Con::printf("db ClassName = %s",unit->getDataBlock()->className ); //gives me RTSUnitDatais there any way to retrieve the string "ResidentialTile" from the engine?
regards
Liuyi
#2
I just found out tat i just needed to add the field in the engine
thanks for replying anyway =)
05/23/2006 (2:15 am)
Okies never mind. I just found out tat i just needed to add the field in the engine
thanks for replying anyway =)
Torque Owner Johnathan Moore