This is what it's "doing":
{
"id": "same_racing_class_gt3_gt2_",
"name": "Same racing class (GT3/GT2/…)",
"filter": "class:race",
"script": "
-- tags to search for
classes = { 'gt3', 'gt2', '#GT4', '#90s touring' }
-- try to find some tag in selected car
racingclass = nil
for i, cl in ipairs(classes) do
if selected.Tags:ContainsIgnoringCase(cl) then
racingclass = cl
break
end
end
-- logging
if racingclass ~= nil then
log('selected class: ' .. racingclass)
else
log('selected class: NIL')
end
-- in case there is no any tag at all, result is false
if racingclass == nil then
error('Can’t detect selected car’s racing class')
return false
end
-- result function which will try to find that tag in any tested car
return function(tested)
return tested.Tags:ContainsIgnoringCase(racingclass)
end"
}
Looks like the class of car needs to be "race" and the tags need to have the same tag. You could add tags into this script if you wanted also.
At the same time, know what it's searching for means that you can take your content and tag it, class it appropriately in order for it to work.
I use the same subclass all the time. Which means I will select a group of cars, use Content Manager to update the UI in all cars by adding a tag to all of them simultaneously such as #uglyyellowcars. Must have the # in front of it. That way when using the subclass feature, I could have a subclass with 300 cars in it, then using the random (or shuffle) feature in content manager, out of those 300 AI cars it has to choose from, if I select there to be 19 AI opponents, I have no clue who I'm racing against. It's all up in the air and the grid is always random as well as the skins.