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

This commit is contained in:
Areloch 2017-10-15 06:03:59 -05:00
parent efbd5fb451
commit df9deea1a8
38 changed files with 181 additions and 737 deletions

View file

@ -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>

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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", "");
function buildEditorCamera()
{
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;
}
%test = %this.clientOwner;
//TODO: Move this somewhere else!
function toggleEditorCam(%val)
{
if(!%val)
return;
%client = ClientGroup.getObject(0);
%barf = ClientGroup.getCount();
if(!isObject(%client.camera))
return error("ToggleEditorCam: no existing camera!");
%editorCam = buildEditorCamera();
//if this is our first switch, just go to the editor camera
if(%client.lastCam $= "" || %client.camera.getId() != %editorCam.getId())
%clientID = %this.getClientID();
if(%clientID && !isObject(%clientID.camera))
{
if(%client.lastCam $= "")
{
//set up the position
%editorCam.position = %client.camera.position;
%editorCam.rotation = %client.camera.rotation;
}
%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;
%this.scopeToClient(%clientID);
%this.setDirty();
%clientID.setCameraObject(%this.owner);
%clientID.setControlCameraFov(%this.FOV);
%clientID.camera = %this.owner;
}
%res = $pref::Video::mode;
%derp = 0;
}
function serverCmdSetClientAspectRatio(%client, %width, %height)
function VRCameraComponent::onRemove(%this)
{
echo("Client: " @ %client SPC "changing screen res to: " @ %width SPC %height);
%client.screenExtent = %width SPC %height;
%cam = %client.getCameraObject();
if(!isObject(%cam))
return;
%cameraComp = %cam.getComponent(CameraComponent);
%clientID = %this.getClientID();
if(%clientID)
%clientID.clearCameraObject();
}
%cameraComp.ScreenAspect = %width SPC %height;
function CameraComponent::onInspectorUpdate(%this)
{
//if(%this.clientOwner)
//%this.clientOwner.setCameraObject(%this.owner);
}
function VRCameraComponent::getClientID(%this)
{
return ClientGroup.getObject(%this.clientOwner-1);
}
function VRCameraComponent::isClientCamera(%this, %client)
{
%clientID = ClientGroup.getObject(%this.clientOwner-1);
if(%client.getID() == %clientID)
return true;
else
return false;
}
function VRCameraComponent::onClientConnect(%this, %client)
{
//if(%this.isClientCamera(%client) && !isObject(%client.camera))
//{
%this.scopeToClient(%client);
%this.setDirty();
%client.setCameraObject(%this.owner);
%client.setControlCameraFov(%this.FOV);
%client.camera = %this.owner;
//}
//else
//{
// echo("CONNECTED CLIENT IS NOT CAMERA OWNER!");
//}
}
function VRCameraComponent::onClientDisconnect(%this, %client)
{
Parent::onClientDisconnect(%this, %client);
if(isClientCamera(%client)){
%this.clearScopeToClient(%client);
%client.clearCameraObject();
}
}

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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++;
}

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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." />

View file

@ -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>

View file

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

View file

@ -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>

View file

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

View file

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

View file

@ -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);
}
}

View file

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

View file

@ -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 );
}

View file

@ -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>

View file

@ -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();
}