mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
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
50 lines
1.2 KiB
Plaintext
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)
|
|
{
|
|
}
|