RuntimeReskinAPI

If you liked this item, please rate it up on Steam Workshop page.

Author: SurferJay

Last revision: 21 Oct, 2025 at 20:14 UTC (3)

File size: 410.01 KB

On Steam Workshop

Description:

Reskins that think for themselves.

Released as a utility of the popular Advent Angels – Steam Workshop mod, split for public use.

A lightweight, reusable framework for reskinning units at runtime. Unlike traditional OPTC strPawnArchetypes methods – which are heavy-handed, static, and come with winner-takes-all conflicts – RRA is dynamic and allows competition and dynamic outcomes, making diverse and randomized outcomes possible.

This component lets mods dynamically reskin units and pawns while the game is running.
It is designed to be integratable – other mods can plug in their own rules and mappings without conflicts.


Features
  • Supports all major contexts:
    • Starting spawns
    • Reinforcements
    • DropUnit
    • Cinematic pawns (reveals, matinees, cutscenes)
    • Main menu shell actors
    • UFOpedia bestiary

  • Rule evaluation system:
    • Integrators define rules that can evaluate the context, template name, unit state, and game state.
    • Each rule can declare priority, allowing fair competition and cooperation between mods.
    • If a rule wins, the mod’s corresponding mapping is evaluated immediately.
    • Win or lose, rules are notified in OnPostEvaluateRules, allowing them to do cleanup or follow-up tasks as necessary.

  • Mapping system:
    • Integrators define mappings that route template names to target archetypes.
    • If a rule wins, the corresponding mapping is used to designate an archetype for the unit’s template
    • The chosen archetype’s mesh, materials, and animations are applied to the unit immediately.
    • Win or lose, mappings are notified in OnPostResolveMapping, allowing them to do follow-up tasks as necessary.

  • Dynamic runtime logic:
    • Rules are resolved when units spawn, not at compile-time.
    • Enables coin-toss reskins, randomization, or context-aware swaps.
    • Example: Advent Angels uses this system to do coin tosses for MCM-controlled randomization and to give unisex enemies randomized genders.

  • Integration-friendly:
    • Any mod can register rules & a mapping via the API.
    • No need to fork or overwrite vanilla templates.
    • Clean, minimal overhead.
    • Does not require any hard dependencies; no CTDs for your subscribers.


For Players

This is a shared framework. By itself, it doesn’t alter visuals.
You only need to subscribe if another mod (such as Advent Angels) requires it.
If no dependent mods are installed, this mod does nothing.


For Modders

Want to reskin units dynamically in your own project?

  • Register your rules with the Runtime Reskin API.
  • Provide a mapping of templates (e.g. AdvTrooperM1) to archetype paths.
  • Register your rules and mappings in OPTCs. See the Registering Rules and Mapping Providers discussion.
  • The API handles runtime application and mesh/material swap.
  • Rules can include priority and runtime conditions, giving you fine-grained control.
  • Console Commands: RRASetLogMode 0|1, RRAShowRulesProviders, RRAShowMappingProviders
  • Explore advanced rule building, such as caching your reskin decisions for consistency between savegame loads. (See Advent Angels’ implementation.)


Compatibility
  • Should override OPTC reskinners without conflict. No CTD, no failed RRA reskin.


Notes
  • Built for XCOM 2: War of the Chosen.
  • Requires the Community Highlander.
  • Safe to add or remove mid-campaign (reskins only affect active pawns).


Runtime Reskin API — a foundation for dynamic, collaborative reskinning in XCOM 2.

Download
Required DLC:

These DLC should be installed in order to use this item.


XCOM 2: War of the Chosen
Revisions:

Old revisions of this mod are available below. Click the link to download.