Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- block {
- camera 26.7187500 299.531250 0.000000000;
- time 4:18.48760986m;
- setangle 30.9375000 -52.0312500 0.000000000;
- clientdata {
- uk_bit_b10;
- info1 0;
- info2 998;
- info3 1;
- info4 0;
- info5 0;
- info6 0;
- info7 0;
- info8 9;
- }
- updateentity {
- entity 1;
- frame 13;
- origin_x 1689.00000;
- origin_y -828.000000;
- origin_z 172.000000;
- angles_1 30.9375000;
- angles_2 -52.0312500;
- }
- updateentity {
- entity 2;
- frame 16;
- origin_x 1368.75000;
- origin_y -1015.75000;
- origin_z 344.000000;
- angles_1 -5.62500000;
- }
- updateentity {
- entity 3;
- frame 7;
- origin_x 1842.12500;
- origin_y -1009.87500;
- origin_z 20.0000000;
- angles_1 11.2500000;
- angles_2 -180.000000;
- angles_3 7.03125000;
- }
- updateentity {
- entity 14;
- }
- updateentity {
- entity 15;
- }
- updateentity {
- entity 16;
- }
- updateentity {
- entity 17;
- }
- updateentity {
- entity 18;
- }
- updateentity {
- entity 21;
- }
- updateentity {
- entity 22;
- }
- updateentity {
- entity 23;
- }
- updateentity {
- entity 25;
- origin_x -39.5000000;
- }
- updateentity {
- entity 43;
- }
- updateentity {
- entity 66;
- origin_x 17.8750000;
- }
- updateentity {
- entity 78;
- origin_z 8.00000000;
- }
- updateentity {
- entity 79;
- origin_z 8.00000000;
- }
- updateentity {
- entity 80;
- origin_x -17.8750000;
- }
- updateentity {
- entity 87;
- }
- updateentity {
- entity 88;
- }
- updateentity {
- entity 90;
- }
- updateentity {
- entity 91;
- }
- }
- // Firstly the 'setangle' line can be stripped out.
- // 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
- // after 'camera'.
- //
- // If an angle is missing from entity 3, then it should have a 0.000000000 printed.
- // If there is no update from entity 3 (plenty of times there isn't) then ABC should all be 0.000000000
- //
- //
- // This is one block of nearly 30000 in a text file, so automation is definitely required,
- // that is if I want to be done before Halley's comet returns.
- // Ideas
- // Read file into database software.
- // get each line, if camera line remember line number
- // if 'entity 3'
- // bring into msvc, define structs, write program that reads blocks into structs, test for entity 3, replace camera's angles.
- // How about two programs, one scans for entity 3's angle_123 numbers and sticks them into a text file.
- // Second program reads from a text file, locates camera and replaces the numbers accordingly.
- // A few dummy angle_123 numbers can be used to cover the first few entries of camera that aren't updating entity
- // Main program:
- // Open a text file for reading, I can use a hard-coded name.
- // Create and open a different text file for writing, I can also use a hard-coded name.
- // Establish string variables a1, a2, and a3, set them to 0.000000000
- // Main routine: Scan read file for ' entity 3;' (with the spaces) on a line and if this is found:
- // Enter a subroutine that continues scanning, but for ' angles_1', ' angles_2', and ' angles_3'
- // Also scan for '}'
- // if angles_1 is found, read the number after the space, and omit the semicolon it terminates with.
- // For example: angles_1 -2.81250000;
- // Read in -2.81250000 (exactly as it is written) to variable 'a1'
- // Keep reading and if angles_2 is found, read in its value to variable called 'a2'
- // Keep reading and if angles_3 is found, read in its value to variable called 'a3'
- // The angles in the read file will always be in consecutive order.
- // If a '}' is read then stop reading and:
- // print the value of angles_1, angles_2, and angles_3 in order separated by a space on a line in the
- // write file.
- // For example:
- // 351.562500 104.062500 -7.03125000
- // Then reset the values of a1, a2, and a3 to 0.000000000
- // Then go to next line in the write file to be ready to print a second set of values if needed.
- // Now the subroutine can be exited and returned to the main routine of searching for ' entity 3;'
- // Upon end of file, close read file, save write file and exit program.
Advertisement
Add Comment
Please, Sign In to add comment