XCOM 2
Automatically Color Units - WotC + Vanilla
94 Comments
Rhogog Apr 12, 2024 @ 3:12am 
There's a weird bug where I change the reaper and skirmisher colors in ini and the game doesn't react at all. Changing ini colors for vanila classes works fine. Disabling mod, changing colors manualy, saving and reenabling mod just returns WotC class colors to default mod ones... Huh?
SomebodyElse Jan 21, 2024 @ 3:04am 
It would be a big help, if the mod would set the colors only once (only when recruiting a soldier), allowing us to still set custom colors if we want to.
LeWe0FuN Jun 28, 2021 @ 10:52am 
does it work with lwotc?
BlueRaja  [author] Apr 14, 2020 @ 5:44pm 
@marcel see the pinned topic above, "Where is the .ini file?"
marcel Apr 14, 2020 @ 5:11pm 
How can i add the classes from RPGO into this, please?
katiekat3000 Aug 16, 2019 @ 6:02pm 
BlueRaja  [author] Aug 13, 2019 @ 1:57pm 
@katiekat3000: AFAIK there is no LW2 WOTC..?
katiekat3000 Aug 13, 2019 @ 5:25am 
is there plans to make this mod work for Long war 2 WOTC
Rollo Tomasi Mar 6, 2019 @ 2:37am 
Great mod! But found a small problem/bug: in the ini file, Leaving the 2 camo values at -1 gives me the "Digital" camo pattern on all armor and weapons. (I'm using Long War 2 mod, as well as some other customization mods - not sure if one of those expanded the camo patterns with negative values, or if this happens for vanilla usage as well?)
Player Nov 25, 2018 @ 2:40pm 
Is there a way to make this work for other stuff like eye or tattoo colors also? That would help with the 40k armor mod.
Kraiver Sep 8, 2018 @ 7:32am 
Hi, I created a much improved mod AutomaticallyColorUnits based on yours and constantly expand it.
https://steamcommunity.com/sharedfiles/filedetails/?id=1504969791
Player May 12, 2018 @ 10:41pm 
Is there a way to change colors based on terrain/biome of a mission?
Mavoc Apr 25, 2018 @ 11:58pm 
Any reason why this mod does not include a line for Sparks by default?
Player Mar 3, 2018 @ 1:48am 
Wish I knew about this sooner! Thanks!
Two Gun Bob Feb 10, 2018 @ 12:31pm 
Been using this for awhile, just wanted to say this is one of my favorite and most useful mods. Thanks for putting in the time to publish this.
MarkedAgain Dec 19, 2017 @ 8:56pm 
it does work with long war 2, but i goto figure out how to change the techincals colors as its to close to grenediars
katiekat3000 Dec 18, 2017 @ 8:44am 
doesthis mod still work for long war II?
Dare Sep 30, 2017 @ 4:13am 
Gosh, this mod already exists. I was planning on writing it myself, but no need. Thx!
Gutted Sep 26, 2017 @ 7:33pm 
If the warning icon in the launcher for WotC annoys you.. simply open up the AutomaticallyColorUnits.XComMod file and add the line "RequiresXPACK=true" to the bottom of it. Problem solved.
Juravis Sep 19, 2017 @ 11:20pm 
Thank you for updating this. Color keying is an integral part of quick and efficient tactical strategy.
BlueRaja  [author] Sep 14, 2017 @ 8:17am 
@sq_paradox: If you set ScreenClass = none, you need to ALWAYS check screen's type, because those events will be called on every screen
sq_paradox Sep 14, 2017 @ 6:28am 
Found the problem. Somehow the OnRemoved event is being triggered. Since it sets the ParentScreen to none for garbage collection by the time the button callback function runs the ParentScreen is no longer set.

Conditionalizing the OnRemoved event with the same conditions as the focus and initialization events (which I probably should have already done, as you did with your screen listener) seems to solve the issue.

Thanks for the help. Sorry to have taken up your time (and all this space on your comment page). Should have figured that out earlier. Feel free to delete these comments to free up space if you want.
sq_paradox Sep 13, 2017 @ 8:02pm 
I tried making the Unit global so it's also assigned durring initialisation/receiving focus and that's not getting lost. I'm assuming that means the screen listener isn't crashing.

Seems like the mod might be working but it's still failing to access the ParentScreen when the callback function executes so the ParentScreen is still not passed to the choose class screen. The only thing the choose class screen does with the ParentScreen is use it to populate data one everything is done so that might not be the end of the world. Still weird though.
sq_paradox Sep 13, 2017 @ 7:17pm 
Honesly I'm not sure, UIArmory_Promotion and ACU_UnitColorer are both running into Accessed None 'Unit' but not until after UIScreenListener_CommandersChoice thrown its first errors of Accessed None 'ParentScreen'.

If anything it seems like my screen listener is crashing after initialization and another instance is picking up and taking over but since the ParentScreen global variable is assigned in initialization and/or when receiving focus it's undefinded when it gets called by the button callback function.
BlueRaja  [author] Sep 13, 2017 @ 5:53pm 
sq_paradox: Are there any exceptions in the console?

I am not doing anything with the UIScreen (other than listening for the Focus event), so the only way I can imagine that possibly happening is if my screen listener is crashing before yours gets called. Maybe UIArmory(screen).GetUnit() is returning None?
sq_paradox Sep 13, 2017 @ 3:13pm 
This mod is causing a conflict with my Commader's Choice mod. The screen listeners are conflicting (I think).

My screen listener is able to access the parent screen (UIArmory_MainMenu) on initialisation and on recieving focus but not once the Commader's Choice button is selected (highlighted) or clicked. Consequently it cannot access the Unit nor pass it or the parent screen to the class selection screen, thus it cannot promote said unit.

I've messed around with my code and have been unable to fix the issue. Are there any changes you would recommend or changes you can make to this to fix the issue? Or is this a basic incompatibilty we'll need to advise users of?
BlueRaja  [author] Sep 9, 2017 @ 10:51am 
@katiekat3000: If you mean the warning icon, please read the description
katiekat3000 Sep 9, 2017 @ 10:36am 
OK so i did get it working but i do wonder why does it show as not that it will not work?
katiekat3000 Sep 5, 2017 @ 8:15am 
so are there any mods this mod will not work with? it does not seem to work for me and am not sure why
mutant Sep 4, 2017 @ 11:07am 
alrighty, still subscribed and up-rated cause i thik it's a very good idea ;)
BlueRaja  [author] Sep 4, 2017 @ 6:00am 
@mutant: The colors can be customized in the .ini file. There is no way to make each Ranger a different shade of orange with this mod; if you want that, you'll have to do it manually. Sorry!
mutant Sep 4, 2017 @ 5:21am 
only downsides (maybe i did something wrong or didn't fid how to correct it)
it seems to override any customization done to soldiers.
i mean, i like the whole one color per class thing, but i like to customize soldiers, for example my rangers are all colored in shades of orange. but the thing with this mod is that it sets one color to one class, and you can't change it afterwards.

when i go to customization and change the color of an outfit, it goes back to "preset" color.

any chance you could change that ?
Unicron Supreme Sep 2, 2017 @ 10:38pm 
what hobbes said :) would be great!
Hobbes Sep 2, 2017 @ 7:08am 
Suggestion - Instead of using the ini file, set up some kind of in game UI that allows players to adjust the class colours from within the game.
Zucram Sep 2, 2017 @ 6:16am 
it says its not combatible with wotc when i launch the game

Unicron Supreme Aug 31, 2017 @ 3:17pm 
oh thank god, its such a drag to have to color class's manually, thanks
BlueRaja  [author] Aug 31, 2017 @ 1:07pm 
@Dallen: Updated for WotC!
BlueRaja  [author] Aug 30, 2017 @ 8:07pm 
@Dallan: This is one of my least popular mods, but it's also one of my favorites, so I absolutely intend on updating it! I have a lot of higher-subscriber mods to fix yet though, please give me a few days.
Dallan Aug 30, 2017 @ 6:50pm 
I love this mod, it's simple and lightweight but does exactly what I need, and I hope you're planning to update it for WotC (it seems to crash at various points ingame, particularly when starting missions: the error logging suggests that it's calling a function called IsASoldier that isn't named that anymore - maybe they changed the API in the WotC update?)
Unicron Supreme Jun 16, 2017 @ 7:37pm 
i've been waiting for a mod like this for a long time Thx
OotaOTT[RU] Apr 6, 2017 @ 9:42am 
bad setup!
Juravis Mar 19, 2017 @ 5:29pm 
@BlueRaja Can i make a small request? I'd like the Listener to run more aggresively and often. Sometimes from coming out of the armory and other small things the colors arent applied correctly, or the gun is skipped because it is customized. I'd like uniform colors all the time, even at the price of a little performance. If you have the chance, naturally. Thank you.
Juravis Feb 21, 2017 @ 2:52pm 
@BlueRaja Aye aye commander, also sounds like -1 would do terrific.
BlueRaja  [author] Feb 21, 2017 @ 2:47pm 
@ADVENT Avenger: Pull Request. It's how you contribute code to open-source projects. See eg.
https://yangsu.github.io/pull-request-tutorial/
https://help.github.com/articles/about-pull-requests/

The main difficulty in adding that feature would be adding the ability to specify "don't change" (maybe use -1 or something) so that people (like me) who want random patterns using 'Rookie Customization Options' don't have their patterns overwritten.
Juravis Feb 21, 2017 @ 2:19pm 
@BlueRaja Forgive my incompetence what's a PR
BlueRaja  [author] Feb 21, 2017 @ 2:05pm 
@ADVENT Avenger: That's a great idea, but I don't have time to work on XCom mods at any point in the near future. However, I notice you're a modder yourself - if you submit a PR on Github I will look it over.
Juravis Feb 21, 2017 @ 1:50pm 
@BlueRaja Can you add an ArmorPattern=X parameter so let's say they can start with specific armor patterns? Would be sexy.
Jacke Feb 6, 2017 @ 3:25pm 
Is there any way you could add a feature so the colours are assigned when the soldier goes to Squaddie rank and then not changed, allowing manual customization afterwards. I change the secondary colour to reflect which build a soldier has, but it's always being overwritten by the mod. Another way would be to tell the mod not to change the secondary colour.
LeWe0FuN Feb 5, 2017 @ 2:54am 
nice
katiekat3000 Jan 31, 2017 @ 4:26am 
yes! itworks ty so much ^^