Skip to content

Commit

Permalink
Reorganized the exec's for datablocks in module template file to be w…
Browse files Browse the repository at this point in the history
…ithin the start/stop blocks

Tweaked example module script file to comply
Moved ExampleGameMode script file to scripts/shared since client and server need access to the gamemode for logic to work
  • Loading branch information
Areloch committed Sep 2, 2024
1 parent d7335a7 commit 4bb26bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function ExampleModule::onDestroy(%this)
//This is called when the server is initially set up by the game application
function ExampleModule::initServer(%this)
{
%this.queueExec("./scripts/server/ExampleGameMode");
%this.queueExec("./scripts/shared/ExampleGameMode");
}

//This is called when the server is created for an actual game/map to be played
Expand All @@ -25,7 +25,7 @@ function ExampleModule::onDestroyGameServer(%this)
//This is called when the client is initially set up by the game application
function ExampleModule::initClient(%this)
{
%this.queueExec("./scripts/client/inputCommands");
%this.queueExec("./scripts/client/inputCommands");

//client scripts
exec("./scripts/client/defaultkeybinds");
Expand All @@ -34,7 +34,7 @@ function ExampleModule::initClient(%this)
if(isScriptFile(%prefPath @ "/keybinds"))
exec(%prefPath @ "/keybinds");

%this.queueExec("./scripts/server/ExampleGameMode");
%this.queueExec("./scripts/shared/ExampleGameMode");
}

//This is called when a client connects to a server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function @@::initServer(%this)
//This is called when the server is created for an actual game/map to be played
function @@::onCreateGameServer(%this)
{
//--DATABLOCK EXEC BEGIN--
//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.
Expand All @@ -24,8 +25,6 @@ function @@::onCreateGameServer(%this)
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
%this.registerDatablock("./scripts/managedData/managedParticleData");

//--DATABLOCK EXEC BEGIN--
//--DATABLOCK EXEC END--
}

Expand Down

0 comments on commit 4bb26bf

Please sign in to comment.