- 好友
- 1
- 在线时间
- 0 小时
- 最后登录
- 2026-2-1
随仆

- UID
- 3840361
- 第纳尔
- 0
- 精华
- 0
- 互助
- 0
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 0
- 注册时间
- 2026-1-13
 鲜花( 0)  鸡蛋( 0)
|
本帖最后由 gsanders 于 2026-1-27 10:28 编辑
Assuming you have source code and are compiling your own mod instead of trying to edit .txt directly,
1) edit the file module_skins.py to add a new skin.
module_skins has two sections for you to worry about:
face_keys which influence the slider values when adjusting the face
skins here are where your new colored faces go
find skins = [
(
and copy everything until ), from the first skin definition.
paste that before the final
),
]
and now rename that new skin instead of "man" to something you can remember to use later, like "greenie" or something new.
2) Next, edit header_troops.py
find where it has
tf_male = 0
tf_female = 1
you want to add a new skin_ID here like
tf_greenie = 2
these are the skin IDs that module_troops.py will be using
For that matter, notice that by default native mod assumes any skin not "0" (male human) must be female in dialogs, as that will be something to address at dialogs. You will also need to adjust some scripts that test gender if your mod uses Diplomacy, but that comes later.
3) now edit module_troops.py
find the one troop you want to have green skin, so that all the troops that you wanted to leave as normal are not changed.
at that line you break out the skin definition:
["troop name as coding sees it", "name as player sees it", "name for plural more than 1 of these", Troop Skin plus all modifiers for gear guarantee, scene or reserved, faction_ID, [items], defined attributes, weapon profienciencies, knows_ as defined at the start of module_troops, face_1, face_2],
The face_1 and face_2 are slider positions so for the moment you can leave those as they were and only edit the skins file to use the newly renamed faces you created. If you started with the normal "manface_young", "manface_midage", and so on then the green retextured faces should have a new name like "greenie_young", "greenie_midage" and so on. You save your edited face from openbrf or whatever you used to recolor the face as a new file name and that is the name you will use at module_skins to find and use that new face not the old one.
But if there was no skin_ID like tf_male then some lazy modders leave it out since it was 0, so long as they had any other modifiers like tf_guarantee_armor for that place. Remember these were defined at header_troops.py
What you want to do is add or replace the troop skin_ID here:
if it had ["mod name","name players call it","plural name", tf_guarantee_armor, no_scene,
you would change to ["mod name","name players call it", "plural name", tf_greenie|tf_guarantee_armor, no_scene,
if it had a tf_ value that is a named skin at header_troops.py such as tf_male then you change the tf_male to be tf_greenie in this case and any other modifiers get concatenated by the | symbol.
--
4) Compile your mod once to check for errors in module_skins.py and module_troops.py and when that is no longer making red errors it is time to update how gender is detected.
at module_scripts.py
here if you had merged diplomacy you have to edit these scripts:
script_cf_dplmc_troop_is_female
script_dplmc_store_troop_is_female
script_dplmc_store_troop_is_female_reg
script_dplmc_store_is_female_troop_1_troop_2
to now have a definition for tf_greenie as well as tf_male and tf_female
otherwise every dialog line assumes tf_greenie is female, as it is a non-0 value.
Thank native for this.
It gets slightly better than that:
all the dialogs that assume gender need editing too, probably around 6,000 lines of 40,000 at module_dialogs.py
but maybe first lets get your green faces working.
Also, Warband limits skins to 16 (0 through 15 == 16) and while you can sort-of kludge more with WSE2 make sure you can get your first 16 skins defined and working before trying to get clever with workarounds in WSE2.
If you wanted a simple edit to .txt files forget it, you have to make changes in many places not just one line.
I used this method in every mod I made from Perisno 0.772 through my current Paradigm Chronomancer.
There is no simpler method.
|
|