Emmanuel Suter wrote:
Try this on the top of your script (only if and return, the top is to show you were put it)
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
{
return null;
}
We met this problem with others and it solve.
I can't integrate it and make it work with my script ...
I'm going to put my script here to see if it can be optimized in some way
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
namespace Scripts
{
public class Script : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var result = value as IEntitySessionResult;
if (result == null)
return null;
if (result.DidNotStart == true)
return "DNS";
if (result.Out == true)
return "DNF";
if (result.Entity.Car.Movement.IsInPits == true)
return "PIT";
if (result.Finished == true)
return "FINISH";
return "";
}
}
}