Game Development Community

scaling units in RTS Kit

by Jeff Yaskus · in RTS Starter Kit · 02/12/2010 (3:15 am) · 1 replies

I figured out how to scale down some units ... just required a change to the create player script.

However, it has the odd effect of
a) the health bar is scaled as well (the length, not height)
b) to click on the unit, you have to click right in its center or drag select it

I tried increasing the size of my bounding box, which helps with (b) but then the selection ring is enormous for the unit.

Any ideas how to properly scale a RTSUnit ?

function RTSConnection::createPlayer(%this, %spawnPoint, %index)
{
   %scale="1.0 1.0 1.0";
   
   switch(mAbs(%index) % 5) // GUY changed to mAbs(%index) due to fixed modulus function
   {
      case 0:
         %data = botBlock;
      case 1:
         %data = knightressBlock;
         %scale="0.15 0.15 0.15";
      case 2:
         %data = warriorBlock;
      case 3:
         %data = riflemanBlock;
      case 4:
         %data = shockerBlock;
   }   
      
   %player = new RTSUnit() 
      {
         scale = %scale;
         dataBlock = %data;
         shapeFile = "~/data/shapes/player/player.dts";
         path = "";
      };

#1
02/12/2010 (4:19 pm)
Is not really related to big selection ring on big bounding box but at the place where I fixed the scaling you could modify the size of the selection ring:

www.torquepowered.com/community/forums/viewthread/74158