Przeglądaj źródła

Reorganized the exec's for datablocks in module template file to be within 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

Areloch 1 rok temu
rodzic
commit
4bb26bf96c

+ 3 - 3
Templates/BaseGame/game/data/ExampleModule/ExampleModule.tscript

@@ -9,7 +9,7 @@ function ExampleModule::onDestroy(%this)
 //This is called when the server is initially set up by the game application
 //This is called when the server is initially set up by the game application
 function ExampleModule::initServer(%this)
 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
 //This is called when the server is created for an actual game/map to be played
@@ -25,7 +25,7 @@ function ExampleModule::onDestroyGameServer(%this)
 //This is called when the client is initially set up by the game application
 //This is called when the client is initially set up by the game application
 function ExampleModule::initClient(%this)
 function ExampleModule::initClient(%this)
 {
 {
-    %this.queueExec("./scripts/client/inputCommands");
+   %this.queueExec("./scripts/client/inputCommands");
     
     
     //client scripts
     //client scripts
    exec("./scripts/client/defaultkeybinds");
    exec("./scripts/client/defaultkeybinds");
@@ -34,7 +34,7 @@ function ExampleModule::initClient(%this)
    if(isScriptFile(%prefPath @ "/keybinds"))
    if(isScriptFile(%prefPath @ "/keybinds"))
       exec(%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
 //This is called when a client connects to a server

+ 0 - 0
Templates/BaseGame/game/data/ExampleModule/scripts/server/ExampleGameMode.tscript → Templates/BaseGame/game/data/ExampleModule/scripts/shared/ExampleGameMode.tscript


+ 1 - 2
Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.tscript.template

@@ -16,6 +16,7 @@ function @@::initServer(%this)
 //This is called when the server is created for an actual game/map to be played
 //This is called when the server is created for an actual game/map to be played
 function @@::onCreateGameServer(%this)
 function @@::onCreateGameServer(%this)
 {
 {
+    //--DATABLOCK EXEC BEGIN--
     //These are common managed data files. For any datablock-based stuff that gets generated by the editors
     //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.
     //(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.
     //So we'll register them now if they exist.
@@ -24,8 +25,6 @@ function @@::onCreateGameServer(%this)
     %this.registerDatablock("./scripts/managedData/managedForestBrushData");
     %this.registerDatablock("./scripts/managedData/managedForestBrushData");
     %this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
     %this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
     %this.registerDatablock("./scripts/managedData/managedParticleData");
     %this.registerDatablock("./scripts/managedData/managedParticleData");
-
-    //--DATABLOCK EXEC BEGIN--
     //--DATABLOCK EXEC END--
     //--DATABLOCK EXEC END--
 }
 }