SimplePostscript ps; int stopme = 0; int count2 = 0; int starthere = 0; int endhere = 0; int dont = 6; int dont2 = 5; int i = 0; String intarr []; String[] matchstart = { "ScriptLog: START MATCH","Log: appRequestExit(0)", "=" , "ScriptLog:" , "died"}; //when to start reading and when to stop int counter = 0; int arrlen =0; int arrnum = 0; int addME = 0; String format; float thelist[]; float setthegrey = 0.9;//starts circles white int arrlen1 = 0; //arrlen +1 int setthered = 0; int setthegreen = 0; int settheblue =0; ///////////////////////////////////////////////////////////////////////////////////// void setup() { size(625,625); background(252,255,255); //stroke(0,0,0); noStroke(); } ////////////////////////////////////////////////////////////////////////////////////// void loop() { if(dont2==5) { // read the text file know where it ends background(100,0,0); //rgb or hue sat brigt ps ps=SimplePostscript.open("test3.ps",0,0, 625,625); //start a file at 0x, 0y, make it stop at 625 x and 625y ps intarr = loadStrings("C:/Games/UT2004/System/UT2004.log"); //will read from correct place dont2=dont2+1; //this read will only happen the first time round. (in new processing noloop function at the bottom //endhere = intarr.length-1; // need to minus 1 or errors will abound cuz of writing (therefore last value isnt always more than 3 } //////////////////////////////////////////////////////////////////////////////////////// while(dont == 6) {// in other versions this bit dosnt include the search for the end. this does as its not a constant read thing if(intarr[i].equals(matchstart[0]) == true) { //check for when to begin println("we hit start match at"); println(i); starthere = i+1; //this is where the first x value is situated println(intarr[starthere]); i=i+1; } else { i=i+1; } //end start check if(intarr[i].equals(matchstart[1]) == true) { //check for when to stop println("we hit the end of the match at"); println(i); endhere = i-1; //this is where the final z value is situated println (intarr[endhere]); counter = starthere; //endhere = endhere-150;//cuz it loves to fuckup //endhere = endhere+1;// (fixing an array problem further down where counter < endhere) arrlen = endhere-starthere; dont=dont+1; arrlen1 = arrlen+1; } }//endwhile ////////////////////////////////////////////////////////////////////////////////////////// if (dont ==7){ //the split strings and flost change between processing versions. String justnumstrings [] = new String[arrlen]; println(justnumstrings.length); dont=dont+1; // so this will only repeat when needed /*stopme = justnumstrings.length /3; stopme = (stopme - 50); //divisible by 3 stopme = stopme *3; //println(stopme); //stop me without big black circle!!!// needs to be divisible by 3 */ while (counter < endhere){ // start while String temp [] = splitStrings (intarr[counter]); //println (temp[2]); if ((temp[0].equals(matchstart[3]) == true) && (temp[2].equals(matchstart[2]) == true)) { //stops log: warning: and error: pissing up the script if (temp[1].equals(matchstart[4]) == true){ //in here another if so if 2nd value = died then put a 0 there in not dothe other thing justnumstrings[arrnum] = "0"; arrnum=arrnum+1; counter=counter+1; } else { justnumstrings[arrnum] = temp[3]; // arrnum is 0 first time round arrnum = arrnum+1; counter= counter+1; } } else { counter= counter+1; } } // end while String format = join(justnumstrings, " "); thelist = splitFloats (format); //arrlan = 2042 (endhere-start here println (arrlen); //println(stopme); } ////////////////////////////////////////////////////////////////////////////////////// //in big draw loop // if the list = 0 change my colour, if not read the next 3 values (death always occurs after a full xyz if (thelist[count2] == 0){ // makes a browny red colour setthered = setthered+2; setthegreen = setthered/2; settheblue = setthered/2; count2 = count2+1; if (setthered>255){ setthered=2; setthegreen = 1; settheblue = 1; } }else{ float temp1 = thelist[count2]; float temp2 = thelist[count2+1]; float temp3 = thelist[count2+2]; temp1 = temp1+10000; temp2 = temp2+10000; temp3 = temp3+10000; temp1 = temp1/32; temp2 = temp2/32; temp3 = temp3/32; //fill (50, 50); //fill(gray, alpha) almost always 1 (but can be 85) //ellipse(temp1, temp2, 4, 4);// (x,y,width,height) // count goes up to 12191 so make it only go to 100... 0.008 in 100 so... 125 counts in 1 colour gray change //UNIQUE TO EACH GAME WORK IT OUT!! // Grayscale colors are float values in the 0..1 range ps.setrgb(setthered,setthegreen,settheblue); //ps.setrgb(255,200,0); //ps.moveto(0,0); ps.circle(temp1,temp2,temp3); ps.fill(); ps.setgray(1f); //1 little white circles //0 black ps.circle (temp1,temp2,1); ps.fill(); //println("loop me"); /* // count goes up to 12191 so make it only go to 100... 0.008 in 100 so... 125 counts in 1 colour gray change ps.moveto(0,0); ps.lineto(300,300); ps.stroke(); // RGB colors are integers in the 0..255 range ps.setrgb(255,200,0); ps.circle(0,50, 30); ps.fill(); // CMYK colors are float values in the 0..1 range ps.setcmyk(1,0,0,0); ps.setfont("Arial",12); ps.text(0,100, "Testing text"); ps.fill(); ps.setcmyk(0,1,1,0); ps.setlinewidth(3); ps.moveto(0,200); ps.curveto(50,100, 100,100, 150,200); ps.curveto(200,300, 200,50, 300,0); ps.stroke(); */ count2=count2+3; addME=addME+3; } if (addME>=(arrlen/10)){ //divide arrlen by 10 NOT //1354 //setthegrey = setthegrey-0.1;//- or + did change colour but not anymore println("IM HERE"); // keeping it so we know how long to the end of the file addME=0; } //println (arrlen); //println(count2); if (count2 >= (arrlen1-6)){ //arrlen (+1) -6 println ("i reached here already"); //noLoop(); stop(); ps.close(); } // Close file when done. If not closed, file output may not // be complete. }