XCOM 2
RuntimeReskinAPI
25 Comments
Hiperreal Sep 30 @ 6:57pm 
@surferjay I was indeed unaware , can tell disabling angels and related mods did the tick so ur probably right, gonna try it, thanks !
SurferJay  [author] Sep 30 @ 6:43pm 
@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 Sep 30 @ 6:38pm 
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
SurferJay  [author] Sep 30 @ 12:35pm 
In the latest update to this API, the issue should now be resolved. Please be sure and snag the update so that you can continue to enjoy RRA's features without these pesky CTDs. Thanks again @MaXISerg!!!
SurferJay  [author] Sep 29 @ 6:04pm 
@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.
Bobbitthehobbit Sep 19 @ 1:07pm 
@SurferJay Cool! I'll keep an eye out :D
SurferJay  [author] Sep 19 @ 12:54pm 
@Bobbitthehobbit Totally fair — interfaces are abstract until you see a live example. The quick recipe for “ADVENT → B1 droids” with RRA is:

Rules Provider: when you want to reskin the passed-in unit, return true along with your outPriority.
Mapping Provider: return true and put the archetype path you want to use for the passed-in unit in the outArcPath (e.g., 'AdvStunLancerM1' to <Droid archetype path, as a string>).
Registration: Register your rules and mapping providers in your OPTC. See the sample code in the interfaces.

To validate registration, use the RRAShowRulesProviders and/or RRAShowMappingProviders console commands ingame. To view logging related to the rules and mapping evaluations, for troubleshooting, use the RRASetLogMode 1 console command.

If you’d rather learn from code, the next Advent Angels update will ship with working providers you can copy and adapt.
Bobbitthehobbit Sep 19 @ 12:30pm 
I was hoping I would be able to use this to swap some of the LWOTC ADVENT units for droid variants from Cavily's "[WOTC]Star Wars B1 Battle Droid Cosmetics" mod, but alas the documentation went over my head. I do hope this mod makes other mod maker's lives easier.
SurferJay  [author] Sep 19 @ 11:47am 
@PsyCHo: Well, in the mapping callback you have the unitState, so... I guess you really could do that when you win. I'd be surprised if the unitState can't be used for that purpose.
PsyCHo Sep 19 @ 11:40am 
My lack of knowledge about X2 coding shows up :D: I kinda hoped what you made could be used in a "if unit name = John 'Johnny' Smith, then pick from character pool John 'Johnny' Smith #1, John 'Johnny' Smith #2 or John 'Johnny' Smith #3" way.
SurferJay  [author] Sep 19 @ 10:59am 
@PsyCHo: The template names aren't very unique per XCOM soldier, though you might be able to use the unitState to determine if it's that specific XCOM soldier. You'd then need to create an archetype that has the specs that you like.

I'm not sure that the first version of the interface is well suited for the granularity of configuration (all the slots, all the camos, all the colors, etc) that you want. It's more for swapping enemy meshes with modified variants wholesale. But feel free to experiment. You could even build an interface V2 (and the corresponding rules, mapping, and reskinning logic) for that granularity and submit it for consideration, if you're that passionate about it. ;)
PsyCHo Sep 19 @ 10:40am 
Could this be used to edit soldiers?
I would love my Agent 47 to change his suit on his own. Or Tommy Vercetti to sometimes run in his shirt and other times in his suit.
SurferJay  [author] Sep 19 @ 6:53am 
@MrMister: It should work fine with LWOTC enemies, since we run at runtime, and after LWOTC. This will take its pawn and replace its mesh and materials with your chosen archetype's mesh and materials.

I don't know about flickering in the other mod, but it doesn't happen here. This API is tested and working. Stay tuned to see how Advent Angels integrates with it if you want a functional sample.

The V1 interfaces are based on an archetype-driven system, which suited my needs perfectly. I left it open to other implementations by versioning the interfaces. Who knows what the V2 interfaces might look like. Could be config driven! I have no need for that, but with collaboration it's definitely a possibility. The way I'd design it, any version could be used by any mod, simultaneously.

@PhatJoe: Of course! :) That was one of my requirements from the get-go. It even covers main menu actors. All that is mentioned in the mod's description in the first section under Features .
Phat Joe Sep 19 @ 5:15am 
Does this address the issue of enemies having different skins during reveal animations from their in game model?
MrMister Sep 19 @ 2:57am 
Sounds like Enemy Reskinner Redux but with rules and at dynamic runtime. Nice.

I assume that it won't work on units "decorated" using LWOTC's integrated config-based mechanism, like all LWOTC ADVENT variants, right?


FYI, the behaviour when using Enemy Skinner REdux on one such unit is that the new model is applied *ovelayed on top of the old*; you have to also remove their associated config entry on that array (can be done on another mod's .ini) in order for that to work without flickering.
Shaggoth (Ищезаяц) Sep 19 @ 1:00am 
in that context i guess "reskinning" means changing models? or textures/materials?