Game Development Community

Units and Buildings being selected

by Daniel Bennifer · in RTS Starter Kit · 01/02/2009 (1:03 am) · 2 replies

Hey,
Noticed this a while back.. While selecting units if a building gets in the way, Its also selected. Is there a known fix for this?

(Will do some looking around myself, But im not that good with the scripts/programming just yet ;) )

#1
01/02/2009 (4:08 am)
Mhhh fixed this one sometime ago... try this:

In example\starter.RTS\client\scripts\selection.cs, at the function updateDragSelect (top of the file):

function GuiRTSTSCtrl::updateDragSelect(%this, %obj)
{
   if(isObject(%obj))
      switch$(%obj.getClassName())
      {
         case "RTSUnit":
            %this.dragSelectObject(%obj);
         //case "RTSBuilding":                         < -- comment out this
         //   %this.addToSelection(%obj);       < -- two lines
         case "RTSBuilding":                               // and add 
            %this.dragSelectObject(%obj);         // this two
      }
}
#2
01/04/2009 (11:55 pm)
Thanks Novack :)