[A17] Faction Colors 1.5 (25.08.2017)

Started by Cpt.Ohu, November 17, 2016, 05:20:20 AM

Previous topic - Next topic

Cpt.Ohu



Description:

At its most basic this mod contains a DLL that allows for apparel to use the CutoutComplex Shader, thereby enabling tintmaps for apparel and coloring by XML-coding. So, this is targeted mainly at modders, and all of the content inside is there for demonstration purposes.

An example is included in the mod in the form of reinforced leather armor:



This is a composite apparel, consisting of any kind of leather lying around, and some steel. Base color derives from leather, shoulderpads are defined in the code.

If you're only interested in using the CutoutComplex shader, you can simply define it in the graphicdata-block of your XML. Tintmap required of course, otherwise it won't be colored at all.


The big feature of this mod and its namegiver is the ability to define two lead colors for your custom advanved faction. Instead of ragtag outlanders/mercenaries coming in colored like they're in a circus parade, you'll have uniformed soldiers. Additionall you can define one main faction with several subfactions, each with their own color-scheme, and at game-start one of those will be randomly selected to represent this faction for the current game.

And yes, you can do that whole faction-specific apparel color thing right now by simply recoloring the textures, but for any given apparel this means editing at least 16 files (+ 4 for each headgear) + texture-bloating when you want to have different color schemes available. With this mod you can make 1 setup (normal textures + tintmap) and then recolor everything by editing one xml file.





Additional features:

Camouflage Colors
Say you create a faction that's supposed to havea regular modern day military. Why would they try to sneak up on your colony wearing bright red and pink power armor during winter assaults, or bright white coats while assaulting your forest-fortress. Not really what you'd associate with tactical brilliance.

You can define your new apparel to be colored according to the biome and season colors. This means green/brown for the temperate regions, khaki for deserts/shrublands, and white/grey for both winter seasons and ice-sheets. Examples are the snipers from the image above.

Note that apparel is colored the second it is created by the game, so all those white armors you got from a winter-assault will remain white in the summer.

Weapon-Sizing

Sometimes you want to have a cyborg shouldering an enormous gun, but the game will still render it tiny. In that case you can use this mod to define the drawing-size of your weapon.

Take a look at hulky Janwaat and his sidekick for comparison:




There are of course limitations as an increased meshsize will eventually yield weird looking ways of actually wielding the weapon.

How it works

I'm detouring the ResolveApparelGraphics method. This is what's blocking multi-colored apparel since it locks down the shader-type. Additionally I'm detouring DrawEquipmentAiming to alter the drawing mesh size.

Author/Mod Team
Cpt.Ohu

Downloads

Release 1.3 [A16]

Release 1.5 [A17]


Example Mod [A16]

Acknowledgements
Using Harmony for detouring.

How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mods in the mod menu in the game.

Licence

As this is basically a helper-dll, you are heavily encouraged to use it for whatever ideas you're working on. Just mention that you've used this framework as a basis.

The textures are taken out of my upcoming Warhammer 40k mod. Please ask before redistributing them with your mod or including them in a modpack.

The source files are included, and you are free to edit whatever you like about them.

Shinzy


skullywag

Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

kaptain_kavern


The13thRonin


mabor0shi

I'm gonna download this in the hope that I can come up with some clever way to make use of it. It seems like a very useful modder's resource and those are uncommon. Good stuff!
Cool Mod, Bro Everything in RimWorld doesn't have to be either brown or grey anymore: Now you can Pick a Color!


Cpt.Ohu

Quote from: Smexy_Vampire on November 26, 2016, 10:31:10 PM
how to use ?

This is primarily aimed at modders. You can install this mod like any other, however it only contains 3 kinds of armor and one sword. To add your own custom colored stuff, take a look at the examples present and adapt them to your needs. Same goes for factions.

I may write a proper tutorial for this if I find the time.

koni


Cpt.Ohu

Yes, it's basically updated already for my 40k mod and I will release the standalone once I get back to my main computer.

koni

Quote from: Cpt.Ohu on December 25, 2016, 06:43:57 AM
Yes, it's basically updated already for my 40k mod and I will release the standalone once I get back to my main computer.

I can't really await it. That would be essential to Ancient Rim :)

Cpt.Ohu


koni


solidcordon

#13
Not sure if this is specifically a faction color issue but it pops up when I am trading with an exotic goods merchant. The trade menu screen glitches but if I use the mouse to scroll past the last item displayed past a blank screen, I get the rest of the menu.
Trading still works but it's weird.

QuoteException filling window for RimWorld.Dialog_Trade: System.NullReferenceException: Object reference not set to an instance of an object
  at FactionColors.ApparelUniform.get_DrawColor () [0x00000] in <filename unknown>:0
  at Verse.Widgets.ThingIcon (Rect rect, Verse.Thing thing, Single alpha) [0x00000] in <filename unknown>:0
  at RimWorld.TransferableUIUtility.DrawTransferableInfo (ITransferable trad, Rect idRect, Color labelColor) [0x00000] in <filename unknown>:0
  at RimWorld.TradeUI.DrawTradeableRow (Rect rect, RimWorld.Tradeable trad, Int32 index) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade.FillMainRect (Rect mainRect) [0x00000] in <filename unknown>:0
  at RimWorld.Dialog_Trade.DoWindowContents (Rect inRect) [0x00000] in <filename unknown>:0
  at HugsLib.GuiInject.WindowDetour+<>c__DisplayClass1.<_WindowOnGUI>b__0 (Int32 x) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
HugsLib.GuiInject.<>c__DisplayClass1:<_WindowOnGUI>b__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, GUISkin, Int32, Single, Single, GUIStyle)

To make this slightly less useless as a repoty, the issue is likely compatibility with one of these mods... :P
    HugsLib, ED-Embrasures, Miscellaneous_Core, Miscellaneous_Robots, EPEO - Hardcore LITE Version 1.1, FloorLights, LT_DoorMat, TilledSoil, Trap Defence V1.1 A16, , Miscellaneous_BeeAndHoney, Miscellaneous-TrainingFacility, Robots_PlusPlus_Misc_Robots_Xtension, MadSkills-A16-1.2.1, CheaperComponents, , MoreTradeShips, RT_Fuse-A16-1.0.4, StackXXL, RimFridge, Tranq Turrets, LessArbitrarySurgery, MarvsPleaseHaulPerishables, ReclaimFabric-ReclaimFabric1.7,
We Care Less About Prisoners, Miscellaneous_Objects, TechAdvancing, Synthmeat, ExpertQuality, RemoteExplosives, RiotShield, AutoFlicker, MiningCo. MiningHelmet, MiningCo. MMS, WM Smarter food selection, Miscellaneous_MAI, MiningShaftA16, DyeVat, Mind Altering Device, FactionColors.

With MoreTradeShips, ReclaimFabric-ReclaimFabric1.7 and DyeVat being likely candidates (in my humbly pinion)
I can't reclaim materials from armoured robes, which is fine.

You are aware that a thrumbofur armoured robe at legendary quality is significantly better than powered armour aren't you? :)

Cpt.Ohu

It is a FactionColor problem that I fixed a while ago, i just forgot that the uploaded version isn't updated yet. Should work normally now.

Quote from: solidcordon on February 05, 2017, 07:19:01 PM
You are aware that a thrumbofur armoured robe at legendary quality is significantly better than powered armour aren't you? :)

Well, it is the hide of the legendary Thrumbo, a creature equivalent to the Nemean Lion! Puny sci-fi armors pale in comparison  ;)

In all seriousness, it's mainly there for modders to have a template on how to use the assembly, balancing wasn't on my mind when creating it.