module.tscript.template 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. function @@::onCreate(%this)
  2. {
  3. }
  4. function @@::onDestroy(%this)
  5. {
  6. }
  7. //This is called when the server is initially set up by the game application
  8. function @@::initServer(%this)
  9. {
  10. }
  11. //This is called when the server is created for an actual game/map to be played
  12. function @@::onCreateGameServer(%this)
  13. {
  14. //These are common managed data files. For any datablock-based stuff that gets generated by the editors
  15. //(that doesn't have a specific associated file, like data for a player class) will go into these.
  16. //So we'll register them now if they exist.
  17. if(isFile("./scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension))
  18. %this.registerDatablock("./scripts/managedData/managedDatablocks");
  19. if(isFile("./scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension))
  20. %this.registerDatablock("./scripts/managedData/managedForestItemData");
  21. if(isFile("./scripts/managedData/managedForestBrushData." @ $TorqueScriptFileExtension))
  22. %this.registerDatablock("./scripts/managedData/managedForestBrushData");
  23. if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension))
  24. %this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
  25. if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
  26. %this.registerDatablock("./scripts/managedData/managedParticleData");
  27. }
  28. //This is called when the server is shut down due to the game/map being exited
  29. function @@::onDestroyGameServer(%this)
  30. {
  31. }
  32. //This is called when the client is initially set up by the game application
  33. function @@::initClient(%this)
  34. {
  35. }
  36. //This is called when a client connects to a server
  37. function @@::onCreateClientConnection(%this)
  38. {
  39. }
  40. //This is called when a client disconnects from a server
  41. function @@::onDestroyClientConnection(%this)
  42. {
  43. }