Lorfa

angle_replace

Jun 20th, 2015
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. block {
  2. camera 26.7187500 299.531250 0.000000000;
  3. time 4:18.48760986m;
  4. setangle 30.9375000 -52.0312500 0.000000000;
  5. clientdata {
  6. uk_bit_b10;
  7. info1 0;
  8. info2 998;
  9. info3 1;
  10. info4 0;
  11. info5 0;
  12. info6 0;
  13. info7 0;
  14. info8 9;
  15. }
  16. updateentity {
  17. entity 1;
  18. frame 13;
  19. origin_x 1689.00000;
  20. origin_y -828.000000;
  21. origin_z 172.000000;
  22. angles_1 30.9375000;
  23. angles_2 -52.0312500;
  24. }
  25. updateentity {
  26. entity 2;
  27. frame 16;
  28. origin_x 1368.75000;
  29. origin_y -1015.75000;
  30. origin_z 344.000000;
  31. angles_1 -5.62500000;
  32. }
  33. updateentity {
  34. entity 3;
  35. frame 7;
  36. origin_x 1842.12500;
  37. origin_y -1009.87500;
  38. origin_z 20.0000000;
  39. angles_1 11.2500000;
  40. angles_2 -180.000000;
  41. angles_3 7.03125000;
  42. }
  43. updateentity {
  44. entity 14;
  45. }
  46. updateentity {
  47. entity 15;
  48. }
  49. updateentity {
  50. entity 16;
  51. }
  52. updateentity {
  53. entity 17;
  54. }
  55. updateentity {
  56. entity 18;
  57. }
  58. updateentity {
  59. entity 21;
  60. }
  61. updateentity {
  62. entity 22;
  63. }
  64. updateentity {
  65. entity 23;
  66. }
  67. updateentity {
  68. entity 25;
  69. origin_x -39.5000000;
  70. }
  71. updateentity {
  72. entity 43;
  73. }
  74. updateentity {
  75. entity 66;
  76. origin_x 17.8750000;
  77. }
  78. updateentity {
  79. entity 78;
  80. origin_z 8.00000000;
  81. }
  82. updateentity {
  83. entity 79;
  84. origin_z 8.00000000;
  85. }
  86. updateentity {
  87. entity 80;
  88. origin_x -17.8750000;
  89. }
  90. updateentity {
  91. entity 87;
  92. }
  93. updateentity {
  94. entity 88;
  95. }
  96. updateentity {
  97. entity 90;
  98. }
  99. updateentity {
  100. entity 91;
  101. }
  102. }
  103.  
  104. // Firstly the 'setangle' line can be stripped out.
  105.  
  106. // I need angles_1 angles_2 and angles_3 (if they exist) from entity 3 copied to camera A B C where ABC are the three numbers
  107. // after 'camera'.
  108. //
  109. // If an angle is missing from entity 3, then it should have a 0.000000000 printed.
  110. // If there is no update from entity 3 (plenty of times there isn't) then ABC should all be 0.000000000
  111. //
  112. //
  113. // This is one block of nearly 30000 in a text file, so automation is definitely required,
  114. // that is if I want to be done before Halley's comet returns.
  115.  
  116. // Ideas
  117. // Read file into database software.
  118.  
  119. // get each line, if camera line remember line number
  120. // if 'entity 3'
  121.  
  122. // bring into msvc, define structs, write program that reads blocks into structs, test for entity 3, replace camera's angles.
  123.  
  124. // How about two programs, one scans for entity 3's angle_123 numbers and sticks them into a text file.
  125. // Second program reads from a text file, locates camera and replaces the numbers accordingly.
  126. // A few dummy angle_123 numbers can be used to cover the first few entries of camera that aren't updating entity
  127.  
  128.  
  129.  
  130.  
  131.  
  132. // Main program:
  133. // Open a text file for reading, I can use a hard-coded name.
  134. // Create and open a different text file for writing, I can also use a hard-coded name.
  135. // Establish string variables a1, a2, and a3, set them to 0.000000000
  136.  
  137. // Main routine: Scan read file for ' entity 3;' (with the spaces) on a line and if this is found:
  138. // Enter a subroutine that continues scanning, but for ' angles_1', ' angles_2', and ' angles_3'
  139. // Also scan for '}'
  140.  
  141. // if angles_1 is found, read the number after the space, and omit the semicolon it terminates with.
  142. // For example: angles_1 -2.81250000;
  143. // Read in -2.81250000 (exactly as it is written) to variable 'a1'
  144.  
  145. // Keep reading and if angles_2 is found, read in its value to variable called 'a2'
  146. // Keep reading and if angles_3 is found, read in its value to variable called 'a3'
  147.  
  148. // The angles in the read file will always be in consecutive order.
  149.  
  150. // If a '}' is read then stop reading and:
  151. // print the value of angles_1, angles_2, and angles_3 in order separated by a space on a line in the
  152. // write file.
  153. // For example:
  154. // 351.562500 104.062500 -7.03125000
  155.  
  156. // Then reset the values of a1, a2, and a3 to 0.000000000
  157.  
  158. // Then go to next line in the write file to be ready to print a second set of values if needed.
  159.  
  160. // Now the subroutine can be exited and returned to the main routine of searching for ' entity 3;'
  161.  
  162. // Upon end of file, close read file, save write file and exit program.
Advertisement
Add Comment
Please, Sign In to add comment