Upcoming Events

Rookie friendly WTCR sereis Weekly BMW races on Simracing.GP Weekly BMW races on Simracing.GP Other regular AC events on Simracing.GP Weekly GT3 Sprint Races on Simracing.GP Weekly GT4 Sprint Races on Simracing.GP
Track Map Display

Apps Track Map Display 1.16

Log in to download, or make sure to confirm your account via email

NightEye87

Premium
Messages
790
Points
0
EDIT:
Also, would it be possible to fetch the camera position and draw that on the map (either via button to toggle it or whenever the camera mode is F7)?
Camera position can be fetched as is done in AccExtHelper.py.
I don't understand a thing of Classes in Python, or I would have tried to implement it myself, but yeah.. :p

For anyone that wants this, insert this at the bottom of "def render_cars(self):":

Code:
            #Camera Position
            camx,camy,camz = ac.ext_getCameraPos()
            cam_dx = camx*self.scale+self.offsetx
            cam_dy = camz*self.scale+self.offsety
            ac.glColor4f(*color)
            self.glQuad(cam_dx-3*self.arrow_size, cam_dy-3*self.arrow_size, 7*self.arrow_size, 7*self.arrow_size)
 

Attachments

  • Untitled.png
    Untitled.png
    12.6 KB · Views: 6
Last edited:
Messages
35
Points
7
omg, I am so gonna test this later. Now that you have the python editor open, can you make a way to ignore certain cars? We use 2 cars for streaming our races and they are parked in the pits during the race so they show up on track map display. It would be very nice if it was possible to get the app to ignore those and not draw them.
 

NightEye87

Premium
Messages
790
Points
0
omg, I am so gonna test this later. Now that you have the python editor open, can you make a way to ignore certain cars? We use 2 cars for streaming our races and they are parked in the pits during the race so they show up on track map display. It would be very nice if it was possible to get the app to ignore those and not draw them.
In the lines (line ~828) above what I posted there is an "if v > 0.1:" (so, if the speed is larger than 0.1 unit), it will draw triangles. Then it says "else:" (so, if the speed is not larger than 0.1 unit) it draws a quad.
You could do:
Code:
else:
    pass
to stop drawing rectangles for stationary cars.
You could also include a timer, so if a car is stationary for more than x seconds, it doesn't draw a rectangle, etc. etc. But I'm unsure how that works in this case, as I'm not too familiar with the "def" functions and such.

I am unclear where the bottom of that section is. Is it at line 776?
I may have altered the .py file before, so I didn't want to mention any line numbers. The picture I posted shows line 849. So probably somewhere close :)
 
Messages
35
Points
7
In the lines (line ~828) above what I posted there is an "if v > 0.1:" (so, if the speed is larger than 0.1 unit), it will draw triangles. Then it says "else:" (so, if the speed is not larger than 0.1 unit) it draws a quad.
You could do:
Code:
else:
    pass
to stop drawing rectangles for stationary cars.
You could also include a timer, so if a car is stationary for more than x seconds, it doesn't draw a rectangle, etc. etc. But I'm unsure how that works in this case, as I'm not too familiar with the "def" functions and such.


I may have altered the .py file before, so I didn't want to mention any line numbers. The picture I posted shows line 849. So probably somewhere close :)
So your tip above works fine, except it will also stop rendering cars that have wrecked and are parked on the side of the track and cars that are in the pits.

If you have made any nice changes to the app, I would love to try it out.
 

NightEye87

Premium
Messages
790
Points
0
So your tip above works fine, except it will also stop rendering cars that have wrecked and are parked on the side of the track and cars that are in the pits.
Yep. I think a timer would be your best bet. I know how they work, but I have no idea if and how they work inside a "def", so I can't be of much help there.


If you have made any nice changes to the app, I would love to try it out.
Definately not apart from the camera indicator, but I've used MapDisplay to try and learn to do Python, so I used it to try some things out and never cared to make a backup. So there might be residual lines left :whistling:
Here's a new bit by the way, where it doesn't render the camera indicator if you're close to the car (it would render the square on top of the car when driving which was annoying).
Code:
            specx,specy,specz = ac.getCarState(specId, acsys.CS.WorldPosition)
            camx,camy,camz = ac.ext_getCameraPos()
            cam_dx = camx*self.scale+self.offsetx
            cam_dy = camz*self.scale+self.offsety
            if abs(camx-specx)>5 or abs(camz-specz)>5 or abs(camy-specy)>5:
                ac.glColor4f(1,0,0,1)
                self.glQuad(cam_dx-3*self.arrow_size, cam_dy-3*self.arrow_size, 5*self.arrow_size, 5*self.arrow_size)
 
Top