Prototyping.tscript 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. function Prototyping::onCreate(%this)
  2. {
  3. }
  4. function Prototyping::onDestroy(%this)
  5. {
  6. }
  7. //This is called when the server is initially set up by the game application
  8. function Prototyping::initServer(%this)
  9. {
  10. }
  11. //This is called when the server is created for an actual game/map to be played
  12. function Prototyping::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. %this.registerDatablock("./scripts/managedData/managedDatablocks");
  18. %this.registerDatablock("./scripts/managedData/managedForestItemData");
  19. %this.registerDatablock("./scripts/managedData/managedForestBrushData");
  20. %this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
  21. %this.registerDatablock("./scripts/managedData/managedParticleData");
  22. }
  23. //This is called when the server is shut down due to the game/map being exited
  24. function Prototyping::onDestroyGameServer(%this)
  25. {
  26. }
  27. //This is called when the client is initially set up by the game application
  28. function Prototyping::initClient(%this)
  29. {
  30. }
  31. //This is called when a client connects to a server
  32. function Prototyping::onCreateClientConnection(%this)
  33. {
  34. if (!isObject(screen_Canvas))
  35. {
  36. new GuiOffscreenCanvas(screen_Canvas) {
  37. targetName = "screen_Canvas";
  38. targetSize = "1280 720";
  39. dynamicTarget = false;
  40. canInteract = true;
  41. maxInteractDistance = "3";
  42. active = false;
  43. };
  44. }
  45. if(isObject(OptionsMenu))
  46. {
  47. screen_Canvas.setContent(OptionsMenu);
  48. }
  49. }
  50. //This is called when a client disconnects from a server
  51. function Prototyping::onDestroyClientConnection(%this)
  52. {
  53. }