Global Map Opponent...
 
Notifications
Clear all

Global Map Opponent Data

5 Posts
4 Users
0 Likes
983 Views
ispano6
(@ispano6)
New Member
Joined: 2 years ago
Posts: 4
Topic starter  

Hi, would it be possible to make available the Opponent Dot Data in Global Map?

I am trying to color each opponent dot in Global Map a different color and change it's text from a number position.
The only thing I need exposed to the ncalc or javascript is which index dot it is in the list of dots including player.

Using Javascript "this" I'm able to expose the keys of the C# system.dynamic.expandoobject but can't extract the values out of the object using the keys. 

I get an Error in the Javascript Fx Raw output: Object must implement IConvertible

Is there a way I can call System.Func`3[Jint.Native.JsValue...] with Convertible interface using javscript and pass in the keys that I see are available?

Alternatively, if the rendering engine is HTML, is there a way I can inject a CSS style block into the Global Map view's DOM?

This topic was modified 2 years ago by ispano6

Quote
Wotever
(@admin5435)
Illustrious Member Admin
Joined: 5 years ago
Posts: 678
 

Hi ! Unfortunately what you are trying to do is not possible, simhub only supports one opponent style and you can't make it dynamic per opponent.

About expando, indeed I don't think jint which is the javascript engine I use in SimHub can convert expandos, and your attempt seems to prove it.

Even if the display is running using HTML it's only a "rendering" medium, it's tightly bound to the simhub "server code" and you can't change it's behaviour. 

Nicolas


ReplyQuote
ispano6
(@ispano6)
New Member
Joined: 2 years ago
Posts: 4
Topic starter  

@admin5435

Thank you for your reply!  I'm actually at the point where I can stylize each dot individually with CSS within the web browser view but what I'd like to know is if it's possible for a layer within a dash template to add html or execute javascript chunks within the widget container. Is the container an HTML document that has access to window.document?

Also my C# knowledge is extremely limited and I haven't tried to invoke the convertible interface in any proper way.  I don't know much about Jint either and how to convert Jint.Native.JsValue.  I will look into that next!

This post was modified 2 years ago by ispano6

ReplyQuote
Althasil
(@althasil)
New Member
Joined: 2 years ago
Posts: 1
 

I've just started exploring creating my own dashboards, and I'm glad I found this topic early on as this is what I'm also trying to achieve. I fully understand that it is not possible to differentiate opponents using the SimHub data directly.

 

@ispano6 would you mind sharing on what you have been able to achieve with CSS? I'm looking to have most of my opponents look the same, but wanted to introduce highlights to show if a driver has done their best lap of the session (green), or if a driver has done the best lap of anyone in the session (purple). Something like you see on the far right in this linked image.

 

I'd be grateful for any advice anyone can offer. Thanks folks!


ReplyQuote
Halflernation
(@halflernation)
New Member
Joined: 1 week ago
Posts: 1
 

Reviving this topic with a question to @wotever:

 - Has this changed from 2020?

 - Is it possible to get the data from all opponents (for iRacing)?
   (Currently we only get -4 and +4 opponent data from telemetry)

 - How is the map created with all opponents when telemetry data only outputs the front and back 4 cars?
   (is this a plugin that needs to be created?)

 

My goal is to make colour-differentiated race classes when race classes are within the same car/class, e.g.: GT3. Imagine diff Pro to Pro/Am kind of stuff.

Some leagues make it on the driver name, some make it via the car number, etc.

 

Add-On Question: is it possible to add a "ghost" dot or line for the car with a configurable delay (e.g.: in seconds) to be displayed on the map?


ReplyQuote
Share: