骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买霸主CDKEY 购买战帆CDKEY
查看: 2565|回复: 1

[求助] 怎么增加新种族

[复制链接]

2

主题

19

回帖

6

积分

平民

Rank: 1

UID
856955
第纳尔
78
精华
0
互助
0
荣誉
0
贡献
0
魅力
0
注册时间
2012-6-24
鲜花(0) 鸡蛋(0)
发表于 2025-12-5 13:02:17 | 显示全部楼层 |阅读模式
我自己制作了一个mod,现在可以增加绿色的皮肤,但是第一精灵的尖耳朵无法实现,第二无法独立调节头部大小,这个跟身高绑定在一起了,第三,为了制作一个精灵族,在skins里直接在人类模版里增加绿色的皮肤,可以实现,然后身高也能调节,但是改完之后好像会用到所有NPC上,所以打算新增一个精灵种族,在skins,但是增加游戏就会崩溃不知道怎么弄

1

主题

31

回帖

10

积分

随仆

Rank: 1

UID
3840361
第纳尔
0
精华
0
互助
0
荣誉
0
贡献
0
魅力
0
注册时间
2026-1-13
鲜花(0) 鸡蛋(0)
发表于 5 天前 | 显示全部楼层
本帖最后由 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.


您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2026-2-1 22:47 , Processed in 0.067057 second(s), 19 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表