need help modding pawn body textures

Started by keylocke, March 15, 2016, 10:28:43 PM

Previous topic - Next topic

keylocke

sup guys? i'm trying to reskin pawn bodies and create custom body shapes like these :



can anyone point me to a good tutorial? it says here that the tutorials posted there are out-of-date for a12 and up.

anyways. i hope someone can point me in the right direction while i still got freetime to do it. (hoping to finish this in a day or two)

stuff i'm hoping to learn :
-what are the defs that i need to change for my custom head, body, and hair textures?
-how do i replace/remove unwanted graphics from vanilla? (since old textures for apparels would look incompatible for these.
-what about pants? what's the defs needed for pants graphics? are there no graphics for pants?

thanks in advance.  ;D

keylocke

hmm, the images in the rimworld core textures are greyscale, so i started doing these in greyscale like this.



(i'm gonna pixel art this when i go final, but for testing, i think these will do until i learn how to mod this into the game itself)

anyways, i just remembered shinzy's cool apparello mod having colored textures instead of just greyscale.

-is that applicable to pawn bodies?
-how do i do that? which tag should i change in which def?

Fluffy (l2032)

Even though your concepts look awesome, I would strongly advise against going down this rabbit hole.

Pawn graphics are largely hardcoded, and not at all easy to mod. This would be a C# project, and a relatively difficult one at that. Also, keep in mind that if your pawns have different dimensions, you'd basically need to redraw all apparel to match, or it would look out of place. Apparel isn't automatically 'morphed' to body sizes, there's actually 3 (body types) * 3 (facings) versions of every single apparel. In addition, the game doesn't (need to) render lower body apparel, as these are normally not visible. Your pawns would need to do this, so again there's a ton of extra graphics to do, and custom code to write.

Shinzy

Don't be such a killjoy robert!
I want to see this man descend into madness!

all the apparel work would be mostly easy to do. There's just lot of it
and can't you just have the game use these graphics instead of the vanilla ones
by simply making new folder in the same path/filename the game seeks the textures from?
I recall Jabbamonkey doing that
just got to remember heads and bodies are added separately
aaand you'd need fifth body type (The hulk)

And pawn bodies have to be grayscale unlike apparel cause like robert said their graphics are largely hardcoded, whereas with the apparel you can choose in the xml's if they use the colouring comps or not


keylocke

thanks for the info guys.

Quoteand can't you just have the game use these graphics instead of the vanilla ones
by simply making new folder in the same path/filename the game seeks the textures from?

yea i was wondering that. but i don't know the filepath for the hair, head, and body textures. what def has those filepath info? i checked pawnkind def and couldn't find it.  :-\

Quoteaaand you'd need fifth body type (The hulk)

what hulk? is that a name for a mod i can use for reference?

skullywag

theres another body size, normal, thin, fat, female and Hulk I believe.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Shinzy

#6
The official texture pack  (which is outdated) has all the textures arranged correctly (unless theyve changed) in the folders
Edit: should be able to see the paths directly from whatever code handles it aswell

Youll find all the original bodytypes and their names in there

Think its something like things/pawns/human/bodies or something like that

Hairs have their own xmls in thingdefs/hair

skullywag

it used to be:

Mods/Core/Textures/Things/Pawn/humanoid, i.e:

Mods/Core/Textures/Things/Pawn/Humanoid/Heads/Male/Male_Average_Normal_front.png

I think that now should be humanlike...i think...ill check properly in a sec.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

keylocke


skullywag

#9

private const string NakedBodyTextureFolderPath = "Things/Pawn/Humanlike/Bodies/";

public static Graphic GetNakedBodyGraphic(BodyType bodyType, Shader shader, Color skinColor)
{
if (bodyType == BodyType.Undefined)
{
Log.Error("Getting naked body graphic with undefined body type.");
bodyType = BodyType.Male;
}
string str = "Naked_" + bodyType.ToString();
string path = "Things/Pawn/Humanlike/Bodies/" + str;
return GraphicDatabase.Get<Graphic_Multi>(path, shader, Vector2.one, skinColor);
}


this.dessicatedGraphic = GraphicDatabase.Get<Graphic_Multi>("Things/Pawn/Humanlike/HumanoidDessicated", ShaderDatabase.Cutout);

private static readonly string[] HeadsFolderPaths = new string[]
{
"Things/Pawn/Humanlike/Heads/Male",
"Things/Pawn/Humanlike/Heads/Female"
};

private static readonly string SkullPath = "Things/Pawn/Humanlike/Heads/None_Average_Skull";


edit - there that should be all you need
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Fluffy (l2032)

quick note; you can't normally add head graphics - the game only looks in the vanilla resources. I made a mini mod a while back that changes this, it's part of MVP.
I'm not sure about body graphics, but there might be similar problems there.

keylocke

it works.



right now i'm still experimenting with the head sizes. but yep. progress is moving smoothly.

thanks a lot skully!  ;D

keylocke

a bit more progress. (decided to maintain headsize)



anyways, i was planning to make different types of power armor, each gives different types of combat stat boost.

ie : power armor that boosts  :
-melee (improves melee combat)
-sight (improves ranged combat)
-movement (speed boost)

is this possible? which defs should i modify for this, and what tags should i use?

Shinzy

Quote from: keylocke on March 16, 2016, 06:57:03 PM
anyways, i was planning to make different types of power armor, each gives different types of combat stat boost.

ie : power armor that boosts  :
-melee (improves melee combat)
-sight (improves ranged combat)
-movement (speed boost)

is this possible? which defs should i modify for this, and what tags should i use?

I'd keep that as a separate project =P
anyway!
look from thingdefs/apparel_various and apparel_hats

apparel various has the power armor def
and apparel hats have some examples of how to plop stat bonuses on things
(like how cowboy hat gives social boost)

all the stats you can plop on apparel can be found in StatDefs

keylocke

thanks shinzy! also, yea. i think you're right. i should separate the additional power armors. i could probably just focus on the graphics pack.



right now i came into a bit of a snag. i based the arm positions based on the rifle's positions.
but it turns out that other weapons (especially melee and pistols) have varying positions.

so i'm currently in the process or readjusting the hands of the front and side bodies. (almost done now actually) will start to reskin the core apparels next.