Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Zack R
on
Nick Thissen wrote:It is then maybe easier to bind to the "entitysessionresult_object" and obtain the FastestLapTime value from the result itself like so:

using System;
using System.Linq;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;

namespace Scripts
{
public class conv : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var result = (IEntitySessionResult)value;
var laptime = result.FastestLapTime;

var trackLength = 2.50f; // Hard-code 2.50 miles

var laptimeHours = laptime / 3600; // Laptime in hours
var speed = trackLength / laptimeHours; // Average speed in mph

return speed + " mph";
}
}
}

How would you call tracklength to use the actual in-sim values? I wanted to add an average speed to a widget with a laptimes data set and there's no default binding for speeds there, just times.