Guest User

Battlezone lua

a guest
Dec 14th, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. Things that has to be fixed:
  2. taken from a forum topic: "Cleaning up documentation for Lua scripting"
  3. 1. matrix SetMatrix (A,B,C,
  4. D,E,F,
  5. G,H,I,
  6. J,K,M)
  7. does not produce the correct matrix
  8. this is what it returns:
  9. [D E F]
  10. [A B C]
  11. [G H I]
  12. [J K M]
  13. 2.
  14. number, vector GetTerrainHeightAndNormal(handle h)
  15. number, vector GetFloorHeightAndNormal(handle h)
  16. They do not work with handle
  17. current method to get it to work is:
  18. number, vector GetTerrainHeightAndNormal(GetPosition(h))
  19. number, vector GetFloorHeightAndNormal(GetPosition(h))
  20. 3.
  21. string.gsub does not work correctly:
  22. "When using GetOdf(handle) it will return a string with the length of 8,
  23. but most odf names are only 6 characters in length.
  24. So what I think is happening is that when a C string
  25. is converted to a lua string the null characters aren't cut off.
  26. There is no good way of fixing this issue other than using substring.
  27. I tried to use string.gsub, but it doesn't like the null character."
  28.  
  29. Example:
  30. myStr = "Test\0\0";
  31. myStr = myStr:gsub("\0","");
  32. print(myStr,myStr:len()); --This outputs: "Test 6"
  33. --So the null characters where not removed
  34. --2nd test
  35. myStr = "Test\0\0";
  36. myStr = myStr:gsub("\0","1");
  37. print(myStr,myStr:len()); --This outputs: "T1e1s1t1 8"
  38. Only way to fix:
  39. myStr = "Test\0\0";
  40. myStr = myStr:sub(1,4);
  41. 4.
  42. bool GetAIControl(team);
  43. Not implemented, returns nil;
  44.  
  45. Requsts:
  46. mostly taken from forum topic: "1.5.3 Lua Requests"
  47. url: http://www.battlezone1.org/1-5-3-lua-requests-t3934.html
  48. Note: didn't add every request to the list
  49. only added the requests that are currently
  50. imposible to do in lua and that isn't infeasible to implement.
  51. 1.
  52. A way to set the position of a given path:
  53. SetPosition(string path [,integer point])
  54. 2.
  55. A way to write add a "dynamic" objective:
  56. integer AddObjective(string text,bool fromFile);
  57. where the integer returned is some sort of objective id
  58. that can be usied with RemoveObjective(integer objectiveId);
  59. I.E:
  60. AddObjective("Number of rounds:" .. roundNumber,false);
  61. 3.
  62. A way to control the music track being played:
  63. AudioMusic(num track);
  64.  
  65. 4.
  66. A way to choose color that DisplayMessage will use:
  67. DisplayMessage(string message, string color)
  68. I.E:
  69. DisplayMessage("Hello","RED"/"GREEN"/"BLUE");
  70. or
  71. DisplayMessage(string message, integer color);
  72. I.E:
  73. local color = bit.lshift(red,8*2);
  74. color = bit.bor(color,bit.lshift(green,8));
  75. color = bit.bor(color,blue);
  76. DisplayMessage("Hello",color);
  77.  
  78. 5.
  79. Some for of IO(file, sockets) access, to make dynamic missions possible.
  80.  
  81. 6.
  82. Create and remove paths
  83. CreatePath("name",vector position);
  84. RemovePath("name");
  85.  
  86. 6.
  87. Modify terrain in real time
  88. height, texture, etc
  89.  
  90. 7.
  91. A way to toggle the powerstate of an object(kinda infeasible)
  92. togglePower(handle h,bool power)
  93.  
  94. 8.
  95. Extend GameKey so that it is possible to detect
  96. whether the key is beeing pressed/typed or released.
  97. GameKey(string key, bool mode);
  98.  
  99. 9.
  100. A way to get all paths on the map:
  101. iterator getAllPaths();
  102.  
  103. Other requests:
  104. Requests made by people that is possible to
  105. do with the current lua api:
  106. *bool IsPowered(handle h);
  107. *"Raycasting line of sight and firing solution checks"
  108. *"Radar ping revealing an area to the AI"
  109. *"Checking the pathing viability of a straight line vector a->b"
  110. *"Building foundation check"
  111. *"Slab map access if viable"
Advertisement
Add Comment
Please, Sign In to add comment