Humanoid Alien Races
Description:This mod contains a DLL which allows for creating humanoid alien races with unique graphics. Current features include:
Features in 0.5
- Custom head textures
- Custom body textures
- Custom skin colors
- Custom hair colors
- Custom gender distribution
- Use of pawn-specific backstories
New in 0.7
- Forced Race traits
- Race Restricted Apparel
- Custom Backstories
New in 0.8
- Patch for Prepare Carefully
I tried to make it as modular as possible. Every part of the graphic set is defined in a Race ThingDef. Every entry that's left empy results in the use of vanilla assets.
For now, this is not a content mod and more of a framework to do your own modding. I have defined one example race, the reddish, horned Devilmen, just to show how the code is to be used (Look for the Devilman-Drifter in the console). Descriptions of each new ThingDef entry are included.
As of this version you can define colonists of your alien race that may be part of your starting party. It's based on a new PawnKindDef, an example is included in the mod.
The rest is up to your creativity: Fantasy races like Elves, Dwarves and Orks; Sci-Fi races like Asari, Klingons, Gungans ( ); eldritch beings like Deep Ones; or greenskinned and leaf-sporting mutants.
Just remember that this is for graphics only!
New Features
Race-restricted apparel:
A simple ThingComp that allows you to assign this piece of clothing to a specific race. Other race-members won't be able to equip it. This enables the creation of body- and head-types that can stray as far as you want from the vanilla shapes.
Race specific traits: You can define traits that EVERY member of this race WILL spawn with. This isn't ideal as it takes up a trait-slot, but since most traits that go in here will probably be rather powerful, I'd call the tradeoff acceptable.
Modified version of Prepare Carefully:
The patch I included is actually a standalone-version specifically for my framework, and only ONE version should be active at any time. It is near impossible to create a real patch, since the original code is focussed entirely on humans and defines a lot of stuff globally that had to be broken down to individual pawn level if anything other than humans are to be included.
DISCLAIMER: This also means that this version of Prepare Carefully is NOT compatible with presets of other versions. Your colonists won't be loaded in properly.
How it works
I'm detouring the GenSpawn spawn methods, which is the point where pawns are placed on the map. After a pawn is randomly generated by the game, my custom spawn method converts it into a subclass that updates the graphics according to the new entries in the race ThingDef. This has to be done because the base game locks certain pawn characteristics like skin color. These are still stored on the pawn, just not displayed.
As of 0.7, there are 2 new detours I had to include in order to keep everything working. First one is FloatMenuMakerMap.AddHumanlikeOrders, which enables race-restricted apparel. Second is InteractionWorker_RecruitAttempt.DoRecruit because the base code overrides any race-definition when a pawn is recruited, due to it being converted to the BasicMemberKind of the player faction.
Author/Mod Team
Cpt.Ohu
Downloads
Release 0.8 [A15]
Release 0.9 [A16]
Prepare Carefully Patch [A15]
No longer requires CCL:
The Detour-Code as well as the ability to add custom backstories is now part of the mod. Credits go to the creators of CCL and 1000101 in particular.
How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.
Acknowledgements
Killface, joaonunes and Fluffy: Without looking into their injection code and approach to detouring, this mod would never have come to be (Mustaches are awesome)
Haplo: The framework for my custom pawn class is inspired by the MAI pawn and robots.
Erdelf: He was the one who started updating the mod for A16 before me and helped me in progressing.
EdB: Prepare Carefully is a gamechanger and in my view should really be included in the main game.
There may be snippets in the code that I haven't credited here because I can't remember whether they are from another mod, so please notify me if you find anything that needs to be mentioned.
Limitations / Things to do
I have no prior experience with C#; back when I learned programming, it was on Turbo Pascal. Because of that, the code is probably far from ideal. Some things have to be considered when creating custom graphics:
- Any base apparel in the game was designed for the vanilla body/head textures. So if you design a head or body that strays too far from the human form, you have to create new clothing for your pawns, otherwise there will be clipping.
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 source files are included, and you are free to edit whatever you like about them, especially if you want your custom pawns to have unique gameplay features.