紋章追加方法 Warband版

無印wikiのバナー(紋章)追加方法をWarband用に書き換えたものです。
記事主はM&BのMOD作成とかの経験はないので、どこか間違っているかもしれません。
変更するファイルやNativeフォルダはバックアップを強く推奨します。





用意するもの

Module System(ソースコード)

導入するバージョンのNativeのものが必要になります。

https://www.taleworlds.com/en/Games/Warband/
の DOWNLOADS → Other Downloads の Module System をダウンロード。

MODの場合はそのソースコードをいじる必要がある(はず)です。

Module Systemはどこに置いても構いません。

Python

Pythonはオープンソースのプログラム言語です。参考→Wikipedia
Module Systemを変更してコンパイルする際に必要になります。
DL先

最新のバージョン3系だとエラーになるため、2系を入れて使う必要があります。
バージョン2.7.17なら大丈夫です。

インストール後、どのディレクトリからでもPythonを呼び出せるようにPathを設定します。
環境変数PATHの設定
上記Python 2.7.2をデフォルト設定でインストールした場合、指定するPathは「C:\Python27」となります。
(環境変数PATHを反映させるために再起動する必要があるかもしれません)

dds(画像ファイル)を編集するソフト

Paint.NETならddsのまま編集可能。
(他はまだ未テスト)

OpenBRF

brfファイルの作成に使用。
DL先

その他

pyを編集するテキストエディタ など

新しいバナー画像の作成

\Mountblade warband\Texturesフォルダにあるbanner_a~f.ddsの中から一つコピーし、Paint.NETで編集。
上の14個のうちどれかの紋章を好きなように変更してください。
適当な名前で別名保存。(ここではbanners_h.dds)
保存の際は DXT1・ミップマップの生成 を選択。

Module System内のpyファイルの編集

編集するpyファイルはmodule_map_icons.py、module_meshes.py、
module_scene_props.py、module_presentations.py、module_constants.pyの5つ。

module_map_icons.pyの編集

 ("banner_136",0,"map_flag_15", banner_scale,0),
の後に
 ("banner_137",0,"map_flag_h01", banner_scale,0),
 ("banner_138",0,"map_flag_h02", banner_scale,0),
 ("banner_139",0,"map_flag_h03", banner_scale,0),
 ("banner_140",0,"map_flag_h04", banner_scale,0),
 ("banner_141",0,"map_flag_h05", banner_scale,0),
 ("banner_142",0,"map_flag_h06", banner_scale,0),
 ("banner_143",0,"map_flag_h07", banner_scale,0),
 ("banner_144",0,"map_flag_h08", banner_scale,0),
 ("banner_145",0,"map_flag_h09", banner_scale,0),
 ("banner_146",0,"map_flag_h10", banner_scale,0),
 ("banner_147",0,"map_flag_h11", banner_scale,0),
 ("banner_148",0,"map_flag_h12", banner_scale,0),
 ("banner_149",0,"map_flag_h13", banner_scale,0),
 ("banner_150",0,"map_flag_h14", banner_scale,0),
 ("banner_151",0,"map_flag_h15", banner_scale,0),
 ("banner_152",0,"map_flag_h16", banner_scale,0),
 ("banner_153",0,"map_flag_h17", banner_scale,0),
 ("banner_154",0,"map_flag_h18", banner_scale,0),
 ("banner_155",0,"map_flag_h19", banner_scale,0),
 ("banner_156",0,"map_flag_h20", banner_scale,0),
 ("banner_157",0,"map_flag_h21", banner_scale,0),

module_meshes.pyの編集

 ("banner_f21", 0, "banner_a15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
の後に
 ("banner_h01", 0, "banner_h01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h02", 0, "banner_h02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h03", 0, "banner_h03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h04", 0, "banner_h04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h05", 0, "banner_h05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h06", 0, "banner_h06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h07", 0, "banner_h07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h08", 0, "banner_h08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h09", 0, "banner_h09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h10", 0, "banner_h10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h11", 0, "banner_h11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h12", 0, "banner_h12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h13", 0, "banner_h13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h14", 0, "banner_h14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h15", 0, "banner_h15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h16", 0, "banner_h16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h17", 0, "banner_h17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h18", 0, "banner_h18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h19", 0, "banner_h19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h20", 0, "banner_h20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("banner_h21", 0, "banner_h21", 0, 0, 0, -90, 0, 0, 1, 1, 1),

 ("arms_f21", 0, "banner_a15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
の後に
 ("arms_h01", 0, "banner_h01", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h02", 0, "banner_h02", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h03", 0, "banner_h03", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h04", 0, "banner_h04", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h05", 0, "banner_h05", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h06", 0, "banner_h06", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h07", 0, "banner_h07", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h08", 0, "banner_h08", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h09", 0, "banner_h09", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h10", 0, "banner_h10", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h11", 0, "banner_h11", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h12", 0, "banner_h12", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h13", 0, "banner_h13", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h14", 0, "banner_h14", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h15", 0, "banner_h15", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h16", 0, "banner_h16", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h17", 0, "banner_h17", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h18", 0, "banner_h18", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h19", 0, "banner_h19", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h20", 0, "banner_h20", 0, 0, 0, -90, 0, 0, 1, 1, 1),
 ("arms_h21", 0, "banner_h21", 0, 0, 0, -90, 0, 0, 1, 1, 1),

module_scene_props.pyの編集

 ("banner_f21", 0, "banner_a15", "0", []),
の後に
 ("banner_h01", 0, "banner_h01", "0", []),
 ("banner_h02", 0, "banner_h02", "0", []),
 ("banner_h03", 0, "banner_h03", "0", []),
 ("banner_h04", 0, "banner_h04", "0", []),
 ("banner_h05", 0, "banner_h05", "0", []),
 ("banner_h06", 0, "banner_h06", "0", []),
 ("banner_h07", 0, "banner_h07", "0", []),
 ("banner_h08", 0, "banner_h08", "0", []),
 ("banner_h09", 0, "banner_h09", "0", []),
 ("banner_h10", 0, "banner_h10", "0", []),
 ("banner_h11", 0, "banner_h11", "0", []),
 ("banner_h12", 0, "banner_h12", "0", []),
 ("banner_h13", 0, "banner_h13", "0", []),
 ("banner_h14", 0, "banner_h14", "0", []),
 ("banner_h15", 0, "banner_h15", "0", []),
 ("banner_h16", 0, "banner_h16", "0", []),
 ("banner_h17", 0, "banner_h17", "0", []),
 ("banner_h18", 0, "banner_h18", "0", []),
 ("banner_h19", 0, "banner_h19", "0", []),
 ("banner_h20", 0, "banner_h20", "0", []),
 ("banner_h21", 0, "banner_h21", "0", []),

module_presentations.pyの編集

(※ここの変更の反映は確認できてないが念のため)
   (ti_on_presentation_event_state_change, [
     (store_trigger_param_1, ":object"),
     (try_begin),
       (eq, ":object", "$g_presentation_obj_profile_banner_selection_1"),
       (val_add, "$g_presentation_page_no", 1),
       (val_mod, "$g_presentation_page_no", 8), ←の数字を10にする

     (ti_on_presentation_event_state_change,
      [(store_trigger_param_1, ":object"),
       (try_begin),
         (eq, ":object", "$g_presentation_obj_banner_selection_1"),
         (val_add, "$g_presentation_page_no", 1),
         (val_mod, "$g_presentation_page_no", 8), ←の数字を10にする
         (start_presentation, "prsnt_banner_selection"),

module_constants.pyの編集

 banner_meshes_begin = "mesh_banner_a01"
 banner_meshes_end_minus_one = "mesh_banner_f21" ←"mesh_banner_h21"に変える

 arms_meshes_begin = "mesh_arms_a01"
 arms_meshes_end_minus_one = "mesh_arms_f21" ←"mesh_arms_h21"に変える

 banner_map_icons_begin = "icon_banner_01"
 banner_map_icons_end_minus_one = "icon_banner_136" ←"icon_banner_157"に変える

 banner_scene_props_begin = "spr_banner_a"
 banner_scene_props_end_minus_one = "spr_banner_f21" ←"spr_banner_h21"に変える

(※ここの変更の反映は確認できてないが念のため)
 banners_end_offset = 136 ←157に変える

コンパイル

\Mountblade warband\Modules\ のNativeフォルダをコピーして
好きな名前(「newmod」など)を付けます。半角英数字が無難です。
Module Systemの中のmodule_info.pyを開いて出力するパスを設定します。
パスの設定する際に、スラッシュ</>を使いバックスラッシュ<\>を使わないこと。
例えばnewmodならば、↓のように記述します。
(Warbandフォルダのパス)/Modules/newmod/

次にModule Systemフォルダの中のbuild_module.batをダブルクリックするとコンパイルが始まります。
このように表示されれば成功です。
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

OpenBRFでBRFファイルを作成する

OpenBRFを起動し、New(新規作成) → Import → Anything from a BRF で
\Mountblade warband\CommonRes の banners.brf と map_flag_c.brf をそれぞれImport。
banner_f01~banner_f21、map_flag_f01~map_flag_f21 以外を削除。
Rename(F2)でそれぞれ banner_h01~banner_h21、map_flag_h01~map_flag_h21 に変更し、
全部選択してMaterialを共通の名前(banners_hmなど)にします。

Import→New Material でさっきのbanners_hmの名前のをOKで作成し、(チェック不要)
用意したバナー用の画像名(.ddsを省く)をDiffuseAに記入。(banners_h等)
Import→New Texture でバナー用の画像名のを入れてOKで作成。

後は\Mountblade warband\ModulesのNative(か該当MOD)のResourceフォルダにBRFファイルを保存し、
\Mountblade warband\ModulesのNative(か該当MOD)のTexturesフォルダにバナーの画像を置いて、
Native(か該当MOD)フォルダのmodule.iniの最後にload_mod_resource = BRFの名前(.brfを省く)(つまりbanners_h等) を記入すれば完了です。

M&B内での反映を確かめる

module_info.pyで指定したModule(newmodなど)を選択して起動。
ニューゲームで没落した貴族を選択するなどして、
紋章選択の最後の方のページでちゃんと変更されたかどうかを確認。
戦闘マップ内での紋章つき盾や、ワールドマップでの旗にも反映されているかも確認。

一度この作業をすれば、後はddsファイルを編集するだけでいつでも新しいバナーに変える事が出来ます。

中立の紋章

インストールフォルダの Textures や TexturesHD のフォルダにある banners_default.dds は、
貴族以外の勢力の紋章のようです。
例えば左から2番目は、(没落した貴族以外の)スタート時のプレイヤーの紋章になります。

その他

現状のやり方だとh15~21の7つの紋章が表示されないので、
追加したい紋章はh1~h14の場所にして下さい。

プレイ中のNativeのデータに反映させるには、Native のフォルダを直接いじるしかないようです。

  • コメントテスト -- 名無しさん (2012-01-17 22:54:43)
  • pre~じゃないなら>banners_end_offsetかな8増やすとか -- 名無しさん (2012-01-17 23:07:17)
  • その値も136,157を試してみたんですが、違いは見られませんでした。というかmodule_constants.pyの":cur_banner_mesh"の紋章表示処理らしきforループやbanner_meshes_end_minus_oneを見る限り、ちゃんと表示されそうには見えるんですけどね。 -- 名無しさん (2012-01-17 23:24:39)
  • Profileの方弄ってたわ・・・(val_sub, ":try_end", ":num_npc_kingdoms"), ←分引かれてるっぽい?banner_g群はこの為かな -- 名無しさん (2012-01-18 01:18:57)
  • その行をコメントアウトして11Pまでにすれば、h15以降もちゃんと表示されましたね。ただ確かに勢力の紋章は選べなくした方がいい気がするので、できれば選択画面から中抜きする処理を入れたいところです。 -- 名無しさん (2012-01-18 22:02:01)
  • meshとscene_propはg群の前に入れるとか -- 名無しさん (2012-01-18 23:08:00)
  • Module System内のpyファイルの編集がわからないのですが、Module Systemはどこにあるのでしょうか?modのなかにはpyファイルがありましたがNativeはどこにあるのでしょうか? -- 名無し (2015-12-08 17:16:49)
名前:
コメント:

タグ:

+ タグ編集
  • タグ:
最終更新:2020年03月11日 15:13