Torque3D/Templates/BaseGame/game/data/ExampleModule/ExampleModule.tscript
Areloch 4bb26bf96c 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
2024-09-01 23:26:10 -05:00

50 lines
1.2 KiB
Plaintext

function ExampleModule::onCreate(%this)
{
}
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/shared/ExampleGameMode");
}
//This is called when the server is created for an actual game/map to be played
function ExampleModule::onCreateGameServer(%this)
{
}
//This is called when the server is shut down due to the game/map being exited
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");
//client scripts
exec("./scripts/client/defaultkeybinds");
%prefPath = getPrefpath();
if(isScriptFile(%prefPath @ "/keybinds"))
exec(%prefPath @ "/keybinds");
%this.queueExec("./scripts/shared/ExampleGameMode");
}
//This is called when a client connects to a server
function ExampleModule::onCreateClientConnection(%this)
{
ExampleMovemap.push();
}
//This is called when a client disconnects from a server
function ExampleModule::onDestroyClientConnection(%this)
{
}