mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Initial implementation of the new Base Game Template and some starting modules.
This makes some tweaks to the engine to support this, specifically, it tweaks the hardcoded shaderpaths to defer to a pref variable, so none of the shader paths are hardcoded. Also tweaks how post effects read in texture files, removing a bizzare filepath interpretation choice, where if the file path didn't start with "/" it forcefully appended the script's file path. This made it impossible to have images not in the same dir as the script file defining the post effect. This was changed and the existing template's post effects tweaked for now to just add "./" to those few paths impacted, as well as the perf vars to support the non-hardcoded shader paths in the engine.
This commit is contained in:
parent
5c8a82180b
commit
d680dc9934
2321 changed files with 296541 additions and 85 deletions
|
|
@ -0,0 +1,118 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
if ( isObject( moveMap ) )
|
||||
moveMap.delete();
|
||||
|
||||
new ActionMap(moveMap);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Non-remapable binds
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(PauseMenu);");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Movement Keys
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bind( keyboard, a, moveleft );
|
||||
moveMap.bind( keyboard, d, moveright );
|
||||
moveMap.bind( keyboard, left, moveleft );
|
||||
moveMap.bind( keyboard, right, moveright );
|
||||
|
||||
moveMap.bind( keyboard, w, moveforward );
|
||||
moveMap.bind( keyboard, s, movebackward );
|
||||
moveMap.bind( keyboard, up, moveforward );
|
||||
moveMap.bind( keyboard, down, movebackward );
|
||||
|
||||
moveMap.bind( keyboard, e, moveup );
|
||||
moveMap.bind( keyboard, c, movedown );
|
||||
|
||||
moveMap.bind( keyboard, space, jump );
|
||||
moveMap.bind( mouse, xaxis, yaw );
|
||||
moveMap.bind( mouse, yaxis, pitch );
|
||||
|
||||
moveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw );
|
||||
moveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch );
|
||||
moveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX );
|
||||
moveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );
|
||||
|
||||
moveMap.bind( gamepad, btn_a, jump );
|
||||
moveMap.bindCmd( gamepad, btn_back, "disconnect();", "" );
|
||||
|
||||
moveMap.bindCmd(gamepad, dpadl, "toggleLightColorViz();", "");
|
||||
moveMap.bindCmd(gamepad, dpadu, "toggleDepthViz();", "");
|
||||
moveMap.bindCmd(gamepad, dpadd, "toggleNormalsViz();", "");
|
||||
moveMap.bindCmd(gamepad, dpadr, "toggleLightSpecularViz();", "");
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Mouse Trigger
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bind( mouse, button0, mouseFire );
|
||||
moveMap.bind( mouse, button1, altTrigger );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Gamepad Trigger
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bind(gamepad, triggerr, gamepadFire);
|
||||
moveMap.bind(gamepad, triggerl, gamepadAltTrigger);
|
||||
|
||||
moveMap.bind(keyboard, f, setZoomFOV);
|
||||
moveMap.bind(keyboard, r, toggleZoom);
|
||||
moveMap.bind( gamepad, btn_b, toggleZoom );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Camera & View functions
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bind( keyboard, z, toggleFreeLook );
|
||||
moveMap.bind(keyboard, tab, toggleFirstPerson );
|
||||
moveMap.bind(keyboard, "alt c", toggleCamera);
|
||||
|
||||
moveMap.bind( gamepad, btn_back, toggleCamera );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Demo recording functions
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bind( keyboard, F3, startRecordingDemo );
|
||||
moveMap.bind( keyboard, F4, stopRecordingDemo );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helper Functions
|
||||
//------------------------------------------------------------------------------
|
||||
moveMap.bind(keyboard, "F8", dropCameraAtPlayer);
|
||||
moveMap.bind(keyboard, "F7", dropPlayerAtCamera);
|
||||
|
||||
GlobalActionMap.bind(keyboard, "ctrl o", bringUpOptions);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Debugging Functions
|
||||
//------------------------------------------------------------------------------
|
||||
GlobalActionMap.bind(keyboard, "ctrl F2", showMetrics);
|
||||
GlobalActionMap.bind(keyboard, "ctrl F3", doProfile);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Misc.
|
||||
//------------------------------------------------------------------------------
|
||||
GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
|
||||
GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
|
||||
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();");
|
||||
|
|
@ -0,0 +1,426 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Non-remapable binds
|
||||
//------------------------------------------------------------------------------
|
||||
function escapeFromGame()
|
||||
{
|
||||
/*if ( $Server::ServerType $= "SinglePlayer" )
|
||||
MessageBoxYesNo( "Exit", "Exit from this Mission?", "disconnect();", "");
|
||||
else
|
||||
MessageBoxYesNo( "Disconnect", "Disconnect from the server?", "disconnect();", "");*/
|
||||
disconnect();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Movement Keys
|
||||
//------------------------------------------------------------------------------
|
||||
$movementSpeed = 1; // m/s
|
||||
|
||||
function setSpeed(%speed)
|
||||
{
|
||||
if(%speed)
|
||||
$movementSpeed = %speed;
|
||||
}
|
||||
|
||||
function moveleft(%val)
|
||||
{
|
||||
$mvLeftAction = %val * $movementSpeed;
|
||||
}
|
||||
|
||||
function moveright(%val)
|
||||
{
|
||||
$mvRightAction = %val * $movementSpeed;
|
||||
}
|
||||
|
||||
function moveforward(%val)
|
||||
{
|
||||
$mvForwardAction = %val * $movementSpeed;
|
||||
}
|
||||
|
||||
function movebackward(%val)
|
||||
{
|
||||
$mvBackwardAction = %val * $movementSpeed;
|
||||
}
|
||||
|
||||
function moveup(%val)
|
||||
{
|
||||
%object = ServerConnection.getControlObject();
|
||||
|
||||
if(%object.isInNamespaceHierarchy("Camera"))
|
||||
$mvUpAction = %val * $movementSpeed;
|
||||
}
|
||||
|
||||
function movedown(%val)
|
||||
{
|
||||
%object = ServerConnection.getControlObject();
|
||||
|
||||
if(%object.isInNamespaceHierarchy("Camera"))
|
||||
$mvDownAction = %val * $movementSpeed;
|
||||
}
|
||||
|
||||
function turnLeft( %val )
|
||||
{
|
||||
$mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function turnRight( %val )
|
||||
{
|
||||
$mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function panUp( %val )
|
||||
{
|
||||
$mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function panDown( %val )
|
||||
{
|
||||
$mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function getVerticalMouseAdjustAmount(%val)
|
||||
{
|
||||
%sensitivity = $pref::Input::VertMouseSensitivity;
|
||||
|
||||
// based on a default camera FOV of 90'
|
||||
if(ServerConnection.zoomed)
|
||||
%sensitivity = $pref::Input::ZoomVertMouseSensitivity;
|
||||
|
||||
if($pref::Input::invertVerticalMouse)
|
||||
%sensitivity *= -1;
|
||||
|
||||
return(%val * ($cameraFov / 90) * 0.01) * %sensitivity;
|
||||
}
|
||||
|
||||
function getHorizontalMouseAdjustAmount(%val)
|
||||
{
|
||||
%sensitivity = $pref::Input::HorzMouseSensitivity;
|
||||
|
||||
// based on a default camera FOV of 90'
|
||||
if(ServerConnection.zoomed)
|
||||
%sensitivity = $pref::Input::ZoomHorzMouseSensitivity;
|
||||
|
||||
return(%val * ($cameraFov / 90) * 0.01) * %sensitivity;
|
||||
}
|
||||
|
||||
function getRollMouseAdjustAmount(%val)
|
||||
{
|
||||
return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::RollMouseSensitivity;
|
||||
}
|
||||
|
||||
function getGamepadAdjustAmount(%val)
|
||||
{
|
||||
// based on a default camera FOV of 90'
|
||||
return(%val * ($cameraFov / 90) * 0.01) * 10.0;
|
||||
}
|
||||
|
||||
function yaw(%val)
|
||||
{
|
||||
%yawAdj = getHorizontalMouseAdjustAmount(%val);
|
||||
if(ServerConnection.isControlObjectRotDampedCamera())
|
||||
{
|
||||
// Clamp and scale
|
||||
%yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01);
|
||||
%yawAdj *= 0.5;
|
||||
}
|
||||
|
||||
$mvYaw += %yawAdj;
|
||||
}
|
||||
|
||||
function pitch(%val)
|
||||
{
|
||||
%pitchAdj = getVerticalMouseAdjustAmount(%val);
|
||||
if(ServerConnection.isControlObjectRotDampedCamera())
|
||||
{
|
||||
// Clamp and scale
|
||||
%pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01);
|
||||
%pitchAdj *= 0.5;
|
||||
}
|
||||
|
||||
$mvPitch += %pitchAdj;
|
||||
}
|
||||
|
||||
function jump(%val)
|
||||
{
|
||||
$mvTriggerCount2++;
|
||||
}
|
||||
|
||||
function gamePadMoveX( %val )
|
||||
{
|
||||
$mvXAxis_L = %val;
|
||||
}
|
||||
|
||||
function gamePadMoveY( %val )
|
||||
{
|
||||
$mvYAxis_L = %val;
|
||||
}
|
||||
|
||||
function gamepadYaw(%val)
|
||||
{
|
||||
%yawAdj = getGamepadAdjustAmount(%val);
|
||||
if(ServerConnection.isControlObjectRotDampedCamera())
|
||||
{
|
||||
// Clamp and scale
|
||||
%yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01);
|
||||
%yawAdj *= 0.5;
|
||||
}
|
||||
|
||||
if(%yawAdj > 0)
|
||||
{
|
||||
$mvYawLeftSpeed = %yawAdj;
|
||||
$mvYawRightSpeed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mvYawLeftSpeed = 0;
|
||||
$mvYawRightSpeed = -%yawAdj;
|
||||
}
|
||||
}
|
||||
|
||||
function gamepadPitch(%val)
|
||||
{
|
||||
%pitchAdj = getGamepadAdjustAmount(%val);
|
||||
if(ServerConnection.isControlObjectRotDampedCamera())
|
||||
{
|
||||
// Clamp and scale
|
||||
%pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01);
|
||||
%pitchAdj *= 0.5;
|
||||
}
|
||||
|
||||
if(%pitchAdj > 0)
|
||||
{
|
||||
$mvPitchDownSpeed = %pitchAdj;
|
||||
$mvPitchUpSpeed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mvPitchDownSpeed = 0;
|
||||
$mvPitchUpSpeed = -%pitchAdj;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Mouse Trigger
|
||||
//------------------------------------------------------------------------------
|
||||
function mouseFire(%val)
|
||||
{
|
||||
$mvTriggerCount0++;
|
||||
}
|
||||
|
||||
function altTrigger(%val)
|
||||
{
|
||||
$mvTriggerCount1++;
|
||||
|
||||
toggleZoom(%val);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Gamepad Trigger
|
||||
//------------------------------------------------------------------------------
|
||||
function gamepadFire(%val)
|
||||
{
|
||||
if(%val > 0.1 && !$gamepadFireTriggered)
|
||||
{
|
||||
$gamepadFireTriggered = true;
|
||||
$mvTriggerCount0++;
|
||||
}
|
||||
else if(%val <= 0.1 && $gamepadFireTriggered)
|
||||
{
|
||||
$gamepadFireTriggered = false;
|
||||
$mvTriggerCount0++;
|
||||
}
|
||||
}
|
||||
|
||||
function gamepadAltTrigger(%val)
|
||||
{
|
||||
if(%val > 0.1 && !$gamepadAltTriggerTriggered)
|
||||
{
|
||||
$gamepadAltTriggerTriggered = true;
|
||||
$mvTriggerCount1++;
|
||||
}
|
||||
else if(%val <= 0.1 && $gamepadAltTriggerTriggered)
|
||||
{
|
||||
$gamepadAltTriggerTriggered = false;
|
||||
$mvTriggerCount1++;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Zoom and FOV functions
|
||||
//------------------------------------------------------------------------------
|
||||
if($Player::CurrentFOV $= "")
|
||||
$Player::CurrentFOV = $pref::Player::DefaultFOV;
|
||||
|
||||
// toggleZoomFOV() works by dividing the CurrentFOV by 2. Each time that this
|
||||
// toggle is hit it simply divides the CurrentFOV by 2 once again. If the
|
||||
// FOV is reduced below a certain threshold then it resets to equal half of the
|
||||
// DefaultFOV value. This gives us 4 zoom levels to cycle through.
|
||||
|
||||
function toggleZoomFOV()
|
||||
{
|
||||
$Player::CurrentFOV = $Player::CurrentFOV / 2;
|
||||
|
||||
if($Player::CurrentFOV < 5)
|
||||
resetCurrentFOV();
|
||||
|
||||
if(ServerConnection.zoomed)
|
||||
setFOV($Player::CurrentFOV);
|
||||
else
|
||||
{
|
||||
setFov(ServerConnection.getControlCameraDefaultFov());
|
||||
}
|
||||
}
|
||||
|
||||
function resetCurrentFOV()
|
||||
{
|
||||
$Player::CurrentFOV = ServerConnection.getControlCameraDefaultFov() / 2;
|
||||
}
|
||||
|
||||
function turnOffZoom()
|
||||
{
|
||||
ServerConnection.zoomed = false;
|
||||
setFov(ServerConnection.getControlCameraDefaultFov());
|
||||
|
||||
// Rather than just disable the DOF effect, we want to set it to the level's
|
||||
// preset values.
|
||||
//DOFPostEffect.disable();
|
||||
ppOptionsUpdateDOFSettings();
|
||||
}
|
||||
|
||||
function setZoomFOV(%val)
|
||||
{
|
||||
if(%val)
|
||||
toggleZoomFOV();
|
||||
}
|
||||
|
||||
function toggleZoom(%val)
|
||||
{
|
||||
if (%val)
|
||||
{
|
||||
ServerConnection.zoomed = true;
|
||||
setFov($Player::CurrentFOV);
|
||||
|
||||
DOFPostEffect.setAutoFocus( true );
|
||||
DOFPostEffect.setFocusParams( 0.5, 0.5, 50, 500, -5, 5 );
|
||||
DOFPostEffect.enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
turnOffZoom();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Camera & View functions
|
||||
//------------------------------------------------------------------------------
|
||||
function toggleFreeLook( %val )
|
||||
{
|
||||
if ( %val )
|
||||
$mvFreeLook = true;
|
||||
else
|
||||
$mvFreeLook = false;
|
||||
}
|
||||
|
||||
function toggleFirstPerson(%val)
|
||||
{
|
||||
if (%val)
|
||||
{
|
||||
ServerConnection.setFirstPerson(!ServerConnection.isFirstPerson());
|
||||
}
|
||||
}
|
||||
|
||||
function toggleCamera(%val)
|
||||
{
|
||||
if (%val)
|
||||
commandToServer('ToggleCamera');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Demo recording functions
|
||||
//------------------------------------------------------------------------------
|
||||
function startRecordingDemo( %val )
|
||||
{
|
||||
if ( %val )
|
||||
startDemoRecord();
|
||||
}
|
||||
|
||||
function stopRecordingDemo( %val )
|
||||
{
|
||||
if ( %val )
|
||||
stopDemoRecord();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helper Functions
|
||||
//------------------------------------------------------------------------------
|
||||
function dropCameraAtPlayer(%val)
|
||||
{
|
||||
if (%val)
|
||||
commandToServer('dropCameraAtPlayer');
|
||||
}
|
||||
|
||||
function dropPlayerAtCamera(%val)
|
||||
{
|
||||
if (%val)
|
||||
commandToServer('DropPlayerAtCamera');
|
||||
}
|
||||
|
||||
function bringUpOptions(%val)
|
||||
{
|
||||
if (%val)
|
||||
Canvas.pushDialog(OptionsDlg);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Debugging Functions
|
||||
//------------------------------------------------------------------------------
|
||||
function showMetrics(%val)
|
||||
{
|
||||
if(%val)
|
||||
metrics("fps gfx shadow sfx terrain groundcover forest net");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Start profiler by pressing ctrl f3
|
||||
// ctrl f3 - starts profile that will dump to console and file
|
||||
//
|
||||
function doProfile(%val)
|
||||
{
|
||||
if (%val)
|
||||
{
|
||||
// key down -- start profile
|
||||
echo("Starting profile session...");
|
||||
profilerReset();
|
||||
profilerEnable(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// key up -- finish off profile
|
||||
echo("Ending profile session...");
|
||||
|
||||
profilerDumpToFile("profilerDumpToFile" @ getSimTime() @ ".txt");
|
||||
profilerEnable(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
datablock CameraData(Observer)
|
||||
{
|
||||
mode = "Observer";
|
||||
};
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
datablock ParticleData(DefaultParticle)
|
||||
{
|
||||
textureName = "data/spectatorGameplay/art/particles/defaultParticle";
|
||||
dragCoefficient = 0.498534;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.499022;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 1313;
|
||||
lifetimeVarianceMS = 500;
|
||||
useInvAlpha = true;
|
||||
spinRandomMin = -360;
|
||||
spinRandomMax = 360;
|
||||
spinSpeed = 1;
|
||||
|
||||
colors[0] = "0.992126 0.00787402 0.0314961 1";
|
||||
colors[1] = "1 0.834646 0 0.645669";
|
||||
colors[2] = "1 0.299213 0 0.330709";
|
||||
colors[3] = "0.732283 1 0 0";
|
||||
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 0.497467;
|
||||
sizes[2] = 0.73857;
|
||||
sizes[3] = 0.997986;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.247059;
|
||||
times[2] = 0.494118;
|
||||
times[3] = 1;
|
||||
|
||||
animTexName = "data/spectatorGameplay/art/particles/defaultParticle";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(DefaultEmitter)
|
||||
{
|
||||
ejectionPeriodMS = "50";
|
||||
ejectionVelocity = "1";
|
||||
velocityVariance = "0";
|
||||
ejectionOffset = "0.2";
|
||||
thetaMax = "40";
|
||||
particles = "DefaultParticle";
|
||||
blendStyle = "ADDITIVE";
|
||||
softParticles = "0";
|
||||
softnessDistance = "1";
|
||||
};
|
||||
608
Templates/Modules/spectatorGameplay/scripts/datablocks/lights.cs
Normal file
608
Templates/Modules/spectatorGameplay/scripts/datablocks/lights.cs
Normal file
|
|
@ -0,0 +1,608 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// LightAnimData
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock LightAnimData( NullLightAnim )
|
||||
{
|
||||
animEnabled = false;
|
||||
};
|
||||
|
||||
datablock LightAnimData( PulseLightAnim )
|
||||
{
|
||||
brightnessA = 0;
|
||||
brightnessZ = 1;
|
||||
brightnessPeriod = 1;
|
||||
brightnessKeys = "aza";
|
||||
brightnessSmooth = true;
|
||||
};
|
||||
|
||||
datablock LightAnimData( SubtlePulseLightAnim )
|
||||
{
|
||||
brightnessA = 0.5;
|
||||
brightnessZ = 1;
|
||||
brightnessPeriod = 1;
|
||||
brightnessKeys = "aza";
|
||||
brightnessSmooth = true;
|
||||
};
|
||||
|
||||
datablock LightAnimData( FlickerLightAnim )
|
||||
{
|
||||
brightnessA = 1;
|
||||
brightnessZ = 0;
|
||||
brightnessPeriod = 5;
|
||||
brightnessKeys = "aaazaaaaaazaaazaaazaaaaazaaaazzaaaazaaaaaazaaaazaaaza";
|
||||
brightnessSmooth = false;
|
||||
};
|
||||
|
||||
datablock LightAnimData( BlinkLightAnim )
|
||||
{
|
||||
brightnessA = 0;
|
||||
brightnessZ = 1;
|
||||
brightnessPeriod = 5;
|
||||
brightnessKeys = "azaaaazazaaaaaazaaaazaaaazzaaaaaazaazaaazaaaaaaa";
|
||||
brightnessSmooth = false;
|
||||
};
|
||||
|
||||
datablock LightAnimData( FireLightAnim )
|
||||
{
|
||||
brightnessA = 0.75;
|
||||
brightnessZ = 1;
|
||||
brightnessPeriod = 0.7;
|
||||
brightnessKeys = "annzzznnnzzzaznzzzz";
|
||||
brightnessSmooth = 0;
|
||||
offsetA[0] = "-0.05";
|
||||
offsetA[1] = "-0.05";
|
||||
offsetA[2] = "-0.05";
|
||||
offsetZ[0] = "0.05";
|
||||
offsetZ[1] = "0.05";
|
||||
offsetZ[2] = "0.05";
|
||||
offsetPeriod[0] = "1.25";
|
||||
offsetPeriod[1] = "1.25";
|
||||
offsetPeriod[2] = "1.25";
|
||||
offsetKeys[0] = "ahahaazahakayajza";
|
||||
offsetKeys[1] = "ahahaazahakayajza";
|
||||
offsetKeys[2] = "ahahaazahakayajza";
|
||||
rotKeys[0] = "";
|
||||
rotKeys[1] = "";
|
||||
rotKeys[2] = "";
|
||||
colorKeys[0] = "";
|
||||
colorKeys[1] = "";
|
||||
colorKeys[2] = "";
|
||||
};
|
||||
|
||||
datablock LightAnimData( SpinLightAnim )
|
||||
{
|
||||
rotA[2] = "0";
|
||||
rotZ[2] = "360";
|
||||
rotPeriod[2] = "1";
|
||||
rotKeys[2] = "az";
|
||||
rotSmooth[2] = true;
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// LightFlareData
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock LightFlareData( NullLightFlare )
|
||||
{
|
||||
flareEnabled = false;
|
||||
};
|
||||
|
||||
datablock LightFlareData( SunFlareExample )
|
||||
{
|
||||
overallScale = 4.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = false;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0";
|
||||
|
||||
elementRect[0] = "512 0 512 512";
|
||||
elementDist[0] = 0.0;
|
||||
elementScale[0] = 2.0;
|
||||
elementTint[0] = "0.6 0.6 0.6";
|
||||
elementRotate[0] = true;
|
||||
elementUseLightColor[0] = true;
|
||||
|
||||
elementRect[1] = "1152 0 128 128";
|
||||
elementDist[1] = 0.3;
|
||||
elementScale[1] = 0.7;
|
||||
elementTint[1] = "1.0 1.0 1.0";
|
||||
elementRotate[1] = true;
|
||||
elementUseLightColor[1] = true;
|
||||
|
||||
elementRect[2] = "1024 0 128 128";
|
||||
elementDist[2] = 0.5;
|
||||
elementScale[2] = 0.25;
|
||||
elementTint[2] = "1.0 1.0 1.0";
|
||||
elementRotate[2] = true;
|
||||
elementUseLightColor[2] = true;
|
||||
|
||||
elementRect[3] = "1024 128 128 128";
|
||||
elementDist[3] = 0.8;
|
||||
elementScale[3] = 0.7;
|
||||
elementTint[3] = "1.0 1.0 1.0";
|
||||
elementRotate[3] = true;
|
||||
elementUseLightColor[3] = true;
|
||||
|
||||
elementRect[4] = "1024 0 128 128";
|
||||
elementDist[4] = 1.18;
|
||||
elementScale[4] = 0.5;
|
||||
elementTint[4] = "1.0 1.0 1.0";
|
||||
elementRotate[4] = true;
|
||||
elementUseLightColor[4] = true;
|
||||
|
||||
elementRect[5] = "1152 128 128 128";
|
||||
elementDist[5] = 1.25;
|
||||
elementScale[5] = 0.25;
|
||||
elementTint[5] = "1.0 1.0 1.0";
|
||||
elementRotate[5] = true;
|
||||
elementUseLightColor[5] = true;
|
||||
|
||||
elementRect[6] = "1024 0 128 128";
|
||||
elementDist[6] = 2.0;
|
||||
elementScale[6] = 0.25;
|
||||
elementTint[6] = "1.0 1.0 1.0";
|
||||
elementRotate[6] = true;
|
||||
elementUseLightColor[6] = true;
|
||||
occlusionRadius = "0.25";
|
||||
};
|
||||
|
||||
datablock LightFlareData( SunFlareExample2 )
|
||||
{
|
||||
overallScale = 2.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = false;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0";
|
||||
|
||||
elementRect[0] = "1024 0 128 128";
|
||||
elementDist[0] = 0.5;
|
||||
elementScale[0] = 0.25;
|
||||
elementTint[0] = "1.0 1.0 1.0";
|
||||
elementRotate[0] = true;
|
||||
elementUseLightColor[0] = true;
|
||||
|
||||
elementRect[1] = "1024 128 128 128";
|
||||
elementDist[1] = 0.8;
|
||||
elementScale[1] = 0.7;
|
||||
elementTint[1] = "1.0 1.0 1.0";
|
||||
elementRotate[1] = true;
|
||||
elementUseLightColor[1] = true;
|
||||
|
||||
elementRect[2] = "1024 0 128 128";
|
||||
elementDist[2] = 1.18;
|
||||
elementScale[2] = 0.5;
|
||||
elementTint[2] = "1.0 1.0 1.0";
|
||||
elementRotate[2] = true;
|
||||
elementUseLightColor[2] = true;
|
||||
|
||||
elementRect[3] = "1152 128 128 128";
|
||||
elementDist[3] = 1.25;
|
||||
elementScale[3] = 0.25;
|
||||
elementTint[3] = "1.0 1.0 1.0";
|
||||
elementRotate[3] = true;
|
||||
elementUseLightColor[3] = true;
|
||||
|
||||
elementRect[4] = "1024 0 128 128";
|
||||
elementDist[4] = 2.0;
|
||||
elementScale[4] = 0.25;
|
||||
elementTint[4] = "0.7 0.7 0.7";
|
||||
elementRotate[4] = true;
|
||||
elementUseLightColor[4] = true;
|
||||
occlusionRadius = "0.25";
|
||||
};
|
||||
|
||||
datablock LightFlareData(SunFlareExample3)
|
||||
{
|
||||
overallScale = 2.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = false;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensflareSheet3.png";
|
||||
|
||||
elementRect[0] = "0 256 256 256";
|
||||
elementDist[0] = "-0.6";
|
||||
elementScale[0] = "3.5";
|
||||
elementTint[0] = "0.537255 0.537255 0.537255 1";
|
||||
elementRotate[0] = true;
|
||||
elementUseLightColor[0] = true;
|
||||
|
||||
elementRect[1] = "128 128 128 128";
|
||||
elementDist[1] = "0.1";
|
||||
elementScale[1] = "1.5";
|
||||
elementTint[1] = "0.996078 0.976471 0.721569 1";
|
||||
elementRotate[1] = true;
|
||||
elementUseLightColor[1] = true;
|
||||
|
||||
elementRect[2] = "0 0 64 64";
|
||||
elementDist[2] = "0.4";
|
||||
elementScale[2] = "0.25";
|
||||
elementTint[2] = "0 0 1 1";
|
||||
elementRotate[2] = true;
|
||||
elementUseLightColor[2] = true;
|
||||
|
||||
elementRect[3] = "0 0 64 64";
|
||||
elementDist[3] = "0.45";
|
||||
elementScale[3] = 0.25;
|
||||
elementTint[3] = "0 1 0 1";
|
||||
elementRotate[3] = true;
|
||||
elementUseLightColor[3] = true;
|
||||
|
||||
elementRect[4] = "0 0 64 64";
|
||||
elementDist[4] = "0.5";
|
||||
elementScale[4] = 0.25;
|
||||
elementTint[4] = "1 0 0 1";
|
||||
elementRotate[4] = true;
|
||||
elementUseLightColor[4] = true;
|
||||
elementRect[9] = "256 0 256 256";
|
||||
elementDist[3] = "0.45";
|
||||
elementScale[3] = "0.25";
|
||||
elementScale[9] = "2";
|
||||
elementRect[4] = "0 0 64 64";
|
||||
elementRect[5] = "128 0 128 128";
|
||||
elementDist[4] = "0.5";
|
||||
elementDist[5] = "1.2";
|
||||
elementScale[1] = "1.5";
|
||||
elementScale[4] = "0.25";
|
||||
elementScale[5] = "0.5";
|
||||
elementTint[1] = "0.996078 0.976471 0.721569 1";
|
||||
elementTint[2] = "0 0 1 1";
|
||||
elementTint[5] = "0.721569 0 1 1";
|
||||
elementRotate[5] = "0";
|
||||
elementUseLightColor[5] = "1";
|
||||
elementRect[0] = "0 256 256 256";
|
||||
elementRect[1] = "128 128 128 128";
|
||||
elementRect[2] = "0 0 64 64";
|
||||
elementRect[3] = "0 0 64 64";
|
||||
elementDist[0] = "-0.6";
|
||||
elementDist[1] = "0.1";
|
||||
elementDist[2] = "0.4";
|
||||
elementScale[0] = "3.5";
|
||||
elementScale[2] = "0.25";
|
||||
elementTint[0] = "0.537255 0.537255 0.537255 1";
|
||||
elementTint[3] = "0 1 0 1";
|
||||
elementTint[4] = "1 0 0 1";
|
||||
elementRect[6] = "64 64 64 64";
|
||||
elementDist[6] = "0.9";
|
||||
elementScale[6] = "4";
|
||||
elementTint[6] = "0.00392157 0.721569 0.00392157 1";
|
||||
elementRotate[6] = "0";
|
||||
elementUseLightColor[6] = "1";
|
||||
elementRect[7] = "64 64 64 64";
|
||||
elementRect[8] = "64 64 64 64";
|
||||
elementDist[7] = "0.25";
|
||||
elementDist[8] = "0.18";
|
||||
elementDist[9] = "0";
|
||||
elementScale[7] = "2";
|
||||
elementScale[8] = "0.5";
|
||||
elementTint[7] = "0.6 0.0117647 0.741176 1";
|
||||
elementTint[8] = "0.027451 0.690196 0.0117647 1";
|
||||
elementTint[9] = "0.647059 0.647059 0.647059 1";
|
||||
elementRotate[9] = "0";
|
||||
elementUseLightColor[7] = "1";
|
||||
elementUseLightColor[8] = "1";
|
||||
elementRect[10] = "256 256 256 256";
|
||||
elementRect[11] = "0 64 64 64";
|
||||
elementRect[12] = "0 64 64 64";
|
||||
elementRect[13] = "64 0 64 64";
|
||||
elementDist[10] = "0";
|
||||
elementDist[11] = "-0.3";
|
||||
elementDist[12] = "-0.32";
|
||||
elementDist[13] = "1";
|
||||
elementScale[10] = "10";
|
||||
elementScale[11] = "2.5";
|
||||
elementScale[12] = "0.3";
|
||||
elementScale[13] = "0.4";
|
||||
elementTint[10] = "0.321569 0.321569 0.321569 1";
|
||||
elementTint[11] = "0.443137 0.0431373 0.00784314 1";
|
||||
elementTint[12] = "0.00784314 0.996078 0.0313726 1";
|
||||
elementTint[13] = "0.996078 0.94902 0.00784314 1";
|
||||
elementUseLightColor[10] = "1";
|
||||
elementUseLightColor[11] = "1";
|
||||
elementUseLightColor[13] = "1";
|
||||
elementRect[14] = "0 0 64 64";
|
||||
elementDist[14] = "0.15";
|
||||
elementScale[14] = "0.8";
|
||||
elementTint[14] = "0.505882 0.0470588 0.00784314 1";
|
||||
elementRotate[14] = "1";
|
||||
elementUseLightColor[9] = "1";
|
||||
elementUseLightColor[14] = "1";
|
||||
elementRect[15] = "64 64 64 64";
|
||||
elementRect[16] = "0 64 64 64";
|
||||
elementRect[17] = "0 0 64 64";
|
||||
elementRect[18] = "0 64 64 64";
|
||||
elementRect[19] = "256 0 256 256";
|
||||
elementDist[15] = "0.8";
|
||||
elementDist[16] = "0.7";
|
||||
elementDist[17] = "1.4";
|
||||
elementDist[18] = "-0.5";
|
||||
elementDist[19] = "-1.5";
|
||||
elementScale[15] = "3";
|
||||
elementScale[16] = "0.3";
|
||||
elementScale[17] = "0.2";
|
||||
elementScale[18] = "1";
|
||||
elementScale[19] = "35";
|
||||
elementTint[15] = "0.00784314 0.00784314 0.996078 1";
|
||||
elementTint[16] = "0.992157 0.992157 0.992157 1";
|
||||
elementTint[17] = "0.996078 0.603922 0.00784314 1";
|
||||
elementTint[18] = "0.2 0.00392157 0.47451 1";
|
||||
elementTint[19] = "0.607843 0.607843 0.607843 1";
|
||||
elementUseLightColor[15] = "1";
|
||||
elementUseLightColor[18] = "1";
|
||||
elementUseLightColor[19] = "1";
|
||||
occlusionRadius = "0.25";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock LightFlareData(SunFlarePacificIsland)
|
||||
{
|
||||
overallScale = 2.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = false;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensflareSheet3.png";
|
||||
|
||||
elementRect[0] = "0 256 256 256";
|
||||
elementDist[0] = "-0.6";
|
||||
elementScale[0] = "3.5";
|
||||
elementTint[0] = "0.537255 0.537255 0.537255 1";
|
||||
elementRotate[0] = true;
|
||||
elementUseLightColor[0] = true;
|
||||
|
||||
elementRect[1] = "128 128 128 128";
|
||||
elementDist[1] = "0.1";
|
||||
elementScale[1] = "1.5";
|
||||
elementTint[1] = "0.996078 0.976471 0.721569 1";
|
||||
elementRotate[1] = true;
|
||||
elementUseLightColor[1] = true;
|
||||
|
||||
elementRect[2] = "0 0 64 64";
|
||||
elementDist[2] = "0.4";
|
||||
elementScale[2] = "0.25";
|
||||
elementTint[2] = "0 0 1 1";
|
||||
elementRotate[2] = true;
|
||||
elementUseLightColor[2] = true;
|
||||
|
||||
elementRect[3] = "0 0 64 64";
|
||||
elementDist[3] = "0.45";
|
||||
elementScale[3] = 0.25;
|
||||
elementTint[3] = "0 1 0 1";
|
||||
elementRotate[3] = true;
|
||||
elementUseLightColor[3] = true;
|
||||
|
||||
elementRect[4] = "0 0 64 64";
|
||||
elementDist[4] = "0.5";
|
||||
elementScale[4] = 0.25;
|
||||
elementTint[4] = "1 0 0 1";
|
||||
elementRotate[4] = true;
|
||||
elementUseLightColor[4] = true;
|
||||
elementRect[9] = "256 0 256 256";
|
||||
elementDist[3] = "0.45";
|
||||
elementScale[3] = "0.25";
|
||||
elementScale[9] = "2";
|
||||
elementRect[4] = "0 0 64 64";
|
||||
elementRect[5] = "128 0 128 128";
|
||||
elementDist[4] = "0.5";
|
||||
elementDist[5] = "1.2";
|
||||
elementScale[1] = "1.5";
|
||||
elementScale[4] = "0.25";
|
||||
elementScale[5] = "0.5";
|
||||
elementTint[1] = "0.996078 0.976471 0.721569 1";
|
||||
elementTint[2] = "0 0 1 1";
|
||||
elementTint[5] = "0.721569 0 1 1";
|
||||
elementRotate[5] = "0";
|
||||
elementUseLightColor[5] = "1";
|
||||
elementRect[0] = "0 256 256 256";
|
||||
elementRect[1] = "128 128 128 128";
|
||||
elementRect[2] = "0 0 64 64";
|
||||
elementRect[3] = "0 0 64 64";
|
||||
elementDist[0] = "-0.6";
|
||||
elementDist[1] = "0.1";
|
||||
elementDist[2] = "0.4";
|
||||
elementScale[0] = "3.5";
|
||||
elementScale[2] = "0.25";
|
||||
elementTint[0] = "0.537255 0.537255 0.537255 1";
|
||||
elementTint[3] = "0 1 0 1";
|
||||
elementTint[4] = "1 0 0 1";
|
||||
elementRect[6] = "64 64 64 64";
|
||||
elementDist[6] = "0.9";
|
||||
elementScale[6] = "4";
|
||||
elementTint[6] = "0.00392157 0.721569 0.00392157 1";
|
||||
elementRotate[6] = "0";
|
||||
elementUseLightColor[6] = "1";
|
||||
elementRect[7] = "64 64 64 64";
|
||||
elementRect[8] = "64 64 64 64";
|
||||
elementDist[7] = "0.25";
|
||||
elementDist[8] = "0.18";
|
||||
elementDist[9] = "0";
|
||||
elementScale[7] = "2";
|
||||
elementScale[8] = "0.5";
|
||||
elementTint[7] = "0.6 0.0117647 0.741176 1";
|
||||
elementTint[8] = "0.027451 0.690196 0.0117647 1";
|
||||
elementTint[9] = "0.647059 0.647059 0.647059 1";
|
||||
elementRotate[9] = "0";
|
||||
elementUseLightColor[7] = "1";
|
||||
elementUseLightColor[8] = "1";
|
||||
elementRect[10] = "256 256 256 256";
|
||||
elementRect[11] = "0 64 64 64";
|
||||
elementRect[12] = "0 64 64 64";
|
||||
elementRect[13] = "64 0 64 64";
|
||||
elementDist[10] = "0";
|
||||
elementDist[11] = "-0.3";
|
||||
elementDist[12] = "-0.32";
|
||||
elementDist[13] = "1";
|
||||
elementScale[10] = "10";
|
||||
elementScale[11] = "2.5";
|
||||
elementScale[12] = "0.3";
|
||||
elementScale[13] = "0.4";
|
||||
elementTint[10] = "0.321569 0.321569 0.321569 1";
|
||||
elementTint[11] = "0.443137 0.0431373 0.00784314 1";
|
||||
elementTint[12] = "0.00784314 0.996078 0.0313726 1";
|
||||
elementTint[13] = "0.996078 0.94902 0.00784314 1";
|
||||
elementUseLightColor[10] = "1";
|
||||
elementUseLightColor[11] = "1";
|
||||
elementUseLightColor[13] = "1";
|
||||
elementRect[14] = "0 0 64 64";
|
||||
elementDist[14] = "0.15";
|
||||
elementScale[14] = "0.8";
|
||||
elementTint[14] = "0.505882 0.0470588 0.00784314 1";
|
||||
elementRotate[14] = "1";
|
||||
elementUseLightColor[9] = "1";
|
||||
elementUseLightColor[14] = "1";
|
||||
elementRect[15] = "64 64 64 64";
|
||||
elementRect[16] = "0 64 64 64";
|
||||
elementRect[17] = "0 0 64 64";
|
||||
elementRect[18] = "0 64 64 64";
|
||||
elementRect[19] = "256 0 256 256";
|
||||
elementDist[15] = "0.8";
|
||||
elementDist[16] = "0.7";
|
||||
elementDist[17] = "1.4";
|
||||
elementDist[18] = "-0.5";
|
||||
elementDist[19] = "-1.5";
|
||||
elementScale[15] = "3";
|
||||
elementScale[16] = "0.3";
|
||||
elementScale[17] = "0.2";
|
||||
elementScale[18] = "1";
|
||||
elementScale[19] = "35";
|
||||
elementTint[15] = "0.00784314 0.00784314 0.996078 1";
|
||||
elementTint[16] = "0.992157 0.992157 0.992157 1";
|
||||
elementTint[17] = "0.996078 0.603922 0.00784314 1";
|
||||
elementTint[18] = "0.2 0.00392157 0.47451 1";
|
||||
elementTint[19] = "0.607843 0.607843 0.607843 1";
|
||||
elementUseLightColor[15] = "1";
|
||||
elementUseLightColor[18] = "1";
|
||||
elementUseLightColor[19] = "1";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock LightFlareData( LightFlareExample0 )
|
||||
{
|
||||
overallScale = 2.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = true;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet1";
|
||||
|
||||
elementRect[0] = "0 512 512 512";
|
||||
elementDist[0] = 0.0;
|
||||
elementScale[0] = 0.5;
|
||||
elementTint[0] = "1.0 1.0 1.0";
|
||||
elementRotate[0] = false;
|
||||
elementUseLightColor[0] = false;
|
||||
|
||||
elementRect[1] = "512 0 512 512";
|
||||
elementDist[1] = 0.0;
|
||||
elementScale[1] = 2.0;
|
||||
elementTint[1] = "0.5 0.5 0.5";
|
||||
elementRotate[1] = false;
|
||||
elementUseLightColor[1] = false;
|
||||
occlusionRadius = "0.25";
|
||||
};
|
||||
|
||||
datablock LightFlareData( LightFlareExample1 )
|
||||
{
|
||||
overallScale = 2.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = true;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet1";
|
||||
|
||||
elementRect[0] = "512 512 512 512";
|
||||
elementDist[0] = 0.0;
|
||||
elementScale[0] = 0.5;
|
||||
elementTint[0] = "1.0 1.0 1.0";
|
||||
elementRotate[0] = false;
|
||||
elementUseLightColor[0] = false;
|
||||
|
||||
elementRect[1] = "512 0 512 512";
|
||||
elementDist[1] = 0.0;
|
||||
elementScale[1] = 2.0;
|
||||
elementTint[1] = "0.5 0.5 0.5";
|
||||
elementRotate[1] = false;
|
||||
elementUseLightColor[1] = false;
|
||||
occlusionRadius = "0.25";
|
||||
};
|
||||
|
||||
datablock LightFlareData( LightFlareExample2 )
|
||||
{
|
||||
overallScale = 2.0;
|
||||
flareEnabled = true;
|
||||
renderReflectPass = true;
|
||||
flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0";
|
||||
|
||||
elementRect[0] = "512 512 512 512";
|
||||
elementDist[0] = 0.0;
|
||||
elementScale[0] = 0.5;
|
||||
elementTint[0] = "1.0 1.0 1.0";
|
||||
elementRotate[0] = true;
|
||||
elementUseLightColor[0] = true;
|
||||
|
||||
elementRect[1] = "512 0 512 512";
|
||||
elementDist[1] = 0.0;
|
||||
elementScale[1] = 2.0;
|
||||
elementTint[1] = "0.7 0.7 0.7";
|
||||
elementRotate[1] = true;
|
||||
elementUseLightColor[1] = true;
|
||||
|
||||
elementRect[2] = "1152 0 128 128";
|
||||
elementDist[2] = 0.3;
|
||||
elementScale[2] = 0.5;
|
||||
elementTint[2] = "1.0 1.0 1.0";
|
||||
elementRotate[2] = true;
|
||||
elementUseLightColor[2] = true;
|
||||
|
||||
elementRect[3] = "1024 0 128 128";
|
||||
elementDist[3] = 0.5;
|
||||
elementScale[3] = 0.25;
|
||||
elementTint[3] = "1.0 1.0 1.0";
|
||||
elementRotate[3] = true;
|
||||
elementUseLightColor[3] = true;
|
||||
|
||||
elementRect[4] = "1024 128 128 128";
|
||||
elementDist[4] = 0.8;
|
||||
elementScale[4] = 0.6;
|
||||
elementTint[4] = "1.0 1.0 1.0";
|
||||
elementRotate[4] = true;
|
||||
elementUseLightColor[4] = true;
|
||||
|
||||
elementRect[5] = "1024 0 128 128";
|
||||
elementDist[5] = 1.18;
|
||||
elementScale[5] = 0.5;
|
||||
elementTint[5] = "0.7 0.7 0.7";
|
||||
elementRotate[5] = true;
|
||||
elementUseLightColor[5] = true;
|
||||
|
||||
elementRect[6] = "1152 128 128 128";
|
||||
elementDist[6] = 1.25;
|
||||
elementScale[6] = 0.35;
|
||||
elementTint[6] = "0.8 0.8 0.8";
|
||||
elementRotate[6] = true;
|
||||
elementUseLightColor[6] = true;
|
||||
|
||||
elementRect[7] = "1024 0 128 128";
|
||||
elementDist[7] = 2.0;
|
||||
elementScale[7] = 0.25;
|
||||
elementTint[7] = "1.0 1.0 1.0";
|
||||
elementRotate[7] = true;
|
||||
elementUseLightColor[7] = true;
|
||||
};
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// This is the default save location for any Datablocks created in the
|
||||
// Datablock Editor (this script is executed from onServerCreated())
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// This is the default save location for any Decal datablocks created in the
|
||||
// Decal Editor (this script is executed from onServerCreated())
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// This is the default save location for any Particle datablocks created in the
|
||||
// Particle Editor (this script is executed from onServerCreated())
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// This is the default save location for any Particle Emitter datablocks created in the
|
||||
// Particle Editor (this script is executed from onServerCreated())
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
datablock MissionMarkerData(WayPointMarker)
|
||||
{
|
||||
category = "Misc";
|
||||
shapeFile = "data/spectatorGameplay/art/shapes/octahedron.dts";
|
||||
};
|
||||
|
||||
datablock MissionMarkerData(SpawnSphereMarker)
|
||||
{
|
||||
category = "Misc";
|
||||
shapeFile = "data/spectatorGameplay/art/shapes/octahedron.dts";
|
||||
};
|
||||
|
||||
datablock MissionMarkerData(CameraBookmarkMarker)
|
||||
{
|
||||
category = "Misc";
|
||||
shapeFile = "data/spectatorGameplay/art/shapes/camera.dts";
|
||||
};
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
datablock RibbonNodeData(DefaultRibbonNodeData)
|
||||
{
|
||||
timeMultiple = 1.0;
|
||||
};
|
||||
|
||||
//ribbon data////////////////////////////////////////
|
||||
|
||||
datablock RibbonData(BasicRibbon)
|
||||
{
|
||||
size[0] = 0.5;
|
||||
color[0] = "1.0 0.0 0.0 1.0";
|
||||
position[0] = 0.0;
|
||||
|
||||
size[1] = 0.0;
|
||||
color[1] = "1.0 0.0 0.0 0.0";
|
||||
position[1] = 1.0;
|
||||
|
||||
RibbonLength = 40;
|
||||
fadeAwayStep = 0.1;
|
||||
UseFadeOut = true;
|
||||
RibbonMaterial = BasicRibbonMat;
|
||||
|
||||
category = "FX";
|
||||
};
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
80
Templates/Modules/spectatorGameplay/scripts/gui/playGui.cs
Normal file
80
Templates/Modules/spectatorGameplay/scripts/gui/playGui.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PlayGui is the main TSControl through which the game is viewed.
|
||||
// The PlayGui also contains the hud controls.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function PlayGui::onWake(%this)
|
||||
{
|
||||
// Turn off any shell sounds...
|
||||
// sfxStop( ... );
|
||||
|
||||
$enableDirectInput = "1";
|
||||
activateDirectInput();
|
||||
|
||||
// Message hud dialog
|
||||
if ( isObject( MainChatHud ) )
|
||||
{
|
||||
Canvas.pushDialog( MainChatHud );
|
||||
chatHud.attach(HudMessageVector);
|
||||
}
|
||||
|
||||
// just update the action map here
|
||||
moveMap.push();
|
||||
|
||||
// hack city - these controls are floating around and need to be clamped
|
||||
if ( isFunction( "refreshCenterTextCtrl" ) )
|
||||
schedule(0, 0, "refreshCenterTextCtrl");
|
||||
if ( isFunction( "refreshBottomTextCtrl" ) )
|
||||
schedule(0, 0, "refreshBottomTextCtrl");
|
||||
}
|
||||
|
||||
function PlayGui::onSleep(%this)
|
||||
{
|
||||
if ( isObject( MainChatHud ) )
|
||||
Canvas.popDialog( MainChatHud );
|
||||
|
||||
// pop the keymaps
|
||||
moveMap.pop();
|
||||
}
|
||||
|
||||
function PlayGui::clearHud( %this )
|
||||
{
|
||||
Canvas.popDialog( MainChatHud );
|
||||
|
||||
while ( %this.getCount() > 0 )
|
||||
%this.getObject( 0 ).delete();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function refreshBottomTextCtrl()
|
||||
{
|
||||
BottomPrintText.position = "0 0";
|
||||
}
|
||||
|
||||
function refreshCenterTextCtrl()
|
||||
{
|
||||
CenterPrintText.position = "0 0";
|
||||
}
|
||||
39
Templates/Modules/spectatorGameplay/scripts/gui/playGui.gui
Normal file
39
Templates/Modules/spectatorGameplay/scripts/gui/playGui.gui
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
new GameTSCtrl(PlayGui) {
|
||||
isContainer = "1";
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 8";
|
||||
canSave = "1";
|
||||
visible = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
cameraZRot = "0";
|
||||
forceFOV = "0";
|
||||
enabled = "1";
|
||||
helpTag = "0";
|
||||
noCursor = "1";
|
||||
|
||||
new GuiBitmapCtrl(LagIcon) {
|
||||
bitmap = "data/ui/art/lagIcon.png";
|
||||
wrap = "0";
|
||||
isContainer = "0";
|
||||
Profile = "GuiDefaultProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
position = "572 3";
|
||||
Extent = "32 32";
|
||||
MinExtent = "8 8";
|
||||
canSave = "1";
|
||||
Visible = "0";
|
||||
tooltipprofile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// What kind of "player" is spawned is either controlled directly by the
|
||||
// SpawnSphere or it defaults back to the values set here. This also controls
|
||||
// which SimGroups to attempt to select the spawn sphere's from by walking down
|
||||
// the list of SpawnGroups till it finds a valid spawn object.
|
||||
// These override the values set in core/scripts/server/spawn.cs
|
||||
//-----------------------------------------------------------------------------
|
||||
function DefaultGame::initGameVars(%this)
|
||||
{
|
||||
// Leave $Game::defaultPlayerClass and $Game::defaultPlayerDataBlock as empty strings ("")
|
||||
// to spawn a the $Game::defaultCameraClass as the control object.
|
||||
$Game::DefaultPlayerClass = "";
|
||||
$Game::DefaultPlayerDataBlock = "";
|
||||
$Game::DefaultPlayerSpawnGroups = "CameraSpawnPoints PlayerSpawnPoints PlayerDropPoints";
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// What kind of "camera" is spawned is either controlled directly by the
|
||||
// SpawnSphere or it defaults back to the values set here. This also controls
|
||||
// which SimGroups to attempt to select the spawn sphere's from by walking down
|
||||
// the list of SpawnGroups till it finds a valid spawn object.
|
||||
// These override the values set in core/scripts/server/spawn.cs
|
||||
//-----------------------------------------------------------------------------
|
||||
$Game::DefaultCameraClass = "Camera";
|
||||
$Game::DefaultCameraDataBlock = "Observer";
|
||||
$Game::DefaultCameraSpawnGroups = "CameraSpawnPoints PlayerSpawnPoints PlayerDropPoints";
|
||||
|
||||
// Global movement speed that affects all Cameras
|
||||
$Camera::MovementSpeed = 30;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// DefaultGame manages the communication between the server's world and the
|
||||
// client's simulation. These functions are responsible for maintaining the
|
||||
// client's camera and player objects.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// This is the main entry point for spawning a control object for the client.
|
||||
// The control object is the actual game object that the client is responsible
|
||||
// for controlling in the client and server simulations. We also spawn a
|
||||
// convenient camera object for use as an alternate control object. We do not
|
||||
// have to spawn this camera object in order to function in the simulation.
|
||||
//
|
||||
// Called for each client after it's finished downloading the mission and is
|
||||
// ready to start playing.
|
||||
//-----------------------------------------------------------------------------
|
||||
function DefaultGame::onClientEnterGame(%this, %client)
|
||||
{
|
||||
// This function currently relies on some helper functions defined in
|
||||
// core/scripts/spawn.cs. For custom spawn behaviors one can either
|
||||
// override the properties on the SpawnSphere's or directly override the
|
||||
// functions themselves.
|
||||
|
||||
// Find a spawn point for the camera
|
||||
%cameraSpawnPoint = %this.pickCameraSpawnPoint($Game::DefaultCameraSpawnGroups);
|
||||
|
||||
// Spawn a camera for this client using the found %spawnPoint
|
||||
%this.spawnCamera(%cameraSpawnPoint, %client);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Clean up the client's control objects
|
||||
//-----------------------------------------------------------------------------
|
||||
function DefaultGame::onClientLeaveGame(%this, %client)
|
||||
{
|
||||
// Cleanup the camera
|
||||
if (isObject(%this.camera))
|
||||
%this.camera.delete();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The server has started up so do some game start up
|
||||
//-----------------------------------------------------------------------------
|
||||
function DefaultGame::onMissionStart(%this)
|
||||
{
|
||||
//set up the game and game variables
|
||||
%this.initGameVars();
|
||||
|
||||
$Game::Duration = %this.duration;
|
||||
}
|
||||
|
||||
function DefaultGame::onMissionEnded(%this)
|
||||
{
|
||||
cancel($Game::Schedule);
|
||||
$Game::Running = false;
|
||||
$Game::Cycling = false;
|
||||
}
|
||||
|
||||
function DefaultGame::onMissionReset(%this)
|
||||
{
|
||||
// Called by resetMission(), after all the temporary mission objects
|
||||
// have been deleted.
|
||||
%this.initGameVars();
|
||||
|
||||
$Game::Duration = %this.duration;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Functions that implement game-play
|
||||
// These are here for backwards compatibilty only, games and/or mods should
|
||||
// really be overloading the server and mission functions listed ubove.
|
||||
//-----------------------------------------------------------------------------
|
||||
function DefaultGame::pickCameraSpawnPoint(%this, %spawnGroups)
|
||||
{
|
||||
// Walk through the groups until we find a valid object
|
||||
for (%i = 0; %i < getWordCount(%spawnGroups); %i++)
|
||||
{
|
||||
%group = getWord(%spawnGroups, %i);
|
||||
|
||||
%count = getWordCount(%group);
|
||||
|
||||
if (isObject(%group))
|
||||
%spawnPoint = %group.getRandom();
|
||||
|
||||
if (isObject(%spawnPoint))
|
||||
return %spawnPoint;
|
||||
}
|
||||
|
||||
// Didn't find a spawn point by looking for the groups
|
||||
// so let's return the "default" SpawnSphere
|
||||
// First create it if it doesn't already exist
|
||||
if (!isObject(DefaultCameraSpawnSphere))
|
||||
{
|
||||
%spawn = new SpawnSphere(DefaultCameraSpawnSphere)
|
||||
{
|
||||
dataBlock = "SpawnSphereMarker";
|
||||
spawnClass = $Game::DefaultCameraClass;
|
||||
spawnDatablock = $Game::DefaultCameraDataBlock;
|
||||
};
|
||||
|
||||
// Add it to the MissionCleanup group so that it
|
||||
// doesn't get saved to the Mission (and gets cleaned
|
||||
// up of course)
|
||||
MissionCleanup.add(%spawn);
|
||||
}
|
||||
|
||||
return DefaultCameraSpawnSphere;
|
||||
}
|
||||
|
||||
function DefaultGame::spawnCamera(%this, %spawnPoint, %client)
|
||||
{
|
||||
// Set the control object to the default camera
|
||||
if (!isObject(%client.camera))
|
||||
{
|
||||
%camObj = spawnObject(Camera, Observer);
|
||||
%client.camera = %camObj;
|
||||
}
|
||||
|
||||
// If we have a camera then set up some properties
|
||||
if (isObject(%client.camera))
|
||||
{
|
||||
MissionCleanup.add( %client.camera );
|
||||
%client.camera.scopeToClient(%client);
|
||||
|
||||
%client.setControlObject(%client.camera);
|
||||
|
||||
if (isDefined("%spawnPoint"))
|
||||
{
|
||||
// Attempt to treat %spawnPoint as an object
|
||||
if (getWordCount(%spawnPoint) == 1 && isObject(%spawnPoint))
|
||||
{
|
||||
%client.camera.setTransform(%spawnPoint.getTransform());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Treat %spawnPoint as an AxisAngle transform
|
||||
%client.camera.setTransform(%spawnPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 VolumetricFog::onEnterFog(%this,%obj)
|
||||
{
|
||||
// This method is called whenever the control object (Camera or Player)
|
||||
// %obj enters the fog area.
|
||||
|
||||
// echo("Control Object " @ %obj @ " enters fog " @ %this);
|
||||
}
|
||||
|
||||
function VolumetricFog::onLeaveFog(%this,%obj)
|
||||
{
|
||||
// This method is called whenever the control object (Camera or Player)
|
||||
// %obj leaves the fog area.
|
||||
|
||||
// echo("Control Object " @ %obj @ " left fog " @ %this);
|
||||
}
|
||||
|
||||
function VolumetricFog::Dissolve(%this,%speed,%delete)
|
||||
{
|
||||
// This method dissolves the fog at speed milliseconds
|
||||
%this.isBuilding = true;
|
||||
if (%this.FogDensity > 0)
|
||||
{
|
||||
%this.setFogDensity(%this.FogDensity - 0.005);
|
||||
%this.schedule(%speed,Dissolve,%speed,%delete);
|
||||
}
|
||||
else
|
||||
{
|
||||
%this.isBuilding = false;
|
||||
%this.SetFogDensity(0.0);
|
||||
if (%delete !$= "" && %delete !$="0" && %delete !$="false")
|
||||
%this.schedule(250,delete);
|
||||
}
|
||||
}
|
||||
|
||||
function VolumetricFog::Thicken(%this,%speed, %end_density)
|
||||
{
|
||||
// This method thickens the fog at speed milliseconds to a density of %end_density
|
||||
|
||||
%this.isBuilding = true;
|
||||
if (%this.FogDensity + 0.005 < %end_density)
|
||||
{
|
||||
%this.setFogDensity(%this.FogDensity + 0.005);
|
||||
%this.schedule(%speed,Thicken,%speed, %end_density);
|
||||
}
|
||||
else
|
||||
{
|
||||
%this.setFogDensity(%end_density);
|
||||
%this.isBuilding = false;
|
||||
}
|
||||
}
|
||||
|
||||
function GenerateFog(%pos,%scale,%color,%density)
|
||||
{
|
||||
// This function can be used to generate some fog caused by massive gunfire etc.
|
||||
// Change shape and modulation data to your likings.
|
||||
|
||||
%fog=new VolumetricFog() {
|
||||
shapeName = "data/FPSGameplay/art/environment/Fog_Sphere.dts";
|
||||
fogColor = %color;
|
||||
fogDensity = "0.0";
|
||||
ignoreWater = "0";
|
||||
MinSize = "250";
|
||||
FadeSize = "750";
|
||||
texture = "data/FPSGameplay/art/environment/FogMod_heavy.dds";
|
||||
tiles = "1";
|
||||
modStrength = "0.2";
|
||||
PrimSpeed = "-0.01 0.04";
|
||||
SecSpeed = "0.02 0.02";
|
||||
position = %pos;
|
||||
rotation = "0 0 1 20.354";
|
||||
scale = %scale;
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
};
|
||||
|
||||
if (isObject(%fog))
|
||||
{
|
||||
MissionCleanup.add(%fog);
|
||||
|
||||
%fog.Thicken(500,%density);
|
||||
}
|
||||
|
||||
return %fog;
|
||||
}
|
||||
85
Templates/Modules/spectatorGameplay/scripts/server/camera.cs
Normal file
85
Templates/Modules/spectatorGameplay/scripts/server/camera.cs
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Global movement speed that affects all cameras. This should be moved
|
||||
// into the camera datablock.
|
||||
$Camera::movementSpeed = 30;
|
||||
|
||||
function Observer::onTrigger(%this,%obj,%trigger,%state)
|
||||
{
|
||||
// state = 0 means that a trigger key was released
|
||||
if (%state == 0)
|
||||
return;
|
||||
|
||||
// Default player triggers: 0=fire 1=altFire 2=jump
|
||||
%client = %obj.getControllingClient();
|
||||
switch$ (%obj.mode)
|
||||
{
|
||||
case "Observer":
|
||||
// Do something interesting.
|
||||
|
||||
case "Corpse":
|
||||
// Viewing dead corpse, so we probably want to respawn.
|
||||
%client.spawnPlayer();
|
||||
|
||||
// Set the camera back into observer mode, since in
|
||||
// debug mode we like to switch to it.
|
||||
%this.setMode(%obj,"Observer");
|
||||
}
|
||||
}
|
||||
|
||||
function Observer::setMode(%this,%obj,%mode,%arg1,%arg2,%arg3)
|
||||
{
|
||||
switch$ (%mode)
|
||||
{
|
||||
case "Observer":
|
||||
// Let the player fly around
|
||||
%obj.setFlyMode();
|
||||
|
||||
case "Corpse":
|
||||
// Lock the camera down in orbit around the corpse,
|
||||
// which should be arg1
|
||||
%transform = %arg1.getTransform();
|
||||
%obj.setOrbitMode(%arg1, %transform, 0.5, 4.5, 4.5);
|
||||
|
||||
}
|
||||
%obj.mode = %mode;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Camera methods
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function Camera::onAdd(%this,%obj)
|
||||
{
|
||||
// Default start mode
|
||||
%this.setMode(%this.mode);
|
||||
}
|
||||
|
||||
function Camera::setMode(%this,%mode,%arg1,%arg2,%arg3)
|
||||
{
|
||||
// Punt this one over to our datablock
|
||||
%this.getDatablock().setMode(%this,%mode,%arg1,%arg2,%arg3);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue