Merge branch 'development' into ConvexProxies
143
Templates/BaseGame/game/core/Core.cs
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
|
||||
function CoreModule::onCreate(%this)
|
||||
{
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Initialize core sub system functionality such as audio, the Canvas, PostFX,
|
||||
// rendermanager, light managers, etc.
|
||||
//
|
||||
// Note that not all of these need to be initialized before the client, although
|
||||
// the audio should and the canvas definitely needs to be. I've put things here
|
||||
// to distinguish between the purpose and functionality of the various client
|
||||
// scripts. Game specific script isn't needed until we reach the shell menus
|
||||
// and start a game or connect to a server. We get the various subsystems ready
|
||||
// to go, and then use initClient() to handle the rest of the startup sequence.
|
||||
//
|
||||
// If this is too convoluted we can reduce this complexity after futher testing
|
||||
// to find exactly which subsystems should be readied before kicking things off.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
ModuleDatabase.LoadExplicit( "Core_Rendering" );
|
||||
ModuleDatabase.LoadExplicit( "Core_Utility" );
|
||||
ModuleDatabase.LoadExplicit( "Core_GUI" );
|
||||
ModuleDatabase.LoadExplicit( "CoreModule" );
|
||||
ModuleDatabase.LoadExplicit( "Core_Lighting" );
|
||||
ModuleDatabase.LoadExplicit( "Core_SFX" );
|
||||
ModuleDatabase.LoadExplicit( "Core_PostFX" );
|
||||
ModuleDatabase.LoadExplicit( "Core_ClientServer" );
|
||||
|
||||
%prefPath = getPrefpath();
|
||||
if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
|
||||
exec( %prefPath @ "/clientPrefs.cs" );
|
||||
else
|
||||
exec("data/defaults.cs");
|
||||
|
||||
%der = $pref::Video::displayDevice;
|
||||
|
||||
//We need to hook the missing/warn material stuff early, so do it here
|
||||
/*$Core::MissingTexturePath = "core/images/missingTexture";
|
||||
$Core::UnAvailableTexturePath = "core/images/unavailable";
|
||||
$Core::WarningTexturePath = "core/images/warnMat";
|
||||
$Core::CommonShaderPath = "core/shaders";
|
||||
|
||||
/*%classList = enumerateConsoleClasses( "Component" );
|
||||
|
||||
foreach$( %componentClass in %classList )
|
||||
{
|
||||
echo("Native Component of type: " @ %componentClass);
|
||||
}*/
|
||||
|
||||
//exec("./helperFunctions.cs");
|
||||
|
||||
// We need some of the default GUI profiles in order to get the canvas and
|
||||
// other aspects of the GUI system ready.
|
||||
//exec("./profiles.cs");
|
||||
|
||||
//This is a bit of a shortcut, but we'll load the client's default settings to ensure all the prefs get initialized correctly
|
||||
|
||||
|
||||
// Initialization of the various subsystems requires some of the preferences
|
||||
// to be loaded... so do that first.
|
||||
/*exec("./globals.cs");
|
||||
|
||||
exec("./canvas.cs");
|
||||
exec("./cursor.cs");
|
||||
|
||||
exec("./renderManager.cs");
|
||||
exec("./lighting.cs");
|
||||
|
||||
exec("./audio.cs");
|
||||
exec("./sfx/audioAmbience.cs");
|
||||
exec("./sfx/audioData.cs");
|
||||
exec("./sfx/audioDescriptions.cs");
|
||||
exec("./sfx/audioEnvironments.cs");
|
||||
exec("./sfx/audioStates.cs");
|
||||
|
||||
exec("./parseArgs.cs");
|
||||
|
||||
// Materials and Shaders for rendering various object types
|
||||
exec("./gfxData/commonMaterialData.cs");
|
||||
exec("./gfxData/shaders.cs");
|
||||
exec("./gfxData/terrainBlock.cs");
|
||||
exec("./gfxData/water.cs");
|
||||
exec("./gfxData/scatterSky.cs");
|
||||
exec("./gfxData/clouds.cs");
|
||||
|
||||
// Initialize all core post effects.
|
||||
exec("./postFx.cs");
|
||||
|
||||
//VR stuff
|
||||
exec("./oculusVR.cs");*/
|
||||
|
||||
// Seed the random number generator.
|
||||
setRandomSeed();
|
||||
|
||||
// Parse the command line arguments
|
||||
echo("\n--------- Parsing Arguments ---------");
|
||||
parseArgs();
|
||||
|
||||
// The canvas needs to be initialized before any gui scripts are run since
|
||||
// some of the controls assume that the canvas exists at load time.
|
||||
createCanvas($appName);
|
||||
|
||||
//load canvas
|
||||
//exec("./console/main.cs");
|
||||
|
||||
ModuleDatabase.LoadExplicit( "Core_Console" );
|
||||
|
||||
// Init the physics plugin.
|
||||
physicsInit();
|
||||
|
||||
sfxStartup();
|
||||
|
||||
// Set up networking.
|
||||
setNetPort(0);
|
||||
|
||||
// Start processing file change events.
|
||||
startFileChangeNotifications();
|
||||
|
||||
// If we have editors, initialize them here as well
|
||||
if (isToolBuild())
|
||||
{
|
||||
if(isFile("tools/main.cs") && !$isDedicated)
|
||||
exec("tools/main.cs");
|
||||
|
||||
ModuleDatabase.scanModules( "tools", false );
|
||||
ModuleDatabase.LoadGroup( "Tools" );
|
||||
}
|
||||
}
|
||||
|
||||
function CoreModule::onDestroy(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Called when the engine is shutting down.
|
||||
function onExit()
|
||||
{
|
||||
// Stop file change events.
|
||||
stopFileChangeNotifications();
|
||||
|
||||
ModuleDatabase.UnloadExplicit( "Game" );
|
||||
}
|
||||
19
Templates/BaseGame/game/core/Core.module
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="CoreModule"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core">
|
||||
<DeclaredAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
Extension="asset.taml"
|
||||
Recurse="true" />
|
||||
<AutoloadAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetType="ComponentAsset"
|
||||
Recurse="true" />
|
||||
</ModuleDefinition>
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
|
||||
// connected to it via createAndConnectToLocalServer().
|
||||
|
||||
function ClientServer::create( %this )
|
||||
function Core_ClientServer::create( %this )
|
||||
{
|
||||
echo("\n--------- Initializing Directory: scripts ---------");
|
||||
exec( "./scripts/client/client.cs" );
|
||||
|
|
@ -35,7 +35,7 @@ function ClientServer::create( %this )
|
|||
}
|
||||
}
|
||||
|
||||
function ClientServer::destroy( %this )
|
||||
function Core_ClientServer::destroy( %this )
|
||||
{
|
||||
// Ensure that we are disconnected and/or the server is destroyed.
|
||||
// This prevents crashes due to the SceneGraph being deleted before
|
||||
|
|
@ -46,7 +46,7 @@ function ClientServer::destroy( %this )
|
|||
disconnect();
|
||||
|
||||
// Destroy the physics plugin.
|
||||
physicsDestroy();
|
||||
//physicsDestroy();
|
||||
|
||||
sfxShutdown();
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="ClientServer"
|
||||
ModuleId="Core_ClientServer"
|
||||
VersionId="1"
|
||||
Description="Default module for the game."
|
||||
ScriptFile="ClientServer.cs"
|
||||
ScriptFile="Core_ClientServer.cs"
|
||||
CreateFunction="create"
|
||||
DestroyFunction="destroy"
|
||||
Group="Game">
|
||||
Group="Core">
|
||||
</ModuleDefinition>
|
||||
|
|
@ -9,10 +9,10 @@ function initClient()
|
|||
$Client::GameTypeQuery = $appName;
|
||||
$Client::MissionTypeQuery = "Any";
|
||||
|
||||
exec( "data/clientServer/scripts/client/message.cs" );
|
||||
exec( "data/clientServer/scripts/client/connectionToServer.cs" );
|
||||
exec( "data/clientServer/scripts/client/levelDownload.cs" );
|
||||
exec( "data/clientServer/scripts/client/levelLoad.cs" );
|
||||
exec( "./message.cs" );
|
||||
exec( "./connectionToServer.cs" );
|
||||
exec( "./levelDownload.cs" );
|
||||
exec( "./levelLoad.cs" );
|
||||
|
||||
//load prefs
|
||||
%prefPath = getPrefpath();
|
||||
|
|
@ -132,6 +132,23 @@ function isNameUnique(%name)
|
|||
//
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
{
|
||||
%entityIds = parseMissionGroupForIds("Entity", "");
|
||||
%entityCount = getWordCount(%entityIds);
|
||||
|
||||
for(%i=0; %i < %entityCount; %i++)
|
||||
{
|
||||
%entity = getWord(%entityIds, %i);
|
||||
|
||||
for(%e=0; %e < %entity.getCount(); %e++)
|
||||
{
|
||||
%child = %entity.getObject(%e);
|
||||
if(%child.getClassName() $= "Entity")
|
||||
%entityIds = %entityIds SPC %child.getID();
|
||||
}
|
||||
|
||||
%entity.notify("onClientDisconnect", %client);
|
||||
}
|
||||
|
||||
if($missionRunning)
|
||||
theLevelInfo.onClientLeaveGame();
|
||||
|
||||
|
|
@ -131,6 +131,22 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
|
|||
%client.currentPhase = 3;
|
||||
|
||||
// Server is ready to drop into the game
|
||||
%entityIds = parseMissionGroupForIds("Entity", "");
|
||||
%entityCount = getWordCount(%entityIds);
|
||||
|
||||
for(%i=0; %i < %entityCount; %i++)
|
||||
{
|
||||
%entity = getWord(%entityIds, %i);
|
||||
|
||||
for(%e=0; %e < %entity.getCount(); %e++)
|
||||
{
|
||||
%child = %entity.getObject(%e);
|
||||
if(%child.getCLassName() $= "Entity")
|
||||
%entityIds = %entityIds SPC %child.getID();
|
||||
}
|
||||
|
||||
%entity.notify("onClientConnect", %client);
|
||||
}
|
||||
|
||||
//Have any special game-play handling here
|
||||
if(theLevelInfo.isMethod("onClientEnterGame"))
|
||||
|
|
@ -151,7 +167,7 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
|
|||
};
|
||||
}
|
||||
|
||||
if (isDefined("$Game::DefaultCameraClass"))
|
||||
//if (isDefined("$Game::DefaultCameraClass"))
|
||||
%client.camera = spawnObject("Camera", Observer);
|
||||
}
|
||||
|
||||
|
|
@ -25,20 +25,23 @@ function initServer()
|
|||
echo("\n--------- Initializing " @ $appName @ ": Server Scripts ---------");
|
||||
|
||||
//load prefs
|
||||
|
||||
//Force-load the defaults just so we don't have any mistakes
|
||||
exec( "./defaults.cs" );
|
||||
|
||||
//Then, if the user has saved preferences, we load those over-top the defaults
|
||||
%prefPath = getPrefpath();
|
||||
if ( isFile( %prefPath @ "/serverPrefs.cs" ) )
|
||||
exec( %prefPath @ "/serverPrefs.cs" );
|
||||
else
|
||||
exec( "data/clientServer/scripts/server/defaults.cs" );
|
||||
|
||||
exec( "data/clientServer/scripts/server/audio.cs" );
|
||||
exec( "data/clientServer/scripts/server/commands.cs" );
|
||||
exec( "data/clientServer/scripts/server/kickban.cs" );
|
||||
exec( "data/clientServer/scripts/server/message.cs" );
|
||||
exec( "data/clientServer/scripts/server/levelDownload.cs" );
|
||||
exec( "data/clientServer/scripts/server/levelLoad.cs" );
|
||||
exec( "data/clientServer/scripts/server/levelInfo.cs" );
|
||||
exec( "data/clientServer/scripts/server/connectionToClient.cs" );
|
||||
exec( "./audio.cs" );
|
||||
exec( "./commands.cs" );
|
||||
exec( "./kickban.cs" );
|
||||
exec( "./message.cs" );
|
||||
exec( "./levelDownload.cs" );
|
||||
exec( "./levelLoad.cs" );
|
||||
exec( "./levelInfo.cs" );
|
||||
exec( "./connectionToClient.cs" );
|
||||
|
||||
// Server::Status is returned in the Game Info Query and represents the
|
||||
// current status of the server. This string sould be very short.
|
||||
|
|
@ -99,6 +102,11 @@ function createAndConnectToLocalServer( %serverType, %level )
|
|||
{
|
||||
%conn.delete();
|
||||
destroyServer();
|
||||
|
||||
MessageBoxOK("Error starting local server!", "There was an error when trying to connect to the local server.");
|
||||
|
||||
if(isObject(MainMenuGui))
|
||||
Canvas.setContent(MainMenuGui);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -201,7 +209,7 @@ function destroyServer()
|
|||
// End any running levels and shut down the physics sim
|
||||
onServerDestroyed();
|
||||
|
||||
physicsDestroy();
|
||||
//physicsDestroy();
|
||||
|
||||
// Delete all the server objects
|
||||
if (isObject(ServerGroup))
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
function Core_Components::onCreate(%this)
|
||||
{
|
||||
}
|
||||
|
||||
function Core_Components::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="Core_Components"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core_Components.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core">
|
||||
<DeclaredAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
Extension="asset.taml"
|
||||
Recurse="true" />
|
||||
</ModuleDefinition>
|
||||
|
|
@ -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." />
|
||||
|
|
@ -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." />
|
||||
|
|
@ -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." />
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="ShapeCollisionComponentAsset"
|
||||
componentClass="ShapeCollisionComponent"
|
||||
friendlyName="Shape Collision"
|
||||
componentType="Collision"
|
||||
description="Enables an entity to collide with things with bounds, collision or visible meshes" />
|
||||
|
|
@ -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."/>
|
||||
description="Allows the component owner to operate as a camera."
|
||||
scriptFile="core/components/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", "");
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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."/>
|
||||
description="Allows the component owner to be controlled by a client."
|
||||
scriptFile="core/components/components/game/controlObject.cs" />
|
||||
|
|
@ -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."/>
|
||||
description="Rotates the entity around an axis, like an item pickup."
|
||||
scriptFile="core/components/components/game/itemRotate.cs" />
|
||||
|
|
@ -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."/>
|
||||
description="When a client connects, it spawns a player object for them and attaches them to it."
|
||||
scriptFile="core/components/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++;
|
||||
}
|
||||
|
|
@ -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 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="MeshComponentAsset"
|
||||
componentClass="MeshComponent"
|
||||
friendlyName="mesh"
|
||||
componentType="Render"
|
||||
description="Enables an entity to render a shape." />
|
||||
|
|
@ -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." />
|
||||
|
|
@ -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." />
|
||||
|
|
@ -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,0 +1,8 @@
|
|||
<ComponentAsset
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
AssetName="TriggerComponentAsset"
|
||||
componentClass="TriggerComponent"
|
||||
friendlyName="Trigger Component"
|
||||
componentType="Collision"
|
||||
description="Enables callback and event behaviors on collision with the entity." />
|
||||
12
Templates/BaseGame/game/core/console/Core_Console.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
function Core_Console::onCreate(%this)
|
||||
{
|
||||
exec("./scripts/profiles.cs");
|
||||
exec("./scripts/console.cs");
|
||||
|
||||
exec("./guis/console.gui");
|
||||
}
|
||||
|
||||
function Core_Console::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
10
Templates/BaseGame/game/core/console/Core_Console.module
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="Core_Console"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core_Console.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core"
|
||||
Dependencies="Core_GUI=1">
|
||||
</ModuleDefinition>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
new GuiControl(ConsoleDlg) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiConsoleEditCtrl(ConsoleEntry) {
|
||||
profile = "ConsoleTextEditProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "top";
|
||||
position = "0 462";
|
||||
extent = "640 18";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
altCommand = "ConsoleEntry::eval();";
|
||||
helpTag = "0";
|
||||
maxLength = "255";
|
||||
historySize = "40";
|
||||
password = "0";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "1";
|
||||
useSiblingScroller = "1";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
internalName = "Scroll";
|
||||
profile = "ConsoleScrollProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 462";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOn";
|
||||
vScrollBar = "alwaysOn";
|
||||
lockHorizScroll = "false";
|
||||
lockVertScroll = "false";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiConsole( ConsoleMessageLogView ) {
|
||||
profile = "GuiConsoleProfile";
|
||||
position = "0 0";
|
||||
};
|
||||
};
|
||||
};
|
||||
191
Templates/BaseGame/game/core/console/guis/console.gui
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(ConsoleDlg) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiConsoleEditCtrl(ConsoleEntry) {
|
||||
useSiblingScroller = "1";
|
||||
historySize = "40";
|
||||
tabComplete = "0";
|
||||
sinkAllKeyEvents = "1";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
maxLength = "255";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 750";
|
||||
extent = "1024 18";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "top";
|
||||
profile = "ConsoleTextEditProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
altCommand = "ConsoleEntry::eval();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiContainer() {
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "1 728";
|
||||
extent = "1024 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "top";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiBitmapCtrl() {
|
||||
bitmap = "data/ui/art/hudfill.png";
|
||||
color = "255 255 255 255";
|
||||
wrap = "0";
|
||||
position = "0 0";
|
||||
extent = "1024 22";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
|
||||
text = "Errors";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "2 2";
|
||||
extent = "113 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiCheckBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
|
||||
text = "Warnings";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "119 2";
|
||||
extent = "113 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiCheckBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
|
||||
text = "Normal Messages";
|
||||
groupNum = "-1";
|
||||
buttonType = "ToggleButton";
|
||||
useMouseEvents = "0";
|
||||
position = "236 2";
|
||||
extent = "113 20";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiCheckBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOn";
|
||||
vScrollBar = "alwaysOn";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "1024 730";
|
||||
minExtent = "8 8";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ConsoleScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "Scroll";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiConsole(ConsoleMessageLogView) {
|
||||
position = "1 1";
|
||||
extent = "622 324";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiConsoleProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
|
@ -20,9 +20,6 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
exec("./profiles.cs");
|
||||
exec("./console.gui");
|
||||
|
||||
GlobalActionMap.bind("keyboard", "tilde", "toggleConsole");
|
||||
|
||||
function ConsoleEntry::eval()
|
||||
|
|
@ -99,6 +96,15 @@ function ConsoleDlg::showWindow(%this)
|
|||
%this-->Scroll.setVisible(true);
|
||||
}
|
||||
|
||||
function ConsoleDlg::onWake(%this)
|
||||
{
|
||||
ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
|
||||
ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
|
||||
ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
|
||||
|
||||
ConsoleMessageLogView.refresh();
|
||||
}
|
||||
|
||||
function ConsoleDlg::setAlpha( %this, %alpha)
|
||||
{
|
||||
if (%alpha $= "")
|
||||
|
|
@ -106,3 +112,26 @@ function ConsoleDlg::setAlpha( %this, %alpha)
|
|||
else
|
||||
ConsoleScrollProfile.fillColor = getWords($ConsoleDefaultFillColor, 0, 2) SPC %alpha * 255.0;
|
||||
}
|
||||
|
||||
function ConsoleDlgErrorFilterBtn::onClick(%this)
|
||||
{
|
||||
ConsoleMessageLogView.toggleErrorFilter();
|
||||
}
|
||||
|
||||
function ConsoleDlgWarnFilterBtn::onClick(%this)
|
||||
{
|
||||
|
||||
ConsoleMessageLogView.toggleWarnFilter();
|
||||
}
|
||||
|
||||
function ConsoleDlgNormalFilterBtn::onClick(%this)
|
||||
{
|
||||
ConsoleMessageLogView.toggleNormalFilter();
|
||||
}
|
||||
|
||||
function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
|
||||
{
|
||||
ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
|
||||
ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
|
||||
ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
|
||||
}
|
||||
11
Templates/BaseGame/game/core/gui/Core_GUI.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
function Core_GUI::onCreate(%this)
|
||||
{
|
||||
exec("./scripts/profiles.cs");
|
||||
exec("./scripts/canvas.cs");
|
||||
exec("./scripts/cursor.cs");
|
||||
}
|
||||
|
||||
function Core_GUI::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
10
Templates/BaseGame/game/core/gui/Core_GUI.module
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="Core_GUI"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core_GUI.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core"
|
||||
Dependencies="Core_Rendering=1">
|
||||
</ModuleDefinition>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 635 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
|
@ -107,7 +107,7 @@ new GuiControlProfile (GuiWindowProfile)
|
|||
bevelColorHL = "255 255 255";
|
||||
bevelColorLL = "0 0 0";
|
||||
text = "untitled";
|
||||
bitmap = "./images/window";
|
||||
bitmap = "core/gui/images/window";
|
||||
textOffset = "8 4";
|
||||
hasBitmapArray = true;
|
||||
justify = "left";
|
||||
|
|
@ -119,7 +119,7 @@ if(!isObject(GuiTextEditProfile))
|
|||
new GuiControlProfile(GuiTextEditProfile)
|
||||
{
|
||||
opaque = true;
|
||||
bitmap = "./images/textEdit";
|
||||
bitmap = "core/gui/images/textEdit";
|
||||
hasBitmapArray = true;
|
||||
border = -2;
|
||||
fillColor = "242 241 240 0";
|
||||
|
|
@ -145,7 +145,7 @@ new GuiControlProfile(GuiScrollProfile)
|
|||
fontColor = "0 0 0";
|
||||
fontColorHL = "150 150 150";
|
||||
border = true;
|
||||
bitmap = "./images/scrollBar";
|
||||
bitmap = "core/gui/images/scrollBar";
|
||||
hasBitmapArray = true;
|
||||
category = "Core";
|
||||
};
|
||||
|
|
@ -173,7 +173,7 @@ new GuiControlProfile(GuiCheckBoxProfile)
|
|||
fontColorNA = "200 200 200";
|
||||
fixedExtent = true;
|
||||
justify = "left";
|
||||
bitmap = "./images/checkbox";
|
||||
bitmap = "core/gui/images/checkbox";
|
||||
hasBitmapArray = true;
|
||||
category = "Tools";
|
||||
};
|
||||
|
|
@ -193,7 +193,7 @@ new GuiControlProfile( GuiProgressBitmapProfile )
|
|||
{
|
||||
border = false;
|
||||
hasBitmapArray = true;
|
||||
bitmap = "./images/loadingbar";
|
||||
bitmap = "core/gui/images/loadingbar";
|
||||
category = "Core";
|
||||
};
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ new GuiControlProfile( GuiButtonProfile )
|
|||
fixedExtent = false;
|
||||
justify = "center";
|
||||
canKeyFocus = false;
|
||||
bitmap = "./images/button";
|
||||
bitmap = "core/gui/images/button";
|
||||
hasBitmapArray = false;
|
||||
category = "Core";
|
||||
};
|
||||
20
Templates/BaseGame/game/core/lighting/Core_Lighting.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
function Core_Lighting::onCreate(%this)
|
||||
{
|
||||
exec("./scripts/lighting.cs");
|
||||
|
||||
//Advanced/Deferred
|
||||
exec("./scripts/advancedLighting_Shaders.cs");
|
||||
exec("./scripts/deferredShading.cs");
|
||||
exec("./scripts/advancedLighting_Init.cs");
|
||||
|
||||
//Basic/Forward
|
||||
exec("./scripts/basicLighting_shadowFilter.cs");
|
||||
exec("./scripts/shadowMaps_Init.cs");
|
||||
exec("./scripts/basicLighting_Init.cs");
|
||||
|
||||
}
|
||||
|
||||
function Core_Lighting::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="Core_Lighting"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core_Lighting.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core">
|
||||
</ModuleDefinition>
|
||||
|
|
@ -39,8 +39,8 @@ $pref::LightManager::sgUseDynamicShadows = "1";
|
|||
$pref::LightManager::sgUseToneMapping = "";
|
||||
*/
|
||||
|
||||
exec( "./shaders.cs" );
|
||||
exec( "./deferredShading.cs" );
|
||||
//exec( "./shaders.cs" );
|
||||
//exec( "./deferredShading.cs" );
|
||||
|
||||
function onActivateAdvancedLM()
|
||||
{
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
exec( "./shadowFilter.cs" );
|
||||
//exec( "./shadowFilter.cs" );
|
||||
|
||||
singleton GFXStateBlockData( BL_ProjectedShadowSBData )
|
||||
{
|
||||
|
|
@ -26,12 +26,12 @@ function initLightingSystems(%manager)
|
|||
|
||||
// First exec the scripts for the different light managers
|
||||
// in the lighting folder.
|
||||
%pattern = "./lighting/*/init.cs";
|
||||
/*%pattern = "./lighting/*//*init.cs";
|
||||
%file = findFirstFile( %pattern );
|
||||
if ( %file $= "" )
|
||||
{
|
||||
// Try for DSOs next.
|
||||
%pattern = "./lighting/*/init.cs.dso";
|
||||
%pattern = "./lighting/*//*init.cs.dso";
|
||||
%file = findFirstFile( %pattern );
|
||||
}
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ function initLightingSystems(%manager)
|
|||
{
|
||||
exec( %file );
|
||||
%file = findNextFile( %pattern );
|
||||
}
|
||||
}*/
|
||||
|
||||
// Try the perfered one first.
|
||||
%success = setLightManager(%manager);
|
||||
|
|
@ -1,93 +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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Initialize core sub system functionality such as audio, the Canvas, PostFX,
|
||||
// rendermanager, light managers, etc.
|
||||
//
|
||||
// Note that not all of these need to be initialized before the client, although
|
||||
// the audio should and the canvas definitely needs to be. I've put things here
|
||||
// to distinguish between the purpose and functionality of the various client
|
||||
// scripts. Game specific script isn't needed until we reach the shell menus
|
||||
// and start a game or connect to a server. We get the various subsystems ready
|
||||
// to go, and then use initClient() to handle the rest of the startup sequence.
|
||||
//
|
||||
// If this is too convoluted we can reduce this complexity after futher testing
|
||||
// to find exactly which subsystems should be readied before kicking things off.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
//We need to hook the missing/warn material stuff early, so do it here
|
||||
$Core::MissingTexturePath = "core/images/missingTexture";
|
||||
$Core::UnAvailableTexturePath = "core/images/unavailable";
|
||||
$Core::WarningTexturePath = "core/images/warnMat";
|
||||
$Core::CommonShaderPath = "core/shaders";
|
||||
|
||||
exec("./helperFunctions.cs");
|
||||
|
||||
// We need some of the default GUI profiles in order to get the canvas and
|
||||
// other aspects of the GUI system ready.
|
||||
exec("./profiles.cs");
|
||||
|
||||
//This is a bit of a shortcut, but we'll load the client's default settings to ensure all the prefs get initialized correctly
|
||||
%prefPath = getPrefpath();
|
||||
if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
|
||||
exec( %prefPath @ "/clientPrefs.cs" );
|
||||
else
|
||||
exec("data/defaults.cs");
|
||||
|
||||
%der = $pref::Video::displayDevice;
|
||||
|
||||
// Initialization of the various subsystems requires some of the preferences
|
||||
// to be loaded... so do that first.
|
||||
exec("./globals.cs");
|
||||
|
||||
exec("./canvas.cs");
|
||||
exec("./cursor.cs");
|
||||
|
||||
exec("./renderManager.cs");
|
||||
exec("./lighting.cs");
|
||||
|
||||
exec("./audio.cs");
|
||||
exec("./sfx/audioAmbience.cs");
|
||||
exec("./sfx/audioData.cs");
|
||||
exec("./sfx/audioDescriptions.cs");
|
||||
exec("./sfx/audioEnvironments.cs");
|
||||
exec("./sfx/audioStates.cs");
|
||||
|
||||
exec("./parseArgs.cs");
|
||||
|
||||
// Materials and Shaders for rendering various object types
|
||||
exec("./gfxData/commonMaterialData.cs");
|
||||
exec("./gfxData/shaders.cs");
|
||||
exec("./gfxData/terrainBlock.cs");
|
||||
exec("./gfxData/water.cs");
|
||||
exec("./gfxData/scatterSky.cs");
|
||||
exec("./gfxData/clouds.cs");
|
||||
|
||||
// Initialize all core post effects.
|
||||
exec("./postFx.cs");
|
||||
|
||||
//VR stuff
|
||||
exec("./oculusVR.cs");
|
||||
|
||||
// Seed the random number generator.
|
||||
setRandomSeed();
|
||||
33
Templates/BaseGame/game/core/postFX/Core_PostFX.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
function Core_PostFX::onCreate(%this)
|
||||
{
|
||||
//
|
||||
exec("./scripts/postFx.cs");
|
||||
/*exec("./scripts/postFxManager.gui.cs");
|
||||
exec("./scripts/postFxManager.gui.settings.cs");
|
||||
exec("./scripts/postFxManager.persistance.cs");
|
||||
|
||||
exec("./scripts/default.postfxpreset.cs");
|
||||
|
||||
exec("./scripts/caustics.cs");
|
||||
exec("./scripts/chromaticLens.cs");
|
||||
exec("./scripts/dof.cs");
|
||||
exec("./scripts/edgeAA.cs");
|
||||
exec("./scripts/flash.cs");
|
||||
exec("./scripts/fog.cs");
|
||||
exec("./scripts/fxaa.cs");
|
||||
exec("./scripts/GammaPostFX.cs");
|
||||
exec("./scripts/glow.cs");
|
||||
exec("./scripts/hdr.cs");
|
||||
exec("./scripts/lightRay.cs");
|
||||
exec("./scripts/MLAA.cs");
|
||||
exec("./scripts/MotionBlurFx.cs");
|
||||
exec("./scripts/ovrBarrelDistortion.cs");
|
||||
exec("./scripts/ssao.cs");
|
||||
exec("./scripts/turbulence.cs");
|
||||
exec("./scripts/vignette.cs");*/
|
||||
}
|
||||
|
||||
function Core_PostFX::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
10
Templates/BaseGame/game/core/postFX/Core_PostFX.module
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<ModuleDefinition
|
||||
ModuleId="Core_PostFX"
|
||||
VersionId="1"
|
||||
Description="Module that implements the core engine-level setup for the game."
|
||||
ScriptFile="Core_PostFX.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy"
|
||||
Group="Core"
|
||||
Dependencies="Core_Rendering=1,Core_Lighting=1">
|
||||
</ModuleDefinition>
|
||||
|
|
@ -2526,7 +2526,7 @@
|
|||
sinkAllKeyEvents = "0";
|
||||
password = "0";
|
||||
passwordMask = "*";
|
||||
text = "core/images/null_color_ramp.png";
|
||||
text = "core/postFX/images/null_color_ramp.png";
|
||||
maxLength = "1024";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
BIN
Templates/BaseGame/game/core/postFX/images/inactive-overlay.png
Normal file
|
After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
|
@ -162,7 +162,7 @@ singleton PostEffect( MLAAFx )
|
|||
|
||||
texture[0] = "$inTex"; // Edges mask
|
||||
texture[1] = "$inTex"; // Edges mask
|
||||
texture[2] = "core/images/AreaMap33.dds";
|
||||
texture[2] = "core/postFX/images/AreaMap33.dds";
|
||||
};
|
||||
|
||||
new PostEffect()
|
||||