[Solved] Trying to change hair color midgame

Started by simonster99, September 30, 2021, 02:10:19 PM

Previous topic - Next topic

simonster99

Hello!

I'm currently trying to change the hair color of a pawn midgame. The piece of code I have currently that is supposed to change the hair color is this.

P1.story.hairColor = Color.green;

The problem is that when I trigger the code nothing happens, but when I quit to menu and reload the game, the hair changes to the intended color.

Any tips on how I could make the hair change color as soon as the code is triggered?

simonster99


Incase anyone is looking for the answer in the future, here's how I managed to solve this:

Pawn.Drawer.renderer.graphics.ResolveAllGraphics();

I guess this reloads the graphics of the pawn somehow, making any changes to the hair color appear right away. Probably not the best solution, but it works for me

JT

Nope, that actually is the best/only solution.  RimWorld 1.3+ caches the pawn graphics, unless you're using a mod like Graphics Settings, HD Pawn Renderer, etc.