Game Development Community

How to use decal for visible destination marker

by Jeff Yaskus · in RTS Starter Kit · 03/16/2010 (12:51 am) · 0 replies

How to make a "icon" appear on the landscape ... when you right click [with unit(s) selected].


client inputHandler.cs
function GuiRTSTSCtrl::onRightMouseDownTerrain(%this, %x, %y, %z)
{
   if(%this.selectionIncludesTeam)
      {
         commandToServer('IssueMove', %x, %y, %z);
      // Get the X,Y,Z position of where we clicked
      %pos = %x SPC %y SPC (%z + 50);
               
      _sgDropDecal(%pos,"1 0 0","0 0 1","4 4 4",DestMarker);
      }

and server base.cs
datablock DecalData(DestMarker)
{
   sizeX       = 0.5;
   sizeY       = 0.5;
   textureName = "~/data/shapes/g_marker";
};

NOTE:
I only tested it on my code base so you might need to apply this other fix as well (only if above isn't enough)

"How to re-enable footprints"
http://www.torquepowered.com/community/forums/viewthread/111753