XCOM 2
29 个评价
RuntimeReskinAPI
2
   
奖励
收藏
已收藏
取消收藏
UI
文件大小
发表于
更新日期
410.015 KB
9 月 18 日 下午 10:26
10 月 21 日 下午 1:14
9 项改动说明 ( 查看 )
您需要 DLC 才能使用该物品。

订阅以下载
RuntimeReskinAPI

描述
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.
热门讨论 查看全部(1)
3
9 月 18 日 下午 10:36
Registering Rules and Mapping Providers
SurferJay
31 条留言
SurferJay  [作者] 10 月 21 日 下午 1:31 
I've dropped another small update. This time, I've added support for reskinning UFOpedia's bestiary. Thank you to JM_Vegan for the idea!
SurferJay  [作者] 10 月 12 日 上午 5:05 
I've dropped the next big update for RRA: version 2 interfaces are out! With verison 2 interfaces, you can subscribe to post rules/mapping callbacks, letting you do advanced workflow tasks that pace themselves with various parts of the engine, like cleaning up special artifacts if you just lost or attaching mesh components AFTER the engine swaps the mesh if you just won. I've also added some CTD guards, such as making reskins get deferred until the pause menu closes, should it be open.

Check out Advent Angels' V2 providers for live examples of these features in use.
SurferJay  [作者] 10 月 9 日 下午 9:32 
@[AOC] Kageno: This mod is mainly for reskinning entire units using prebuilt Archetypes. If you want to add accessories, the cleanest approach is to kitbash them into your mesh, make a new Archetype with it, and point RRA to that.

You can attach accessories at runtime, but that’s a much more technical workflow - best used only for dynamic cases (e.g., the next Advent Angels update spawns random human heads). For most setups, the Archetype route is simpler, cleaner, and better.

RRA’s big advantage is that it lets multiple mods collaborate dynamically - via MCM toggles or dice-roll logic - making it far more flexible than old, hardcoded OPTC reskinning. So yes, you can reskin Advent troops with cosmetic mods - just do it through Archetypes for the best results.
MaXISerg 10 月 8 日 下午 2:15 
@SurferJay действительно все работает:steamhappy:. Спасибо.
[AOC] Kageno 10 月 3 日 下午 2:34 
Is it posible to use this mod to reskin advent troops with cosmetic mods?
SurferJay  [作者] 10 月 3 日 下午 2:06 
@Samio: You should be able to use this to reskin xcom troops, yes. The next release is already setup to replace animations, though the current release is not. I don't know about armor sounds, unless they're tied to the animations. I would guess they are. The next release has a lot of cool features added, like post rules/mapping callbacks and the animations replacement.
Samio 10 月 3 日 上午 10:38 
Is it possible to use this mod to reskin my XCOM troops as advent soldiers automatically?
I know there are mods that add ADVENT armor but they don't also change the animations and Advent soldiers have slightly different ones. Plus I like the way their armor sounds when it clanks.
Hiperreal 9 月 30 日 下午 6:57 
@surferjay I was indeed unaware , can tell disabling angels and related mods did the tick so ur probably right, gonna try it, thanks !
SurferJay  [作者] 9 月 30 日 下午 6:43 
@Hiperreal: Have you tried with the updated version? Since you didn't comment on it, it seems like you're unaware of the recent patch. Sounds like it's more than likely caused by the Chosen beginning their summon ability, causing my old OnUnitBeginPlay listener to trip a CTD. Download the patch and enjoy the fix! :)
Hiperreal 9 月 30 日 下午 6:38 
i came here beacuse im having the exact same issue soul reports, crashing as soon as chosen turn starts. and theres usually a lancer around, only chosen mod im playing is a better chosen and after being sure it was the culprit tought about his mod , and found him again also saw him comment there, so we both have those two mods