mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Implementation of Subscenes, SceneGroups and Gamemodes
Standardizes Gamemodes to be an actual class with data and utility functions that can be parsed Adds inspector field handling for selecting gamemodes Updated Scene class to work with Gamemodes for the gamemode field Updates editor suite elements to be able to create SubScenes, SceneGroups and Gamemodes Adds ability to convert SimGroup to SubScene Updates BaseUI's chooselevel menu to have gamemode selection and filters shown levels based on selected gamemode
This commit is contained in:
parent
0d07823ecd
commit
ae8eca48e1
36 changed files with 2963 additions and 173 deletions
|
|
@ -15,19 +15,6 @@ function ExampleModule::initServer(%this)
|
|||
//This is called when the server is created for an actual game/map to be played
|
||||
function ExampleModule::onCreateGameServer(%this)
|
||||
{
|
||||
//These are common managed data files. For any datablock-based stuff that gets generated by the editors
|
||||
//(that doesn't have a specific associated file, like data for a player class) will go into these.
|
||||
//So we'll register them now if they exist.
|
||||
if(isFile("./scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension))
|
||||
%this.registerDatablock("./scripts/managedData/managedDatablocks");
|
||||
if(isFile("./scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension))
|
||||
%this.registerDatablock("./scripts/managedData/managedForestItemData");
|
||||
if(isFile("./scripts/managedData/managedForestBrushData." @ $TorqueScriptFileExtension))
|
||||
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
|
||||
if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
|
||||
%this.registerDatablock("./scripts/managedData/managedParticleData");
|
||||
if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension))
|
||||
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
|
||||
}
|
||||
|
||||
//This is called when the server is shut down due to the game/map being exited
|
||||
|
|
@ -46,6 +33,8 @@ function ExampleModule::initClient(%this)
|
|||
%prefPath = getPrefpath();
|
||||
if(isScriptFile(%prefPath @ "/keybinds"))
|
||||
exec(%prefPath @ "/keybinds");
|
||||
|
||||
%this.queueExec("./scripts/server/ExampleGameMode");
|
||||
}
|
||||
|
||||
//This is called when a client connects to a server
|
||||
|
|
|
|||
|
|
@ -8,4 +8,5 @@
|
|||
ForestFile="@assetFile=ExampleLevel.forest"
|
||||
NavmeshFile="@assetFile=ExampleLevel.nav"
|
||||
staticObjectAssetDependency0="@asset=Prototyping:FloorGray"
|
||||
gameModesNames="ExampleGameMode;"
|
||||
VersionId="1"/>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
function ExampleGameMode::onCreateGame()
|
||||
{
|
||||
// Note: The Game object will be cleaned up by MissionCleanup. Therefore its lifetime is
|
||||
// limited to that of the mission.
|
||||
new ScriptObject(ExampleGameMode){};
|
||||
|
||||
return ExampleGameMode;
|
||||
}
|
||||
if(!isObject(ExampleGameMode))
|
||||
new GameMode(ExampleGameMode){};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The server has started up so do some game start up
|
||||
|
|
@ -159,6 +153,30 @@ function ExampleGameMode::onInitialControlSet(%this)
|
|||
|
||||
}
|
||||
|
||||
function ExampleGameMode::onSceneLoaded(%this)
|
||||
{
|
||||
echo("===================================");
|
||||
echo("ExampleGameMode - Scene is loaded");
|
||||
}
|
||||
|
||||
function ExampleGameMode::onSceneUnloaded(%this)
|
||||
{
|
||||
echo("===================================");
|
||||
echo("ExampleGameMode - Scene is unloaded");
|
||||
}
|
||||
|
||||
function ExampleGameMode::onSubsceneLoaded(%this)
|
||||
{
|
||||
echo("===================================");
|
||||
echo("ExampleGameMode - Subscene is loaded");
|
||||
}
|
||||
|
||||
function ExampleGameMode::onSubsceneUnloaded(%this)
|
||||
{
|
||||
echo("===================================");
|
||||
echo("ExampleGameMode - Subscene is unloaded");
|
||||
}
|
||||
|
||||
function ExampleGameMode::spawnCamera(%this, %client, %spawnPoint)
|
||||
{
|
||||
// Set the control object to the default camera
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue