Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. // Frame object testing
  2. /*function PrintFrameTime(frametime)
  3. {
  4. print(frametime);
  5. }
  6.  
  7. frame.Updated.connect(PrintFrameTime);
  8.  
  9. ///@todo Test delayed signal stuff.
  10.  
  11. */
  12.  
  13. // Entity Action testing
  14. /*
  15. function PrintMove(direction)
  16. {
  17. print("Move " + direction);
  18. }
  19.  
  20.  
  21. print("js jauuuuu");
  22.  
  23. me.Action("Move").Triggered.connect(PrintMove);
  24. for (var i = 0; i < 5; ++i)
  25. {
  26. me.Exec("Move", "Forward");
  27. }
  28. */
  29. // Console testing
  30. /*
  31. function CommandTest(params)
  32. {
  33. print("CommandTest" + params);
  34. print(params.length());
  35. for (var i = 0; i < params.length(); ++i)
  36. {
  37. print("param[" + i + "]" + params[i]);
  38. }
  39. }
  40.  
  41. console.Print("Fuuuuuuu");
  42. console.ExecuteCommand("test(123, 456, 789");
  43. console.RegisterCommand("jstestcmd", "Testing console command stuff from js").Invoked.connect(CommandTest);
  44. */
  45.  
  46. // EC_Sound & EC_SoundListener testing
  47.  
  48. /*
  49. function OnComponentAdded(entity, component, type)
  50. {
  51. if (component.TypeName == "EC_Sound")
  52. {
  53. print("EC_Sound added:");
  54. print(component.soundId);
  55. print(component.soundInnerRadius);
  56. print(component.soundOuterRadius);
  57. print(component.soundGain);
  58. print(component.loopSound);
  59. print(component.triggerSound);
  60. }
  61.  
  62. if (component.TypeName == "EC_SoundListener")
  63. {
  64. print("EC_SoundListener added:");
  65. print(component.active);
  66. }
  67. }
  68.  
  69. function OnEntityCreated(entity, change)
  70. {
  71. print("Entity created");
  72. }
  73.  
  74. function OnInputMapAction()
  75. {
  76. me.Exec("PlaySound");
  77. }
  78.  
  79. scene.ComponentAdded.connect(OnComponentAdded);
  80. scene.EntityCreated.connect(OnEntityCreated);
  81. me.Action("Move").Triggered.connect(OnInputMapAction);
  82. */
  83.  
  84. print("testing123");
  85. var execType = 1;
  86. function ExecTest()
  87. {
  88. print("Executing \"test\" " + execType);
  89. me.Exec("Test", execType);
  90. if (execType == 1)
  91. execType = 2;
  92. else if (execType == 2)
  93. execType = 4;
  94. else if (execType == 4)
  95. execType = 1;
  96.  
  97. // frame.DelayedExecute(1.0).Triggered.connect(delayedExec);
  98. }
  99.  
  100. //frame.DelayedExecute(1.0).Triggered.connect(delayedExec);
  101. me.Action("Move").Triggered.connect(ExecTest);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement