Browse Source

Removes Entity/Component stuff from being behind an experimental flag.

Areloch 7 years ago
parent
commit
0c21ef1b45
38 changed files with 176 additions and 732 deletions
  1. 2 18
      Engine/source/T3D/gameBase/gameConnection.cpp
  2. 0 4
      Engine/source/T3D/gameBase/processList.cpp
  3. 0 6
      Engine/source/T3D/gameBase/std/stdGameProcess.cpp
  4. 1 10
      Engine/source/gui/controls/guiTreeViewCtrl.cpp
  5. 0 4
      Engine/source/gui/editor/guiInspector.cpp
  6. 1 4
      Engine/source/gui/editor/inspector/dynamicGroup.cpp
  7. 0 4
      Engine/source/scene/sceneRenderState.cpp
  8. 16 0
      Templates/BaseGame/game/core/CoreComponents.module
  9. 8 0
      Templates/BaseGame/game/core/components/RigidBodyComponent.asset.taml
  10. 8 0
      Templates/BaseGame/game/core/components/animationComponent.asset.taml
  11. 3 2
      Templates/BaseGame/game/core/components/cameraOrbiterComponent.asset.taml
  12. 3 2
      Templates/BaseGame/game/core/components/collisionComponent.asset.taml
  13. 4 2
      Templates/BaseGame/game/core/components/game/camera.asset.taml
  14. 66 77
      Templates/BaseGame/game/core/components/game/camera.cs
  15. 4 1
      Templates/BaseGame/game/core/components/game/controlObject.asset.taml
  16. 0 0
      Templates/BaseGame/game/core/components/game/controlObject.cs
  17. 4 1
      Templates/BaseGame/game/core/components/game/itemRotate.asset.taml
  18. 0 0
      Templates/BaseGame/game/core/components/game/itemRotate.cs
  19. 4 1
      Templates/BaseGame/game/core/components/game/playerSpawner.asset.taml
  20. 20 12
      Templates/BaseGame/game/core/components/game/playerSpawner.cs
  21. 3 1
      Templates/BaseGame/game/core/components/input/fpsControls.asset.taml
  22. 0 0
      Templates/BaseGame/game/core/components/input/fpsControls.cs
  23. 0 0
      Templates/BaseGame/game/core/components/input/inputManager.cs
  24. 8 0
      Templates/BaseGame/game/core/components/meshComponent.asset.taml
  25. 3 2
      Templates/BaseGame/game/core/components/playerControllerComponent.asset.taml
  26. 8 0
      Templates/BaseGame/game/core/components/soundComponent.asset.taml
  27. 3 2
      Templates/BaseGame/game/core/components/stateMachineComponent.asset.taml
  28. 0 13
      Templates/Full/game/art/art.module.taml
  29. 0 3
      Templates/Full/game/art/shapes/actors/Soldier/soldier.asset.taml
  30. 0 13
      Templates/Full/game/scripts/scripts.module.taml
  31. 0 7
      Templates/Full/game/scripts/server/components/animationComponent.asset.taml
  32. 0 7
      Templates/Full/game/scripts/server/components/meshComponent.asset.taml
  33. 0 123
      Templates/Full/game/scripts/server/gameObjects/GameObjectManager.cs
  34. 0 5
      Templates/Full/game/scripts/server/gameObjects/ThirdPersonPlayerObject.asset.taml
  35. 0 247
      Templates/Full/game/scripts/server/gameObjects/ThirdPersonPlayerObject.cs
  36. 0 98
      Templates/Full/game/scripts/server/gameObjects/ThirdPersonPlayerObject.taml
  37. 0 20
      Templates/Full/game/scripts/server/scriptExec.cs
  38. 7 43
      Tools/CMake/torque3d.cmake

+ 2 - 18
Engine/source/T3D/gameBase/gameConnection.cpp

@@ -44,10 +44,8 @@
 #include "console/engineAPI.h"
 #include "math/mTransform.h"
 
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "T3D/entity.h"
 #include "T3D/components/coreInterfaces.h"
-#endif
 
 #ifdef TORQUE_HIFI_NET
    #include "T3D/gameBase/hifi/hifiMoveList.h"
@@ -785,7 +783,6 @@ bool GameConnection::getControlCameraFov(F32 * fov)
    }
    if (cObj)
    {
-#ifdef TORQUE_EXPERIMENTAL_EC
       if (Entity* ent = dynamic_cast<Entity*>(cObj))
       {
          if (CameraInterface* camInterface = ent->getComponent<CameraInterface>())
@@ -795,11 +792,9 @@ bool GameConnection::getControlCameraFov(F32 * fov)
       }
       else
       {
-      *fov = cObj->getCameraFov();
+         *fov = cObj->getCameraFov();
       }
-#else
-      *fov = cObj->getCameraFov();
-#endif
+
       return(true);
    }
 
@@ -819,7 +814,6 @@ bool GameConnection::isValidControlCameraFov(F32 fov)
 
    if (cObj)
    {
-#ifdef TORQUE_EXPERIMENTAL_EC
       if (Entity* ent = dynamic_cast<Entity*>(cObj))
       {
          if (CameraInterface* camInterface = ent->getComponent<CameraInterface>())
@@ -831,9 +825,6 @@ bool GameConnection::isValidControlCameraFov(F32 fov)
       {
          return cObj->isValidCameraFov(fov);
       }
-#else
-      return cObj->isValidCameraFov(fov);
-#endif
    }
 
    return NULL;
@@ -851,8 +842,6 @@ bool GameConnection::setControlCameraFov(F32 fov)
    }
    if (cObj)
    {
-
-#ifdef TORQUE_EXPERIMENTAL_EC
       F32 newFov = 90.f;
       if (Entity* ent = dynamic_cast<Entity*>(cObj))
       {
@@ -872,11 +861,6 @@ bool GameConnection::setControlCameraFov(F32 fov)
          cObj->setCameraFov(mClampF(fov, MinCameraFov, MaxCameraFov));
          newFov = cObj->getCameraFov();
       }
-#else
-      // allow shapebase to clamp fov to its datablock values
-      cObj->setCameraFov(mClampF(fov, MinCameraFov, MaxCameraFov));
-      F32 newFov = cObj->getCameraFov();
-#endif
 
       // server fov of client has 1degree resolution
       if( S32(newFov) != S32(mCameraFov) || newFov != fov )

+ 0 - 4
Engine/source/T3D/gameBase/processList.cpp

@@ -32,10 +32,8 @@
 #include "platform/profiler.h"
 #include "console/consoleTypes.h"
 
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "T3D/components/coreInterfaces.h"
 #include "T3D/components/component.h"
-#endif
 //----------------------------------------------------------------------------
 
 ProcessObject::ProcessObject()
@@ -277,12 +275,10 @@ void ProcessList::advanceObjects()
       onTickObject(pobj);
    }
 
-#ifdef TORQUE_EXPERIMENTAL_EC
    for (U32 i = 0; i < UpdateInterface::all.size(); i++)
    {
       UpdateInterface::all[i]->processTick();
    }
-#endif
 
    mTotalTicks++;
 

+ 0 - 6
Engine/source/T3D/gameBase/std/stdGameProcess.cpp

@@ -37,10 +37,8 @@
 #include "T3D/gameBase/std/stdMoveList.h"
 #include "T3D/fx/cameraFXMgr.h"
 
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "T3D/components/coreInterfaces.h"
 #include "T3D/components/component.h"
-#endif
 
 MODULE_BEGIN( ProcessList )
 
@@ -137,7 +135,6 @@ bool StdClientProcessList::advanceTime( SimTime timeDelta )
       obj = obj->mProcessLink.next;
    }
 
-#ifdef TORQUE_EXPERIMENTAL_EC
    for (U32 i = 0; i < UpdateInterface::all.size(); i++)
    {
       Component *comp = dynamic_cast<Component*>(UpdateInterface::all[i]);
@@ -147,7 +144,6 @@ bool StdClientProcessList::advanceTime( SimTime timeDelta )
 
       UpdateInterface::all[i]->interpolateTick(mLastDelta);
    }
-#endif
 
    // Inform objects of total elapsed delta so they can advance
    // client side animations.
@@ -163,7 +159,6 @@ bool StdClientProcessList::advanceTime( SimTime timeDelta )
       obj = obj->mProcessLink.next;
    }
    
-#ifdef TORQUE_EXPERIMENTAL_EC
    for (U32 i = 0; i < UpdateInterface::all.size(); i++)
    {
       Component *comp = dynamic_cast<Component*>(UpdateInterface::all[i]);
@@ -176,7 +171,6 @@ bool StdClientProcessList::advanceTime( SimTime timeDelta )
 
       UpdateInterface::all[i]->advanceTime(dt);
    }
-#endif
 
    return ret;
 }

+ 1 - 10
Engine/source/gui/controls/guiTreeViewCtrl.cpp

@@ -36,9 +36,7 @@
    #include "gui/editor/editorFunctions.h"
 #endif
 #include "console/engineAPI.h"
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "T3D/entity.h"
-#endif
 
 IMPLEMENT_CONOBJECT(GuiTreeViewCtrl);
 
@@ -647,7 +645,6 @@ void GuiTreeViewCtrl::Item::getTooltipText(U32 bufLen, char *buf)
 
 bool GuiTreeViewCtrl::Item::isParent() const
 {
-#ifdef TORQUE_EXPERIMENTAL_EC
    //We might have a special case with entities
    //So if our entity either has children, or has some component with the EditorInspect interface, we return true
    if (mInspectorInfo.mObject)
@@ -659,7 +656,6 @@ bool GuiTreeViewCtrl::Item::isParent() const
             return true;
       }
    }
-#endif
 
    if(mState.test(VirtualParent))
    {
@@ -3790,7 +3786,6 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
       if( !item->isInspectorData() && item->mState.test(Item::VirtualParent) )
          onVirtualParentExpand(item);
       
-#ifdef TORQUE_EXPERIMENTAL_EC
       //Slightly hacky, but I'm not sure of a better setup until we get major update to the editors
       //We check if our object is an entity, and if it is, we call a 'onInspect' function.
       //This function is pretty much a special notifier to the entity so if it has any behaviors that do special
@@ -3810,7 +3805,6 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event)
             }
          }
       }
-#endif
       
       mFlags.set( RebuildVisible );
       scrollVisible(item);
@@ -4558,12 +4552,10 @@ bool GuiTreeViewCtrl::objectSearch( const SimObject *object, Item **item )
       if ( !pItem )
          continue;
 
-#ifdef TORQUE_EXPERIMENTAL_EC
       //A bit hackish, but we make a special exception here for items that are named 'Components', as they're merely
       //virtual parents to act as a container to an Entity's components
       if (pItem->mScriptInfo.mText == StringTable->insert("Components"))
          continue;
-#endif
 
       SimObject *pObj = pItem->getObject();
 
@@ -4628,11 +4620,10 @@ bool GuiTreeViewCtrl::onVirtualParentBuild(Item *item, bool bForceFullUpdate)
    
    // Go through our items and purge those that have disappeared from
    // the set.
-#ifdef TORQUE_EXPERIMENTAL_EC
+
    //Entities will be a special case here, if we're an entity, skip this step
    if (dynamic_cast<Entity*>(srcObj))
       return true;
-#endif
    
    for( Item* ptr = item->mChild; ptr != NULL; )
    {

+ 0 - 4
Engine/source/gui/editor/guiInspector.cpp

@@ -29,11 +29,9 @@
 #include "gui/containers/guiScrollCtrl.h"
 #include "gui/editor/inspector/customField.h"
 
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "gui/editor/inspector/entityGroup.h"
 #include "gui/editor/inspector/mountingGroup.h"
 #include "gui/editor/inspector/componentGroup.h"
-#endif
 
 IMPLEMENT_CONOBJECT(GuiInspector);
 
@@ -589,7 +587,6 @@ void GuiInspector::refresh()
    mGroups.push_back(general);
    addObject(general);
 
-#ifdef TORQUE_EXPERIMENTAL_EC
    //Entity inspector group
    if (mTargets.first()->getClassRep()->isSubclassOf("Entity"))
    {
@@ -624,7 +621,6 @@ void GuiInspector::refresh()
          addObject(compGroup);
       }
    }
-#endif
 
    // Create the inspector groups for static fields.
 

+ 1 - 4
Engine/source/gui/editor/inspector/dynamicGroup.cpp

@@ -26,9 +26,7 @@
 #include "gui/editor/inspector/dynamicField.h"
 #include "console/engineAPI.h"
 
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "T3D/components/component.h"
-#endif
 
 IMPLEMENT_CONOBJECT(GuiInspectorDynamicGroup);
 
@@ -126,7 +124,6 @@ bool GuiInspectorDynamicGroup::inspectGroup()
       SimFieldDictionary * fieldDictionary = target->getFieldDictionary();
       for(SimFieldDictionaryIterator ditr(fieldDictionary); *ditr; ++ditr)
       {
-#ifdef TORQUE_EXPERIMENTAL_EC
          if (target->getClassRep()->isSubclassOf("Component"))
          {
             Component* compTarget = dynamic_cast<Component*>(target);
@@ -135,7 +132,7 @@ bool GuiInspectorDynamicGroup::inspectGroup()
             if (compField)
                continue;
          }
-#endif
+
          if( i == 0 )
          {
             flist.increment();

+ 0 - 4
Engine/source/scene/sceneRenderState.cpp

@@ -26,10 +26,8 @@
 #include "renderInstance/renderPassManager.h"
 #include "math/util/matrixSet.h"
 
-#ifdef TORQUE_EXPERIMENTAL_EC
 #include "T3D/components/render/renderComponentInterface.h"
 #include "T3D/components/component.h"
-#endif
 
 //-----------------------------------------------------------------------------
 
@@ -108,7 +106,6 @@ void SceneRenderState::renderObjects( SceneObject** objects, U32 numObjects )
       object->prepRenderImage( this );
    }
 
-#ifdef TORQUE_EXPERIMENTAL_EC
    U32 interfaceCount = RenderComponentInterface::all.size();
    for (U32 i = 0; i < RenderComponentInterface::all.size(); i++)
    {
@@ -119,7 +116,6 @@ void SceneRenderState::renderObjects( SceneObject** objects, U32 numObjects )
          RenderComponentInterface::all[i]->prepRenderImage(this);
       }
    }
-#endif
 
    PROFILE_END();
 

+ 16 - 0
Templates/BaseGame/game/core/CoreComponents.module

@@ -0,0 +1,16 @@
+<ModuleDefinition
+	ModuleId="CoreComponentsModule"
+	VersionId="1"
+	Description="Module that implements the core engine-level components for the game."
+	Group="Game">
+	<DeclaredAssets
+           canSave="true"
+           canSaveDynamicFields="true"
+           Extension="asset.taml"
+           Recurse="true" />
+	<AutoloadAssets
+	   canSave="true"
+	   canSaveDynamicFields="true"
+	   AssetType="ComponentAsset"
+	   Recurse="true" />
+</ModuleDefinition>

+ 8 - 0
Templates/BaseGame/game/core/components/RigidBodyComponent.asset.taml

@@ -0,0 +1,8 @@
+<ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="RigidBodyComponentAsset"
+    componentClass="RigidBodyComponent"
+    friendlyName="Rigid Body"
+    componentType="Physics"
+    description="Allows an entity to have rigid body physics." />

+ 8 - 0
Templates/BaseGame/game/core/components/animationComponent.asset.taml

@@ -0,0 +1,8 @@
+<ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="AnimationComponentAsset"
+    componentClass="AnimationComponent"
+    friendlyName="animation"
+    componentType="animation"
+    description="Allows a mesh component to be animated." />

+ 3 - 2
Templates/Full/game/scripts/server/components/cameraOrbiterComponent.asset.taml → Templates/BaseGame/game/core/components/cameraOrbiterComponent.asset.taml

@@ -1,7 +1,8 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="CameraOrbiterComponentAsset"
-    componentName=""
     componentClass="CameraOrbiterComponent"
     friendlyName="Camera Orbiter"
     componentType="Game"
-    description="Acts as a boon arm for a camera component."/>
+    description="Acts as a boon arm for a camera component." />

+ 3 - 2
Templates/Full/game/scripts/server/components/collisionComponent.asset.taml → Templates/BaseGame/game/core/components/collisionComponent.asset.taml

@@ -1,7 +1,8 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="CollisionComponentAsset"
-    componentName=""
     componentClass="CollisionComponent"
     friendlyName="Collision"
     componentType="Collision"
-    description="Enables an entity to collide with things."/>
+    description="Enables an entity to collide with things." />

+ 4 - 2
Templates/Full/game/scripts/server/components/game/camera.asset.taml → Templates/BaseGame/game/core/components/game/camera.asset.taml

@@ -1,7 +1,9 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="CameraComponentAsset"
-    componentName=""
     componentClass="CameraComponent"
     friendlyName="Camera"
     componentType="Game"
-    description="Allows the component owner to operate as a camera."/>
+    scriptFile="core/components/game/camera.cs"
+    description="Allows the component owner to operate as a camera." />

+ 66 - 77
Templates/Full/game/scripts/server/components/game/camera.cs → Templates/BaseGame/game/core/components/game/camera.cs

@@ -100,97 +100,86 @@ function CameraComponent::onClientDisconnect(%this, %client)
    }
 }
 
-//move to the editor later
-GlobalActionMap.bind("keyboard", "alt c", "toggleEditorCam");
+///
+///
+///
 
-function switchCamera(%client, %newCamEntity)
+function VRCameraComponent::onAdd(%this) 
 {
-	if(!isObject(%client) || !isObject(%newCamEntity))
-		return error("SwitchCamera: No client or target camera!");
-		
-	%cam = %newCamEntity.getComponent(CameraComponent);
-		
-	if(!isObject(%cam))
-		return error("SwitchCamera: Target camera doesn't have a camera behavior!");
-		
-	//TODO: Cleanup clientOwner for previous camera!
-	if(%cam.clientOwner == 0 || %cam.clientOwner $= "")
-		%cam.clientOwner = 0;
-		
-	%cam.scopeToClient(%client);
-	%cam.setDirty();
-	
-	%client.setCameraObject(%newCamEntity);
-	%client.setControlCameraFov(%cam.FOV);
-	
-	%client.camera = %newCamEntity;
+   %this.addComponentField(clientOwner, "The client that views this camera", "int", "1", "");
+
+   %test = %this.clientOwner;
+
+   %barf = ClientGroup.getCount();
+
+   %clientID = %this.getClientID();
+   if(%clientID && !isObject(%clientID.camera))
+   {
+      %this.scopeToClient(%clientID);
+      %this.setDirty();
+
+      %clientID.setCameraObject(%this.owner);
+      %clientID.setControlCameraFov(%this.FOV);
+      
+      %clientID.camera = %this.owner;
+   }
+
+   %res = $pref::Video::mode;
+   %derp = 0;
 }
 
-function buildEditorCamera()
+function VRCameraComponent::onRemove(%this)
 {
-	if(isObject("EditorCamera"))
-		return EditorCamera;
-		
-    %camObj = SGOManager.spawn("SpectatorObject", false);
-	
-	%camObj.name = "EditorCamera";
-	
-	%client = ClientGroup.getObject(0);
-	
-	%camObj.getComponent(SpectatorControls).setupControls(%client);
-	
-	MissionCleanup.add(%camObj);
-	
-	return %camObj;
+   %clientID = %this.getClientID();
+   if(%clientID)
+      %clientID.clearCameraObject();
 }
 
-//TODO: Move this somewhere else!
-function toggleEditorCam(%val)
+function CameraComponent::onInspectorUpdate(%this)
 {
-   if(!%val)
-      return;
-      
-   %client = ClientGroup.getObject(0);
+   //if(%this.clientOwner)
+      //%this.clientOwner.setCameraObject(%this.owner);
+}
 
-   if(!isObject(%client.camera))
-      return error("ToggleEditorCam: no existing camera!");
-   
-   %editorCam = buildEditorCamera();
+function VRCameraComponent::getClientID(%this)
+{
+	return ClientGroup.getObject(%this.clientOwner-1);
+}
 
-   //if this is our first switch, just go to the editor camera
-   if(%client.lastCam $= "" || %client.camera.getId() != %editorCam.getId())
-   {
-	   if(%client.lastCam $= "")
-	   {
-	      //set up the position
-		  %editorCam.position = %client.camera.position;
-		  %editorCam.rotation = %client.camera.rotation;
-	   }
+function VRCameraComponent::isClientCamera(%this, %client)
+{
+	%clientID = ClientGroup.getObject(%this.clientOwner-1);
 	
-	   %client.lastCam = %client.camera;
-	   %client.lastController = %client.getControlObject();
-	   switchCamera(%client, %editorCam); 
-	   switchControlObject(%client, %editorCam);
-   }
-   else  
-   {
-       switchCamera(%client, %client.lastCam); 
-	   switchControlObject(%client, %client.lastController); 
-       %client.lastCam = %editorCam;
-	   %client.lastController = %editorCam;
-   }
+	if(%client.getID() == %clientID)
+		return true;
+	else
+	    return false;
 }
 
-function serverCmdSetClientAspectRatio(%client, %width, %height)
+function VRCameraComponent::onClientConnect(%this, %client)
 {
-   echo("Client: " @ %client SPC "changing screen res to: " @ %width SPC %height);
-   %client.screenExtent = %width SPC %height;
-   %cam = %client.getCameraObject();
-   
-   if(!isObject(%cam))
-      return;
+   //if(%this.isClientCamera(%client) && !isObject(%client.camera))
+   //{
+      %this.scopeToClient(%client);
+      %this.setDirty();
       
-   %cameraComp = %cam.getComponent(CameraComponent);
+      %client.setCameraObject(%this.owner);
+      %client.setControlCameraFov(%this.FOV);
+      
+      %client.camera = %this.owner;
+   //}
+   //else
+   //{
+   //   echo("CONNECTED CLIENT IS NOT CAMERA OWNER!");
+   //}
+}
 
-   %cameraComp.ScreenAspect = %width SPC %height;
+function VRCameraComponent::onClientDisconnect(%this, %client)
+{
+   Parent::onClientDisconnect(%this, %client);
+   
+   if(isClientCamera(%client)){
+      %this.clearScopeToClient(%client);
+      %client.clearCameraObject();
+   }
 }

+ 4 - 1
Templates/Full/game/scripts/server/components/game/controlObject.asset.taml → Templates/BaseGame/game/core/components/game/controlObject.asset.taml

@@ -1,7 +1,10 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="ControlObjectComponentAsset"
     componentName="ControlObjectComponent"
     componentClass="Component"
     friendlyName="Control Object"
     componentType="Game"
-    description="Allows the component owner to be controlled by a client."/>
+    scriptFile="core/components/game/controlObject.cs"
+    description="Allows the component owner to be controlled by a client." />

+ 0 - 0
Templates/Full/game/scripts/server/components/game/controlObject.cs → Templates/BaseGame/game/core/components/game/controlObject.cs


+ 4 - 1
Templates/Full/game/scripts/server/components/game/itemRotate.asset.taml → Templates/BaseGame/game/core/components/game/itemRotate.asset.taml

@@ -1,7 +1,10 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="ItemRotationComponentAsset"
     componentName="ItemRotationComponent"
     componentClass="Component"
     friendlyName="Item Rotation"
     componentType="Game"
-    description="Rotates the entity around an axis, like an item pickup."/>
+    scriptFile="core/components/game/itemRotate.cs"
+    description="Rotates the entity around an axis, like an item pickup." />

+ 0 - 0
Templates/Full/game/scripts/server/components/game/itemRotate.cs → Templates/BaseGame/game/core/components/game/itemRotate.cs


+ 4 - 1
Templates/Full/game/scripts/server/components/game/playerSpawner.asset.taml → Templates/BaseGame/game/core/components/game/playerSpawner.asset.taml

@@ -1,7 +1,10 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="PlayerSpawnerComponentAsset"
     componentName="PlayerSpawner"
     componentClass="Component"
     friendlyName="Player Spawner"
     componentType="Game"
-    description="When a client connects, it spawns a player object for them and attaches them to it."/>
+    scriptFile="core/components/game/playerSpawner.cs"
+    description="When a client connects, it spawns a player object for them and attaches them to it." />

+ 20 - 12
Templates/Full/game/scripts/server/components/game/playerSpawner.cs → Templates/BaseGame/game/core/components/game/playerSpawner.cs

@@ -29,32 +29,40 @@ function PlayerSpawner::onAdd(%this)
 	%this.friendlyName = "Player Spawner";
 	%this.componentType = "Spawner";
 	
-	%this.addComponentField("GameObjectName", "The name of the game object we spawn for the players", string, "PlayerObject");
+	%this.addComponentField("GameObjectName", "The name of the game object we spawn for the players", "gameObject", "PlayerObject");
 }
 
 function PlayerSpawner::onClientConnect(%this, %client)
 {
-	%playerObj = SGOManager.spawn(%this.GameObjectName);
+	%playerObj = spawnGameObject(%this.GameObjectName, false);
 	
 	if(!isObject(%playerObj))
 		return;
 
 	%playerObj.position = %this.owner.position;
 	
-	MissionCleanup.add(%playerObj);
-	
-	for(%b = 0; %b < %playerObj.getComponentCount(); %b++)
-    {
-       %comp = %playerObj.getComponentByIndex(%b);
-
-	   if(%comp.isMethod("onClientConnect"))
-         %comp.onClientConnect(%client);
-    }
+	%playerObj.notify("onClientConnect", %client);
 	
 	switchControlObject(%client, %playerObj);
 	switchCamera(%client, %playerObj);
 	
-	//%playerObj.getComponent(FPSControls).setupControls(%client);
+	%client.player = %playerObj;
+	%client.camera = %playerObj;
+	
+	%inventory = %playerObj.getComponent(InventoryController);
+	
+	if(isObject(%inventory))
+	{
+      for(%i=0; %i<5; %i++)
+      {
+         %arrow = spawnGameObject(ArrowProjectile, false);
+         
+         %inventory.addItem(%arrow);
+      }
+	}
+	
+	%playerObj.position = %this.owner.position;
+	%playerObj.rotation = "0 0 0";
 	
 	%this.clientCount++;
 }

+ 3 - 1
Templates/Full/game/scripts/server/components/input/fpsControls.asset.taml → Templates/BaseGame/game/core/components/input/fpsControls.asset.taml

@@ -1,7 +1,9 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="FPSControlsComponentAsset"
     componentName="FPSControls"
     componentClass="Component"
     friendlyName="FPS Controls"
     componentType="Input"
-    description="First Person Shooter-type controls."/>
+    description="First Person Shooter-type controls." />

+ 0 - 0
Templates/Full/game/scripts/server/components/input/fpsControls.cs → Templates/BaseGame/game/core/components/input/fpsControls.cs


+ 0 - 0
Templates/Full/game/scripts/server/components/input/inputManager.cs → Templates/BaseGame/game/core/components/input/inputManager.cs


+ 8 - 0
Templates/BaseGame/game/core/components/meshComponent.asset.taml

@@ -0,0 +1,8 @@
+<ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="MeshComponentAsset"
+    componentClass="MeshComponent"
+    friendlyName="mesh"
+    componentType="Render"
+    description="Enables an entity to render a shape." />

+ 3 - 2
Templates/Full/game/scripts/server/components/playerControllerComponent.asset.taml → Templates/BaseGame/game/core/components/playerControllerComponent.asset.taml

@@ -1,7 +1,8 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="PlayerControllerComponentAsset"
-    componentName=""
     componentClass="PlayerControllerComponent"
     friendlyName="Player Controller"
     componentType="Game"
-    description="Enables an entity to move like a player object."/>
+    description="Enables an entity to move like a player object." />

+ 8 - 0
Templates/BaseGame/game/core/components/soundComponent.asset.taml

@@ -0,0 +1,8 @@
+<ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="SoundComponentAsset"
+    componentClass="SoundComponent"
+    friendlyName="Sound(Component)"
+    componentType="sound"
+    description="Stores up to 4 sounds for playback." />

+ 3 - 2
Templates/Full/game/scripts/server/components/stateMachineComponent.asset.taml → Templates/BaseGame/game/core/components/stateMachineComponent.asset.taml

@@ -1,7 +1,8 @@
 <ComponentAsset
+    canSave="true"
+    canSaveDynamicFields="true"
     AssetName="StateMachineComponentAsset"
-    componentName=""
     componentClass="StateMachineComponent"
     friendlyName="State Machine"
     componentType="Game"
-    description="Enables a state machine on the entity."/>
+    description="Enables a state machine on the entity." />

+ 0 - 13
Templates/Full/game/art/art.module.taml

@@ -1,13 +0,0 @@
-<ModuleDefinition
-	ModuleId="Art"
-	VersionId="1"
-	Description="Default module for the Full template game assets."
-	ScriptFile=""
-	CreateFunction="create"
-	DestroyFunction="destroy"
-	Group="Game"
-	Dependencies="">
-    <DeclaredAssets
-      Extension="asset.taml"
-      Recurse="true"/>
-</ModuleDefinition>

+ 0 - 3
Templates/Full/game/art/shapes/actors/Soldier/soldier.asset.taml

@@ -1,3 +0,0 @@
-<ShapeAsset
-    AssetName="SoldierPlayer"
-    fileName="art/shapes/actors/Soldier/soldier_rigged.DAE"/>

+ 0 - 13
Templates/Full/game/scripts/scripts.module.taml

@@ -1,13 +0,0 @@
-<ModuleDefinition
-	ModuleId="Scripts"
-	VersionId="1"
-	Description="Default module for the Full template game assets."
-	ScriptFile=""
-	CreateFunction="create"
-	DestroyFunction="destroy"
-	Group="Game"
-	Dependencies="">
-    <DeclaredAssets
-      Extension="asset.taml"
-      Recurse="true"/>
-</ModuleDefinition>

+ 0 - 7
Templates/Full/game/scripts/server/components/animationComponent.asset.taml

@@ -1,7 +0,0 @@
-<ComponentAsset
-    AssetName="AnimationComponentAsset"
-    componentName=""
-    componentClass="AnimationComponent"
-    friendlyName="Animation"
-    componentType="Animation"
-    description="Allows a mesh component to be animated."/>

+ 0 - 7
Templates/Full/game/scripts/server/components/meshComponent.asset.taml

@@ -1,7 +0,0 @@
-<ComponentAsset
-    AssetName="MeshComponentAsset"
-    componentName=""
-    componentClass="MeshComponent"
-    friendlyName="Mesh"
-    componentType="Render"
-    description="Enables an entity to render a shape."/>

+ 0 - 123
Templates/Full/game/scripts/server/gameObjects/GameObjectManager.cs

@@ -1,123 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-function execGameObjects()
-{
-   //find all GameObjectAssets
-   %assetQuery = new AssetQuery();
-   if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
-      return; //if we didn't find ANY, just exit
-      
-   %count = %assetQuery.getCount();
-      
-	for(%i=0; %i < %count; %i++)
-	{
-	   %assetId = %assetQuery.getAsset(%i);
-      
-      %gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
-      
-      if(isFile(%gameObjectAsset.scriptFilePath))
-         exec(%gameObjectAsset.scriptFilePath);
-	}
-}
-
-function findGameObject(%name)
-{
-   //find all GameObjectAssets
-   %assetQuery = new AssetQuery();
-   if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
-      return 0; //if we didn't find ANY, just exit
-      
-   %count = %assetQuery.getCount();
-      
-	for(%i=0; %i < %count; %i++)
-	{
-	   %assetId = %assetQuery.getAsset(%i);
-      
-      %gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
-      
-      if(%gameObjectAsset.gameObjectName $= %name)
-		{
-		   if(isFile(%gameObjectAsset.TAMLFilePath))
-         {
-            return %gameObjectAsset;
-         }
-		}
-	}
-		
-	return 0;
-}
-
-function spawnGameObject(%name, %addToMissionGroup)
-{
-	if(%addToMissionGroup $= "")
-		%addToMissionGroup = true;
-		
-   %gameObjectAsset = findGameObject(%name);
-   
-   if(isObject(%gameObjectAsset))
-   {
-      %newSGOObject = TamlRead(%gameObjectAsset.TAMLFilePath);
-            
-      if(%addToMissionGroup == true) //save instance when saving level
-         MissionGroup.add(%newSGOObject);
-      else // clear instance on level exit
-         MissionCleanup.add(%newSGOObject);
-         
-      return %newSGOObject;
-   }
-		
-	return 0;
-}
-
-function saveGameObject(%name, %tamlPath, %scriptPath)
-{
-	%gameObjectAsset = findGameObject(%name);
-   
-   //find if it already exists. If it does, we'll update it, if it does not, we'll  make a new asset
-   if(isObject(%gameObjectAsset))
-   {
-      %assetID = %gameObjectAsset.getAssetId();
-      
-      %gameObjectAsset.TAMLFilePath = %tamlPath;
-      %gameObjectAsset.scriptFilePath = %scriptPath;
-      
-      TAMLWrite(%gameObjectAsset, AssetDatabase.getAssetFilePath(%assetID));
-      AssetDatabase.refreshAsset(%assetID);
-   }
-   else
-   {
-      //Doesn't exist, so make a new one
-      %gameObjectAsset = new GameObjectAsset()
-      {
-         assetName = %name @ "Asset";
-         gameObjectName = %name;
-         TAMLFilePath = %tamlPath;
-         scriptFilePath = %scriptPath;
-      };
-      
-      //Save it alongside the taml file
-      %path = filePath(%tamlPath);
-      
-      TAMLWrite(%gameObjectAsset, %path @ "/" @ %name @ ".asset.taml");
-      AssetDatabase.refreshAllAssets(true);
-   }
-}

+ 0 - 5
Templates/Full/game/scripts/server/gameObjects/ThirdPersonPlayerObject.asset.taml

@@ -1,5 +0,0 @@
-<GameObjectAsset
-    AssetName="ThirdPersonPlayerGameObjectAsset"
-    gameObjectName="ThirdPersonPlayer"
-    TAMLFilePath="scripts/server/gameObjects/ThirdPersonPlayerObject.taml"
-    scriptFilePath="scripts/server/gameObjects/ThirdPersonPlayerObject.cs"/>

+ 0 - 247
Templates/Full/game/scripts/server/gameObjects/ThirdPersonPlayerObject.cs

@@ -1,247 +0,0 @@
-function ThirdPersonPlayerObject::onAdd(%this)
-{
-   %this.turnRate = 0.3;
-
-   %this.phys = %this.getComponent("PlayerControllerComponent");
-   %this.collision = %this.getComponent("CollisionComponent");
-   %this.cam = %this.getComponent("CameraComponent");
-   %this.camArm = %this.getComponent("CameraOrbiterComponent");
-   %this.animation = %this.getComponent("AnimationComponent");
-   %this.stateMachine = %this.getComponent("StateMachineComponent");
-   %this.mesh = %this.getComponent("MeshComponent");
-
-   %this.stateMachine.forwardVector = 0;
-
-   %this.crouch = false;
-   
-   %this.firstPerson = false;
-   
-   %this.crouchSpeedMod = 0.5;
-   
-   %this.aimOrbitDist = 1.5;
-   %this.regularOrbitDist = 5;
-   
-   %this.regularOrbitMaxPitch = 70;
-   %this.regularOrbitMinPitch = -10;
-   
-   %this.aimedMaxPitch = 90;
-   %this.aimedMinPitch = -90;
-}
-
-function ThirdPersonPlayerObject::onRemove(%this)
-{
-
-}
-
-function ThirdPersonPlayerObject::moveVectorEvent(%this)
-{
-    %moveVector = %this.getMoveVector();
-
-    // forward of the camera on the x-z plane
-    %cameraForward = %this.cam.getForwardVector();
-
-    %cameraRight = %this.cam.getRightVector();
-
-    %moveVec = VectorAdd(VectorScale(%cameraRight, %moveVector.x), VectorScale(%cameraForward, %moveVector.y));
-
-   if(%this.aiming || %this.firstPerson)
-   {
-      %forMove = "0 0 0";
-      
-      if(%moveVector.x != 0)
-      {
-         %this.phys.inputVelocity.x = %moveVector.x * 10;
-      }
-      else
-      {
-         %this.phys.inputVelocity.x = 0;
-      }
-
-      if(%moveVector.y != 0)
-      {
-
-         %this.phys.inputVelocity.y = %moveVector.y * 10;
-      }
-      else
-      {
-         %this.phys.inputVelocity.y = 0;
-      }
-   }
-   else
-   {
-      if(%moveVec.x == 0 && %moveVec.y == 0)
-      {
-         %this.phys.inputVelocity = "0 0 0";
-         %this.stateMachine.forwardVector = 0;
-      }
-      else
-      {
-         %moveVec.z = 0;
-
-         %curForVec = %this.getForwardVector();
-
-         %newForVec = VectorLerp(%curForVec, %moveVec, %this.turnRate);
-
-         %this.setForwardVector(%newForVec);
-         
-         %this.phys.inputVelocity.y = 10;
-
-         %this.stateMachine.forwardVector = 1;
-      }
-   }
-   
-   if(%this.crouch)
-      %this.phys.inputVelocity = VectorScale(%this.phys.inputVelocity, %this.crouchSpeedMod);
-}
-
-function ThirdPersonPlayerObject::moveYawEvent(%this)
-{
-   %moveRotation = %this.getMoveRotation();
-
-    %camOrb = %this.getComponent("CameraOrbiterComponent");
-    
-    if(%this.aiming || %this.firstPerson)
-    {
-      %this.rotation.z += %moveRotation.z * 10;
-    }
-
-    %camOrb.rotation.z += %moveRotation.z * 10;
-}
-
-function ThirdPersonPlayerObject::movePitchEvent(%this)
-{
-   %moveRotation = %this.getMoveRotation();
-
-    %camOrb = %this.getComponent("CameraOrbiterComponent");
-
-    %camOrb.rotation.x += %moveRotation.x * 10;
-}
-
-function ThirdPersonPlayerObject::moveRollEvent(%this){}
-
-function ThirdPersonPlayerObject::moveTriggerEvent(%this, %triggerNum, %triggerValue)
-{
-   if(%triggerNum == 3 && %triggerValue)
-   {
-      if(%triggerValue)
-      {
-        %this.firstPerson = !%this.firstPerson;
-        
-        if(%this.firstPerson)
-        {
-            %this.rotation.z = %this.cam.rotationOffset.z;
-            %this.camArm.orbitDistance = 0;
-            %this.camArm.maxPitchAngle = %this.aimedMaxPitch;
-            %this.camArm.minPitchAngle = %this.aimedMinPitch;
-            
-            %this.cam.positionOffset = "0 0 0";
-            %this.cam.rotationOffset = "0 0 0";
-        }
-        else if(%this.aiming)
-        {
-            %this.camArm.orbitDistance = %this.aimOrbitDist;
-            
-            %this.camArm.maxPitchAngle = %this.aimedMaxPitch;
-            %this.camArm.minPitchAngle = %this.aimedMinPitch;
-        }
-        else
-        {
-            %this.camArm.orbitDistance = %this.regularOrbitDist;
-            
-            %this.camArm.maxPitchAngle = %this.regularOrbitMaxPitch;
-            %this.camArm.minPitchAngle = %this.regularOrbitMinPitch;
-        }
-        
-        commandToClient(localclientConnection, 'SetClientRenderShapeVisibility', 
-            localclientConnection.getGhostID(%this.getComponent("MeshComponent")), !%this.firstPerson);
-      }
-   }
-	else if(%triggerNum == 2 && %triggerValue == true)
-	{
-	   //get our best collision assuming up is 0 0 1
-	   %collisionAngle = %this.collision.getBestCollisionAngle("0 0 1");
-	   
-	   if(%collisionAngle >= 80)
-	   {
-	      %surfaceNormal = %this.collision.getCollisionNormal(0);
-	      %jumpVector = VectorScale(%surfaceNormal, 200);
-	      echo("Jump surface Angle is at: " @ %surfaceNormal);
-	      
-	      %this.phys.applyImpulse(%this.position, %jumpVector);
-	      %this.setForwardVector(%jumpVector);
-	   }
-      else
-         %this.phys.applyImpulse(%this.position, "0 0 300");
-	}
-	else if(%triggerNum == 4)
-	{
-      %this.crouch = %triggerValue;
-	}
-	else if(%triggerNum == 1)
-	{
-	   %this.aiming = %triggerValue;  
-	   
-	   if(%this.aiming)
-      {
-         %this.rotation.z = %this.cam.rotationOffset.z;
-         %this.camArm.orbitDistance = %this.aimOrbitDist;
-         %this.camArm.maxPitchAngle = %this.aimedMaxPitch;
-         %this.camArm.minPitchAngle = %this.aimedMinPitch;
-      }
-      else
-      {
-         %this.camArm.orbitDistance = %this.regularOrbitDist;
-         %this.camArm.maxPitchAngle = %this.regularOrbitMaxPitch;
-         %this.camArm.minPitchAngle = %this.regularOrbitMinPitch;
-      }
-	}
-}
-
-function ThirdPersonPlayerObject::onCollisionEvent(%this, %colObject, %colNormal, %colPoint, %colMatID, %velocity)
-{
-   if(!%this.phys.isContacted())
-    echo(%this @ " collided with " @ %colObject);
-}
-
-function ThirdPersonPlayerObject::processTick(%this)
-{
-   %moveVec = %this.getMoveVector();
-   %bestFit = "";
-   
-   if(%this.crouch)
-   {
-      if(%moveVec.x != 0 || %moveVec.y != 0)
-         %bestFit = "Crouch_Forward";
-      else
-         %bestFit = "Crouch_Root";
-   }
-   else
-   {
-      if(%moveVec.x != 0 || %moveVec.y != 0)
-         %bestFit = "Run";
-      else
-         %bestFit = "Root";
-   }
-   
-   if(%this.animation.getThreadAnimation(0) !$= %bestFit)
-      %this.animation.playThread(0, %bestFit);
-}
-
-//Used for first person mode
-function clientCmdSetClientRenderShapeVisibility(%id, %visiblilty)
-{
-   %localID = ServerConnection.resolveGhostID(%id); 
-   %localID.enabled = %visiblilty;
-}
-
-function serverToClientObject( %serverObject )
-{
-   assert( isObject( LocalClientConnection ), "serverToClientObject() - No local client connection found!" );
-   assert( isObject( ServerConnection ), "serverToClientObject() - No server connection found!" );      
-         
-   %ghostId = LocalClientConnection.getGhostId( %serverObject );
-   if ( %ghostId == -1 )
-      return 0;
-                
-   return ServerConnection.resolveGhostID( %ghostId );   
-}

+ 0 - 98
Templates/Full/game/scripts/server/gameObjects/ThirdPersonPlayerObject.taml

@@ -1,98 +0,0 @@
-<Entity
-    scale="1 1 1"
-    class="ThirdPersonPlayerObject"
-    canSave="true"
-    canSaveDynamicFields="true"
-    position="0 0 0"
-    rotation="0 0 0">
-    <Component
-        networked="false"
-        enabled="true"
-        class="ControlObjectComponent"
-        clientOwner="1" />
-    <CollisionComponent
-        friendlyName="Collision(Component)"
-        networked="false"
-        enabled="true"
-        collisionType="Bounds"
-        LineOfSightType="Collision Mesh"
-        decalType="Collision Mesh"
-        CollisionMeshPrefix="Collision"
-        BlockCollisions="true" />
-    <PlayerControllerComponent
-        componentType="Physics"
-        friendlyName="Simple Physics"
-        description="Simple physics behavior that allows gravity and impulses."
-        networked="false"
-        enabled="true"
-        gravity="0 0 -9"
-        velocity="0 0 0"
-        isStatic="false" />
-    <MeshComponent
-        componentType="Render"
-        friendlyName="Mesh Component"
-        description="Causes the object to render a non-animating 3d shape using the file provided."
-        networked="true"
-        enabled="true"
-        MeshAsset="Art:SoldierPlayer" />
-    <Component
-        networked="false"
-        enabled="true"
-        class="FPSControls" />
-    <CameraComponent
-        networked="false"
-        enabled="true"
-        FOV="80"
-        MinFOV="5"
-        MaxFOV="175"
-        ScreenAspect="1024 768"
-        targetNode="Eye"
-        positionOffset="0 0 0"
-        rotationOffset="0 0 0"
-        useParentTransform="false" />
-    <CameraOrbiterComponent
-        orbitDistance="5"
-        maxPitchAngle="70"
-        minPitchAngle="-70"
-        networked="false"
-        enabled="true" />
-	<AnimationComponent
-        componentType="Render"
-        friendlyName="Animation Component"
-        description="An animation component"
-        networked="true"
-        enabled="true"/>
-    <SpotLight
-        range="10"
-        innerAngle="40"
-        outerAngle="45"
-        isEnabled="true"
-        color="1 1 1 1"
-        brightness="1"
-        castShadows="false"
-        priority="1"
-        animate="true"
-        animationPeriod="1"
-        animationPhase="1"
-        flareScale="1"
-        attenuationRatio="0 1 1"
-        shadowType="Spot"
-        texSize="512"
-        overDarkFactor="2000 1000 500 100"
-        shadowDistance="400"
-        shadowSoftness="0.15"
-        numSplits="1"
-        logWeight="0.91"
-        fadeStartDistance="0"
-        lastSplitTerrainOnly="false"
-        representedInLightmap="false"
-        shadowDarkenColor="0 0 0 -1"
-        includeLightmappedGeometryInShadow="false"
-        position="0 0 1.6137"
-        rotation="0 0 1 0"
-        mountNode="-1"
-        mountPos="0 0 1.5"
-        mountRot="1 0 0 0"
-        canSave="true"
-        canSaveDynamicFields="true" />
-</Entity>

+ 0 - 20
Templates/Full/game/scripts/server/scriptExec.cs

@@ -58,23 +58,3 @@ exec("./turret.cs");
 // Load our gametypes
 exec("./gameCore.cs"); // This is the 'core' of the gametype functionality.
 exec("./gameDM.cs"); // Overrides GameCore with DeathMatch functionality.
-
-//Entity/Component stuff
-if(isFile("./components/game/camera.cs"))
-   exec("./components/game/camera.cs");
-if(isFile("./components/game/controlObject.cs"))
-   exec("./components/game/controlObject.cs");
-if(isFile("./components/game/itemRotate.cs"))
-   exec("./components/game/itemRotate.cs");
-if(isFile("./components/game/playerSpawner.cs"))
-   exec("./components/game/playerSpawner.cs");
-if(isFile("./components/input/fpsControls.cs"))
-   exec("./components/input/fpsControls.cs");
-if(isFile("./components/input/inputManager.cs"))
-   exec("./components/input/inputManager.cs");
-   
-if(isFile("./gameObjects/GameObjectManager.cs"))
-{
-   exec("./gameObjects/GameObjectManager.cs");
-   execGameObjects();  
-}

+ 7 - 43
Tools/CMake/torque3d.cmake

@@ -143,9 +143,6 @@ if(WIN32)
 	option(TORQUE_D3D11 "Allow Direct3D 11 render" ON)
 endif()
 
-option(TORQUE_EXPERIMENTAL_EC "Experimental Entity/Component systems" OFF)
-mark_as_advanced(TORQUE_EXPERIMENTAL_EC)
-
 option(TORQUE_DEDICATED "Torque dedicated" OFF)
 mark_as_advanced(TORQUE_DEDICATED)
 
@@ -316,9 +313,6 @@ addPath("${srcDir}/physics")
 addPath("${srcDir}/gui/3d")
 addPath("${srcDir}/postFx")
 
-if(NOT TORQUE_EXPERIMENTAL_EC)
-   set(BLACKLIST "entity.cpp;entity.h" )
-endif()
 addPath("${srcDir}/T3D")
 set(BLACKLIST "" )
 
@@ -331,16 +325,13 @@ addPath("${srcDir}/T3D/decal")
 addPath("${srcDir}/T3D/sfx")
 addPath("${srcDir}/T3D/gameBase")
 addPath("${srcDir}/T3D/turret")
-
-if( TORQUE_EXPERIMENTAL_EC )
-	addPath("${srcDir}/T3D/components/")
-	addPath("${srcDir}/T3D/components/animation")
-	addPath("${srcDir}/T3D/components/camera")
-	addPath("${srcDir}/T3D/components/collision")
-	addPath("${srcDir}/T3D/components/game")
-	addPath("${srcDir}/T3D/components/physics")
-	addPath("${srcDir}/T3D/components/render")
-endif()
+addPath("${srcDir}/T3D/components/")
+addPath("${srcDir}/T3D/components/animation")
+addPath("${srcDir}/T3D/components/camera")
+addPath("${srcDir}/T3D/components/collision")
+addPath("${srcDir}/T3D/components/game")
+addPath("${srcDir}/T3D/components/physics")
+addPath("${srcDir}/T3D/components/render")
 
 addPath("${srcDir}/main/")
 addPath("${srcDir}/assets")
@@ -422,9 +413,6 @@ if(TORQUE_TOOLS)
     addPath("${srcDir}/environment/editors")
     addPath("${srcDir}/forest/editor")
     addPath("${srcDir}/gui/editor")
-    if(NOT TORQUE_EXPERIMENTAL_EC)
-        set(BLACKLIST "entityGroup.cpp;entityGroup.h;mountingGroup.cpp;mountingGroup.h;componentGroup.cpp;componentGroup.h" )
-    endif()
     addPath("${srcDir}/gui/editor/inspector")
     set(BLACKLIST "" )
 endif()
@@ -502,10 +490,6 @@ if(TORQUE_DEDICATED)
     addDef(TORQUE_DEDICATED)
 endif()
 
-if(TORQUE_EXPERIMENTAL_EC)
-	addDef(TORQUE_EXPERIMENTAL_EC)
-endif()
-
 #modules dir
 file(GLOB modules "modules/*.cmake")
 foreach(module ${modules})
@@ -855,26 +839,6 @@ if(TORQUE_TEMPLATE)
     message("Prepare Template(${TORQUE_TEMPLATE}) install...")
     file(GLOB_RECURSE INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/*")
 
-    IF( NOT TORQUE_EXPERIMENTAL_EC)
-        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/art/art.module.taml")
-        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/art/shapes/actors/Soldier/soldier.asset.taml")
-        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/scripts.module.taml")
-
-        foreach(ITEM ${INSTALL_FILES_AND_DIRS})
-            get_filename_component( dir ${ITEM} DIRECTORY )
-            get_filename_component( fileName ${ITEM} NAME )
-            if( ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/components
-                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/components/game
-                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/components/input
-                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/scripts/server/gameObjects
-                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/tools/componentEditor
-                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/tools/componentEditor/gui
-                OR ${dir} STREQUAL ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/tools/componentEditor/scripts )
-                list(REMOVE_ITEM INSTALL_FILES_AND_DIRS ${dir}/${fileName})
-            ENDIF()
-        endforeach()
-    ENDIF()
-
     foreach(ITEM ${INSTALL_FILES_AND_DIRS})
         get_filename_component( dir ${ITEM} DIRECTORY )
         STRING(REGEX REPLACE "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/" "${TORQUE_APP_DIR}/" INSTALL_DIR ${dir})