Game Development Community

RTSUnit AdvCamera

by Wolfgang Kurz · in RTS Starter Kit · 11/14/2006 (2:37 pm) · 0 replies

Hello all,

i am trying to combine the adv Camera Ressource with the RTS pack

its working very well so far but now i am trying the switch the player class for the RTSUnit Class and the unit doesnt appear

at least i am not crashing anymore but the scene renders without the unit being rendered.

so i am guessing i have to do some extra to make it spawn

here is my code:

function RTSConnection::CreatePlayer(%this, %spawnPoint)
{
   if (%this.player > 0)//The player should NOT already have an avatar object.   
		{                     // if he does, that's a Bad Thing.      
		Error( "Attempting to create an angus ghost!" );   
		}       // Create the player object   
		
		%player = new RTSUnit() 
      {
         scale = "1 1 1";
         dataBlock = riflemanBlock;
         shapeFile = "~/data/shapes/player/player.dts";
         path = "";
      };                            
			
		// Create a new RTS camera object.   
			
		%this.advCamera = new AdvancedCamera()   {      
			dataBlock = AdvCameraData;   
		};   
		
		MissionCleanup.add( %this.advCamera );   
		%this.advCamera.scopeToClient(%this);      
		
		// Player setup...   
		
		%player.setTransform(%spawnPoint); // where to put it        
		
		// Give the client control of the player   
		
		%this.player = %player;   
		%this.setControlObject( %this.player);   // Do scoping      
		//%this.player.scopeToClient(%this);    
		%this.advCamera.setPlayerObject(%player);     
		%this.advCamera.setOrbitMode();    
		%this.advCamera.setFollowTerrainMode(true);    
		%this.advCamera.setVerticalFreedomMode(false);     
		%this.setCameraObject(%this.advCamera);
}

anyone have an idea what i am being missing please?