XCOM 2
Not enough ratings
RuntimeReskinAPI
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
267.821 KB
Sep 18 @ 10:26pm
Sep 20 @ 9:37pm
3 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
RuntimeReskinAPI

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.

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 archetype mappings without conflicts.



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

  • 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.

  • 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 and materials are applied to the unit immediately.

  • 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 a general coin toss 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.
Popular Discussions View All (1)
3
Sep 18 @ 10:36pm
Registering Rules and Mapping Providers
SurferJay
21 Comments
SurferJay  [author] 2 hours ago 
@MaXISerg: Thank you for the report! I'll look into that and see if I can replicate the issue and isolate the root cause.

Note to self (translation): With this mod, my game crashes every time a Sectoid raises zombies on the map or a faceless appears from a civilian. Disabling it still allows you to play normally with (Advent Angels - Steam Workshop).
MaXISerg Sep 28 @ 12:09am 
с этим модом у меня ломается игра каждый раз когда на карте сектойд поднимает зомби или появляется безликий из гражданского.
Отключение его все еще позволяет нормально играть с (Advent Angels - Steam Workshop)
Soul Sep 26 @ 5:00am 
Just saw your message (for some reason it didn't tell me in my notifications)
I'll do it next time I play (could be a bit,since I'm not on my modded pc so I play vanilla right now,and it suck lol but I'm oversea)
Tho can confirm that after disabling it,did basically 12h of gametime with 0 crash,so I'll def send you logs when I'm back to see what could be the conflict here.
[AOC] Kageno Sep 25 @ 10:16pm 
@SurferJay question is it posible to only
Replace the Advent unit cosmetics. With this mod. Cause im trying to replace most of Advent with the Locust from gears.
SurferJay  [author] Sep 25 @ 10:13pm 
@Soul: Thank you for that report, sorry for your trouble. Sounds like it's occurring during rules evaluation. It would be very appreciated if you would do the following, you'd help a lot.
1. Enable this mod
2. Turn on Runtime reskins in Advent Angels MCM (relaunch if necessary)
3. Use the 'AdventAngelsSetLogMode 1' and 'RRASetLogMode 1' command
4. Play until a crash
5. Send me your Launch.log in a Discord PM.
Soul Sep 23 @ 3:54pm 
Hmm so kinda throwing a rock in the dark here,but to explain,I use a lot of mods (+700,tho most are cosmetic/weapon looks) and so far I never had "consistent" crashing,to call them that,it would happen sometime,like once every 4 session maybe.

But after installing this mod (not the angel one,this one specifically) I do see a up in the crashes,easily 1-2 per sessions,and it seem to happen more when theres a Lancer around and its the Chosen turn,just wondering if others had the same unfortunate experience with it. (Will add that since removing that tho,no more crashes,but at least Angels still work fine)
Bobbitthehobbit Sep 22 @ 3:30pm 
Yeah I had seen that LW does something different then the base game with the model variants. Think trying to do this on my own atm is a bit above my "pay grade".
SurferJay  [author] Sep 22 @ 2:41pm 
I've noticed that this is compatible in a sense with LW's config-driven modifications to units. They do things like changing the metallic or emissive color of a unit. I've noticed that anytime RRA reskins the unit (replaces the mesh and materials) that the unit retains the changes made by LW.

I've tested this with LW's Archon, by adding it to my unit replacement definitions and passing it my base Archon model with its gold metals. LW changes its metals to black and this persists even after restoring the mesh and then re-applying the reskin. So, in that sense, there is compatibility, since LW's override is neither destroyed nor overwritten. I'm not sure if the outcomes will be as expected with fully custom models.
Bobbitthehobbit Sep 21 @ 6:18am 
@SurferJay Thanks dude, I'll take a look!
SurferJay  [author] Sep 20 @ 10:08pm 
@Bobbitthehobbit: The Advent Angels update is finally released! Head on over and take a look at the live sample it offers. You can enable logging and try out the various trigger points: main menu, mission start, reinforcements/dropunit, and unit reveals (AKA matinees/cinema pawns). They're all rigged up and in use by Advent Angels, giving you various points to watch it as it drives.