Game Development Community

Fixed! - Un-selection does not work properly

by Novack · in RTS Starter Kit · 09/27/2007 (9:17 pm) · 5 replies

Priority: Low
Category: Improper functionality in all configurations
Reproducable: Yes

Summary: The common (left) click do not work properly when its done over the tarrain to un-select units

Fix: In starter.RTS\client\scripts\inputHandler.cs add the lines in bold below:

function GuiRTSTSCtrl::onMouseDownTerrain(%this, %x, %y, %z)
{
   switch$($CommandMenu::CurrentCommand)
   {
      case "Move":
         if(%this.selectionIncludesTeam)
            commandToServer('IssueMove', %x, %y, %z);
         %this.setCommandState("None");
[b]      case "None":
         if(!%this.selectionLocked)
            %this.clearTheSelection(%this);[/b]
   }
   
}

Notes: Soon this and other fixes will be included in the incomming 2nd revision of the port to TGE 1.5.2 patch. Credits for the report scheme goes to Stephen Zepp ;)

#1
10/01/2007 (3:06 pm)
Thanks Novack! I thought it seemed a little strange that the only way I could un-select was to click and drag over the terrain instead of just clicking.
#2
10/01/2007 (3:08 pm)
You're welcome! ;)
#3
10/01/2007 (3:19 pm)
Although I did notice a problem:

If you select some units and have them attack an object, then click to unselect, nothing is unselected. Even if you click and drag blank terrain.

This is because the CurrentCommand is still set to Attack, instead of defaulting to None after the command to attack is given.

EDIT: I just noticed you mentioned this same thing in this thread:

www.garagegames.com/mg/forums/result.thread.php?qt=23414
#4
10/01/2007 (3:33 pm)
Ha! we are again on the same tracks :)
#5
10/19/2007 (4:38 pm)
Note: I have edited the fix adding this line:
if(!%this.selectionLocked)
for a proper, more solid and useful solution.