PIGEON’s Texture Finder
查看中文版 [tieba.baidu.com]
Localized this mod and bak your config.xml is appreciated , bcoz i will update config.xml in need and it will cover your config.xml you had modified.
This mod is coding to fix the problems of Rimworld can’t find apparel texture path when alien wearing cloth.
For user , u can use this mod simply to slove the "texutre not found " problem when lift alien stress restrictions.
For modder , u can make one texture and apply it to all alien by useing this mod , which will reduce ur duplication of work, and save time to make mod about Apparel .
As this mod’s default setting, you can let ur Dragonian wear ratkin’s / rakkle ‘s / moyo ‘s and etc ‘s clothes without PINK BOX ( The premise is that your alien can wear it , here is a patch ) , other’s alien is the same. (even kurin’s cloth , but now i don’t have time to make it, and there are some problems when translates HAR to GAR /GAR to HAR. )
This is a mod help you config your setting, reduce the probability of pink box that unnecessary to appear , but no a final way to solve pink box.
u can browse English version below .
Texture’s path loading in your game generated by rule : textureName + postfix + direction .png
For "direction" , 3 value def : "_north" , "_south " and "_east" ( while "west" can imaged by "east" )
For "postfix" , it can be "_Female" and "_Male" as default , but also can be def by Mod’s developer ,which can found in thier race.xml or code , in bodyTypes node.
So why pink box appear? it’s maybe u order a incompatible bodyType (such as B) pawn dress different clothes in different bodyType (such as A). And rimworld will resolve itself’s bodyType as postfix , a error path and lead to pink box. (For this example , the true path should be "clothesName_A.png" while our game resolve it as "clothesName_B.png" ).
And my litte code is to help our parser redirect the route to true path.
It’s designed to make multiple associated path to the right path .
First, it will resolve "AppendGobal" and "ExcludeFoldersGobal" nodes from config.xml (It is a global variable ) as user setting .
Then it will read all the mods you define (through the "packageId" in config.xml) and exclude the folders you dont want them to read (defined in "ExcludeFoldersGobal" and "ExcludeFolders". by using them, u can save time when loading ur game).
Next, it will read all the textures under the mod file (by packageId) and associate its path to the path (specified in the AppendGobal variable. and this step works in memory, so no extra files appear).
I’ve configured DragonianRaceRatkinRaceModRakkleAncientSpecies in config.xml, so u can run it directly and let ur girls wear others race’s cloth (Once you lifts their clothing restrictions by patch, and you can’t see pink box from apparel anymore).
For config.xml ( you can find config.xml at this mod path such as "..steam..RimWorldMods2223312012configconfig.xml" ( in this mod’s config folder) ), u can make it as fllow:
–AppendGobal : Defines the node that complements the postfix to ur game. this node will resoulve the "<li></li>" nodes under him and make it as a postfix list.
As a texture called "Cloth_east.png" , your game may get red error when wearing by Dragonian bcoz it can’t find a texture name "Cloth_Female_east.png" (which def by Dragonian ), the way you can do is def my config , setting->AppendGobal,and add <li>Female</li>, it will solve the problems. (And for rakkle, u should add one node: <li>RakkleF</li> , which you can see at their mod’s def, from <alienbodytypes></alienbodytypes> in **race.xml that def the race )
–ExcludeFoldersGobal : Remind the program don’t look texture from /mod/ExcludeFoldersGobal’s def , it is a global variable. for example , u can add a node <li>Weapon</li>, and this mod will skip to associated the texture (which in Weapon folder ) under all the mod (def in packageIds) in order to save loading time.
–packages: the collection of which mods you want me to find.
—-package: composition of order to find a mod .
—-packageId: which mod can be find and associate.
—-excludeFolders: which folder in packageId should be skip by program.(this is a local variable, work under one package, can easily help program scan some folder that no common like weapon, bodies, etc. )
If your Alien can’t find texture named A (from the folder / texture / apparel / cloth / at B mod), and the < alienBodyTypes > is def as C, you can define the following config.xml:
<AppendGobal>
<li>C</li>
</AppendGobal>
<ExcludeFoldersGobal>
<!– can be skip ->
</ExcludeFoldersGobal>
<packages>
<package>
<packageId>
B’s packageId
</packageId>
<excludeFolders>
<!– here can be skip ->
</excludeFolders>
</package>
</packages>
A config for GloomyLynx’s Dragonian Race can be config as :
<package>
<packageId>
GloomyLynx.DragonianRace
</packageId>
<excludeFolders>
<li>Body</li>
<li>Hair</li>
<li>Head</li>
<li>Things</li>
<li>Weapon</li>
</excludeFolders>
</package>
It will exclude "BodyHairHeadThingsWeapon" folders and scan other folders under Dragonian’s mod and generated paths (maybe some paths are redundant but i think it have a small part impact.) when starting your program.
load this mod after all the apparel mod.
It should not be incompatible
can add in saved-game.
alien should wear clothes as she want .
Compared to copying texture to a folder , which not only caused some problems like permission etc, this mod make it possible to reduce hard disk memory caused by texture problems ( Although it’s only 30MB or less ), by only redirect its path to be correct. ( and it still has a lot of room for optimization) .
works both 1.1 and 1.2 well
u can download it at github [github.com] .
Source included.