OpenRA/OpenRA · error · InvalidDataException
TileSelectorLogic requires a template-based tileset.
Error message
TileSelectorLogic requires a template-based tileset.
What it means
Thrown by the TileSelectorLogic constructor when the map's terrain info does not implement ITemplatedTerrainInfo. The editor's tile selector requires a template-based terrain system to enumerate and display terrain templates. The cast from map.Rules.TerrainInfo to ITemplatedTerrainInfo fails for non-template terrain implementations.
Source
Thrown at OpenRA.Mods.Common/Widgets/Logic/Editor/TileSelectorLogic.cs:54
public TileSelectorTemplate(TerrainTemplateInfo template)
{
Template = template;
Categories = template.Categories;
Tooltip = template.Id.ToString(NumberFormatInfo.CurrentInfo);
SearchTerms = [Tooltip];
}
}
readonly ITemplatedTerrainInfo terrainInfo;
readonly ImmutableArray<TileSelectorTemplate> allTemplates;
[ObjectCreator.UseCtor]
public TileSelectorLogic(Widget widget, ModData modData, World world, WorldRenderer worldRenderer)
: base(widget, modData, world, worldRenderer, "TILETEMPLATE_LIST", "TILEPREVIEW_TEMPLATE")
{
terrainInfo = world.Map.Rules.TerrainInfo as ITemplatedTerrainInfo;
if (terrainInfo == null)
throw new InvalidDataException("TileSelectorLogic requires a template-based tileset.");
allTemplates = terrainInfo.TemplatesInDefinitionOrder.Select(t => new TileSelectorTemplate(t)).ToImmutableArray();
allCategories = allTemplates.SelectMany(t => t.Categories)
.Distinct()
.OrderBy(CategoryOrder)
.ToArray();
foreach (var c in allCategories)
{
SelectedCategories.Add(c);
FilteredCategories.Add(c);
}
SearchTextField.OnTextEdited = () =>
{
searchFilter = SearchTextField.Text.Trim();
FilteredCategories.Clear();View on GitHub (pinned to a520984d91)
Solutions
- Ensure the map uses a tileset backed by ITemplatedTerrainInfo (the standard for all stock OpenRA mods)
- Implement ITemplatedTerrainInfo on the custom terrain info type if using a custom terrain system
- Disable or replace the TileSelectorLogic with a compatible selector for non-template terrain
Defensive patterns
Strategy: type-guard
Type guard
// Check terrain info type before constructing TileSelectorLogic
if (world.Map.Rules.TerrainInfo is not ITemplatedTerrainInfo)
Console.Error.WriteLine("TileSelectorLogic requires ITemplatedTerrainInfo. Current tileset is incompatible."); Prevention
- Verify the tileset implements ITemplatedTerrainInfo before opening the tile selector
- Use stock OpenRA tilesets which always implement ITemplatedTerrainInfo
- Implement ITemplatedTerrainInfo on custom terrain info types if editor support is needed
When it happens
Trigger: Opening the terrain tile selector in the map editor with a map whose tileset uses a terrain implementation that does not implement ITemplatedTerrainInfo.
Common situations: Using a custom terrain system that doesn't implement ITemplatedTerrainInfo, or loading a mod with an incompatible terrain renderer in the editor.
Related errors
- D2kBuilding requires a template-based tileset.
- {nameof(EditorTileBrush)} can only be used with template-bas
- TerrainTemplatePreviewWidget requires a tile-based terrain r
- OtherGround {n.Key} is not a ushort
- OtherGround {n.Key} has invalid fraction (should be 0 to {Fr
AI-assisted analysis of OpenRA/OpenRA@a520984d91 (2026-08-13).
Data as JSON: /api/errors/655acce7dd2022d0.
Report an issue: GitHub.