Custom Championship tool (SP & MP races) (creates HTML reports)

Discussion in 'Community Workshop' started by pixeljetstream, Jan 29, 2015.

  1. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +160 / 0
    Thanks anyway.
    I replaced all the assets.txt files in the different versions i have from your program and copy the part again from the Nordschleife circuits.
    And voila, the pictograms are in the results.
    Thanks again for your time and clear explanation
    :)
     
    • Love it! Love it! x 1
  2. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +160 / 0
    Hi there (again)
    For the next season we want to hold competitions of 6 races.
    After these 6 races the 2 worst races will be deleted.
    Is it possibility to build something in your tool to change that with have no influence on the results for someone else.
    For example:
    Your worst result was an 8th place in an race where i was finished 9th
    When i delete your result I will be 8th and that shouldn't happens.(i should stay in 9th)
    Don't problem if you can't help but if i don't asked I'm sure you can't
    BTW where is your donation button?
     
  3. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +367 / 0
    donate to some charity if you want to :)

    one manual way is to flag the entries in the database file by adding a new field

    Code:
    original line
    { RaceTime="0:33:50.004", Laps="10", Driver="Jos Snijder", Team="Brun Motorsport", BestLap="1:35.653", Vehicle="BMW 635 CSI", Penalty="0", LapDistanceTravelled="42.152931",   },
    
    lets say add "DontCount" field
    { RaceTime="0:33:50.004", Laps="10", Driver="Jos Snijder", Team="Brun Motorsport", BestLap="1:35.653", Vehicle="BMW 635 CSI", Penalty="0", LapDistanceTravelled="42.152931",  DontCount=true, },
    


    in the code that is on github modify the point distribution

    Code:
       
    for i=1,numdrivers do
          results[i] = race.slots[sorted[i]]
          results[i].Player = sorted[i] == 1
        
          if (times[i] and results[i].Position and tonumber(results[i].Position) ~= i) then
            printlog("warning position mismatch "..results[i].Driver.." should: "..results[i].Position.." has: "..i)
          end
    
         -- this here is new, valid times means someone participated in the race at all
         -- set zero entries with valid times but flagged
         if (times[i] and results[i].DontCount) then
           points[i] = 0
         end
        
          if (not points[i]) then
            -- only set non nil if had a valid time
            points[i] = times[i] and 0
          end
        end
    
     
    Last edited: Nov 6, 2016
  4. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +160 / 0
    Thanks for your reply but it works not 100%
    I show you in results whats going wrong.
    When I put Don't count = True behind jonathan its working
    description = [[]],

    { trackname = nil, tracklength = "4134.2123", scene="Grand Prix", timestring="2016/11/04 21:32:22", ruleset="default", slots = {
    { RaceTime="0:15:29.741", Laps="7", Driver="Jonathan Schelstraete", Team="KW Automotive", BestLap="2:06.858", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="1723.045410", DontCount=true,},
    { RaceTime="0:15:56.932", Laps="7", Driver="Georges Deurwaerder", Team="ST Suspensions Racing", BestLap="2:08.209", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="844.148438", },
    { RaceTime="0:15:34.725", Laps="7", Driver="Jos Snijder", Team="Orange Racing", BestLap="2:07.525", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="1528.795410", },
    },},

    When i put it by Georges Deurwaerder, Jos Snijder is getting an - in his result (that's not correct i think)
    description = [[]],

    { trackname = nil, tracklength = "4134.2123", scene="Grand Prix", timestring="2016/11/04 21:32:22", ruleset="default", slots = {
    { RaceTime="0:15:29.741", Laps="7", Driver="Jonathan Schelstraete", Team="KW Automotive", BestLap="2:06.858", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="1723.045410", },
    { RaceTime="0:15:56.932", Laps="7", Driver="Georges Deurwaerder", Team="ST Suspensions Racing", BestLap="2:08.209", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="844.148438", DontCount=true, },
    { RaceTime="0:15:34.725", Laps="7", Driver="Jos Snijder", Team="Orange Racing", BestLap="2:07.525", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="1528.795410", },
    },},

    And al last, when i put don't count=true in the line from Jos Snijder, Georges Deurwaerder get an - in his result

    description = [[]],

    { trackname = nil, tracklength = "4134.2123", scene="Grand Prix", timestring="2016/11/04 21:32:22", ruleset="default", slots = {
    { RaceTime="0:15:29.741", Laps="7", Driver="Jonathan Schelstraete", Team="KW Automotive", BestLap="2:06.858", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="1723.045410", },
    { RaceTime="0:15:56.932", Laps="7", Driver="Georges Deurwaerder", Team="ST Suspensions Racing", BestLap="2:08.209", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="844.148438", },
    { RaceTime="0:15:34.725", Laps="7", Driver="Jos Snijder", Team="Orange Racing", BestLap="2:07.525", Vehicle="Tatuus F4", Penalty="0", LapDistanceTravelled="1528.795410",DontCount=true, },
    },},

    Sorry for the long text but i hope that you can explain it what's going wrong.

    One thing i tried and worked well is the line from Jos Snijder cut and past in the second row (as the results of the race) and it works.
    But the LUA file wich is there after to run your tool is setting these lines, so maybe there must something changed.
    I hope that you understand a little what i try to explain because my english is not that fine.
    Greetings, Jos.



    EDIT: For so far i can see is the Don't Count=true rule working in the line you put it.
    (Than i don't look at the names)
    But the LUA file is not putting the results in the correct line When i look at the names in combination with the results.
    As above the results of the race is
    1.Jonathan Schelstraete
    2.Jos Snijder
    3.Georges Deurwaerder

    The text in the LUA file show first Jonathan Schelstraete, than Georges Deurwaerder and at last Jos Snijder
     
    Last edited: Nov 6, 2016
  5. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +160 / 0
    Hey Christoph, I find out that the biggest problem is that the slots after an race is not comform the results from the race.
    The winner get not always slot 000
    And when someone is leaving the game there will be a slot missing.
    The way i handel now and can live with it is that i correct thet slots after the race in the raceresults.txt before i run the things i want.
    No big deal to do.
    Thanks anyway for the DontCount item
     
  6. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +367 / 0
    there already exists code that is supposed to solve the slot issue (and seems to work for most test data I had)
    Code:
      -- check if we have unique names, then operate based on
      -- names and not slotindices
      local uniquedrivers = true
    ...
    
    probably some other thing I didnt think of with the dontcount, I didnt really tried it. Ideally you learn a little lua and play around yourself :)

    just throw in print function calls ;)
     
    • Like Like x 1
  7. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +160 / 0
    I missed every lay-out of Paul-Ricard in the system
    The info i can give from the solution1-A is:
    Scene=Solution 1A
    AIDB=Solution 1A.AIW
    Track Length=5787.7305
     
  8. Stonehard

    Stonehard New Member

    Joined:
    Jul 3, 2015
    Ratings:
    +2 / 0
    Looking great - have not sucseeded to get it work...
    - No install files?

    PS: I am hosting races from own server.
    Q: Should this program be placed at the SERVER or at my locally placed Spectator Gamer?

    Tnx
     
  9. Squanchy

    Squanchy Well-Known Member

    Joined:
    Nov 21, 2016
    Ratings:
    +66 / 0
    It doesn't work for me either. When I press "rebuild html stats" it just says "rebuilding all stats" and that's that. Nothing is generated in the results folder except the style file. thanks.
     
    • Agree Agree x 1
  10. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +367 / 0
    do you run a server? Then you need to use commandline to pass result files etc.
     
  11. Squanchy

    Squanchy Well-Known Member

    Joined:
    Nov 21, 2016
    Ratings:
    +66 / 0
    I just re-read the instructions and figured out the problem. I was not running it while Raceroom is running. If Raceroom is open in the background then it works. Thank you for this very nice app!
     
  12. Stonehard

    Stonehard New Member

    Joined:
    Jul 3, 2015
    Ratings:
    +2 / 0
    Interesting. BUT do you run this program from the Raceroom Server - or from you Raceroom Gamer??
    - I would like it to work on my server. Hosting 2 servers... RR Norway and Prosim.no
    Please let me hear more, tnx
     
  13. Squanchy

    Squanchy Well-Known Member

    Joined:
    Nov 21, 2016
    Ratings:
    +66 / 0
    Sorry, I only wanted it for single player, cause the adaptive AI gives me trouble. Don't really know more.
     
  14. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +367 / 0
    @Stonehard both options work. The server should be generating results as json or XML files somehow. Those you can pass to the tool via commandline to generate reports etc.
     
  15. Stonehard

    Stonehard New Member

    Joined:
    Jul 3, 2015
    Ratings:
    +2 / 0
    OK then. i will give it a try again.
    - But for a championship with a race a week, i guess we should stop that server until next race etc to get results for the complete championshiop? I can do that..
     
  16. Stonehard

    Stonehard New Member

    Joined:
    Jul 3, 2015
    Ratings:
    +2 / 0
    Ugh, i may have tried to run the program after the races, putted all those JSON files in a folder to show the results.
    Maybee that don't work then.

    - So the program have to be running on the server when the races are done to get the data?
    Not possible just to import the JSON files in a folder later...?

    - I guess when i am running the R3E Spectator, this program could actually work from my Gamer/Spectator too?
    Or will my name show up (i'm just commenting race and steering camera's then)

    Sorr, but i never understood how to use this program. And it is a big loss there has not been such a possibility to show raceresults for R3E the sim when hosting races. Showing the results is now a minimum requirement we do have to host more races.
     
  17. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +367 / 0
    No, it doesn't need to be running for the server case. You use the commandline (windows console) to pass the json files using the commands described on the website. Basically in this mode you don't use the UI at all.
     
  18. Stonehard

    Stonehard New Member

    Joined:
    Jul 3, 2015
    Ratings:
    +2 / 0
    ???
    - So i can copy some JSON files from the server and make an HTML structure then..`?
    Tried that, couldn't get it to work.

    - And as asked above, can it be used from my Gamer, running as Spectator?
    And will my name (commentor only) also be showen then..?

    A small program like this should not been soo hard to run? Maybe it should be on it's place to make an video instruction then...
    - Running from server
    - Running from Spectator computer..

    I have been reading the Help file....
     
  19. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +367 / 0
    I don't know if spectator would work. No idea if R3E creates a race results file in that case.

    As for passing json/XML other folks here seem to have gotten it to work. What exactly did you type in the commandline?
    Were there any error messages shown etc.
     
  20. Stonehard

    Stonehard New Member

    Joined:
    Jul 3, 2015
    Ratings:
    +2 / 0
    Can't you make this great piece of software a little bit help to be used from us enthusiasts?
    - Does it have to be difficoult for just some few to use it?

    Make a Video is my suggestion.
    Alternatively a better instruction.

    We are not all programmers .....