ATVO by Appgineering
Download
Read-only

Pit Stop Animation

3 posts 2,336 views Started 11 Mar 2020, 14:58
Showing 1–3 of 3 posts
Amerigo R.
Original poster

Hi guys, sorry for my bad english :)

I want to show a little "pit image" near the name on standing that i've created, but i don't see a right trigger to active the image when driver entering pits and exit.

Anyone have already do this?

thx in advance

Niclas D.
Reply #1

Well i have tried it via the Event Ticker, (Pit in) and (Pit Out) but i can't seem to get it to work atm

Lukas R.
Reply #2

I'm using a "pits" script that you can find somewhere around here as a base. I just changed return type from text into the name of the image.

First, have a Widget "InPits", which is a ticker, for the whole Standings tower. In it, create a label with a Dynamic Background, set it to the entitysessionresult_object, and Path as a {0}.png, with the return value of the script being the image name. Add the following script and use it as a converter script. Btw. the return values must be the name of the image, without a file type in this case.

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

namespace Scripts
{
 public class pits : IScript
 {
 public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
 {
 IEntitySessionResult pit = (IEntitySessionResult) value;
 
 if (pit == null)
 return "";

 if (pit.Entity.Car.Movement.IsInPits == true)
 return "bg_standing_pit";
 
 else
    return "bg_standing_pit_empty";
 }
 }
}
Archive · Read-only

New replies have moved to Discord.