module.tscript.template 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/managedParticleEmitterData." @ $TorqueScriptFileExtension))
  22. %this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
  23. if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
  24. %this.registerDatablock("./scripts/managedData/managedParticleData");
  25. }
  26. //This is called when the server is shut down due to the game/map being exited
  27. function @@::onDestroyGameServer(%this)
  28. {
  29. }
  30. //This is called when the client is initially set up by the game application
  31. function @@::initClient(%this)
  32. {
  33. }
  34. //This is called when a client connects to a server
  35. function @@::onCreateClientConnection(%this)
  36. {
  37. }
  38. //This is called when a client disconnects from a server
  39. function @@::onDestroyClientConnection(%this)
  40. {
  41. }