Thinking Skeever

Skyrim/The Witcher 3 Modについてのあれこれ。FoModの作り方、Mod導入時のトラブル事例などのニッチな話を書いていきます。a.k.a. BowmoreLover@nexusmods

FOModの作り方(チュートリアル04)

フォロワーを追加するModを例にFOModを作ってみます。

  • 追加するフォロワーは2名で、フォロワー毎のesp2つとオールインワンのespがあるものとします。
  • オプションとして、フォロワーとお揃いの武器と防具が選べるものとします。

Modファイル FOModTutor04.zip の構成

FOModTutor04\
    00 Core Files\
        meshes\
            core-mesh.txt
        textures\
            core-texture.txt
    10 All in one\
        AllInOne-esp.txt
        meshes\
            AllInOne-mesh.txt
        textures\
            AllInOne-texture.txt
    10 Follower1\
        Follower1-esp.txt
        meshes\
            Follower1-mesh.txt
        textures\
            Follower1-texture.txt
    10 Follower2\
        Follower2-esp.txt
        meshes\
            Follower2-mesh.txt
        textures\
            Follower2-texture.txt
    20 Option - Weapon\
        Weapon-esp.txt
        meshes\
            Weapon-mesh.txt
        textures\
            Weapon-texture.txt
    21 Option - Armor\
        Armor-esp.txt
        meshes\
            Armor-mesh.txt
        textures\
            Armor-texture.txt
    FOMod\
        info.xml
        ModuleConfig.xml
        Images\
            Armor.jpg
            Follower1.jpg
            Follower2.jpg
            Intro.jpg
            Weapon.jpg

info.xmlの作成

<?xml version="1.0" encoding="UTF-16"?>
<fomod>
    <Name>FOMod Tutorial 04</Name>
    <Author>ThinkingSkeever</Author>
    <Version>0.0</Version>
    <Website>http://thinkingskeever.hatenablog.com/</Website>
    <Description>
    <p>This is FOMod Tutorial.</p>
    </Description>
</fomod>

ModuleConfig.xmlの作成

<?xml version="1.0" encoding="UTF-16"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
    <moduleName>FOMod Tutorial 04</moduleName>
    <installSteps order="Explicit">

        <!-- *** はじめにページ *** -->

        <installStep name="">
            <optionalFileGroups order="Explicit">
                <group name="ようこそ!" type="SelectExactlyOne">
                    <plugins order="Explicit">
                        <plugin name="ようこそ">
                            <description>
                                ダウンロードしてくれてありがとう。&#xD;
これはFOModのチュートリアルです。&#xD;
次のページでインストールオプションが選べます。
                            </description>
                            <image path="FOMod\Images\Intro.jpg"/>
                            <files>
                                <folder source="00 Core Files" destination="" priority="0"/>
                            </files>
                            <typeDescriptor>
                                <type name="Required"/>
                            </typeDescriptor>
                        </plugin>
                    </plugins>
                </group>
            </optionalFileGroups>
        </installStep>

        <!-- *** インストール種別の選択ページ *** -->

        <installStep name="">
            <optionalFileGroups order="Explicit">
                <group name="インストール種別" type="SelectExactlyOne">
                    <plugins order="Explicit">
                        <plugin name="オールインワン">
                            <description>
                                すべてのフォロワーが入ったESPをインストールします。
                            </description>
                            <image path=""/>
                            <files>
                                <folder source="10 All in One" destination="" priority="0"/>
                            </files>
                            <typeDescriptor>
                                <type name="Optional"/>
                            </typeDescriptor>
                        </plugin>
                        <plugin name="フォロワーを選択">
                            <description>
                                フォロワーを選んでインストールします。
                            </description>
                            <image path=""/>
                            <files>
                            </files>
                            <conditionFlags>
                                <flag name="SelectFlag">On</flag>
                            </conditionFlags>
                            <typeDescriptor>
                                <type name="Optional"/>
                            </typeDescriptor>
                        </plugin>
                    </plugins>
                </group>
            </optionalFileGroups>
        </installStep>

        <!-- *** フォロワー選択ページ *** -->

        <installStep name="">
            <visible operator="And">
                <flagDependency flag="SelectFlag" value="On"/>
            </visible>
            <optionalFileGroups order="Explicit">
                <group name="フォロワーを選択します" type="SelectAtLeastOne">
                    <plugins order="Explicit">
                        <plugin name="Follower1">
                            <description>
                                フォロワー1です。
                            </description>
                            <image path="FOMod\Images\Follower1.jpg"/>
                            <files>
                                <folder source="11 Follower1" destination="" priority="0"/>
                            </files>
                            <typeDescriptor>
                                <type name="Optional"/>
                            </typeDescriptor>
                        </plugin>
                        <plugin name="Follower2">
                            <description>
                                フォロワー2です。
                            </description>
                            <image path="FOMod\Images\Follower2.jpg"/>
                            <files>
                                <folder source="12 Follower2" destination="" priority="0"/>
                            </files>
                            <typeDescriptor>
                                <type name="Optional"/>
                            </typeDescriptor>
                        </plugin>
                    </plugins>
                </group>
            </optionalFileGroups>
        </installStep>

        <!-- *** オプション選択ページ *** -->

        <installStep name="">
            <optionalFileGroups order="Explicit">
                <group name="オプションファイル" type="SelectAny">
                    <plugins order="Explicit">
                        <plugin name="武器の追加">
                            <description>
                                フォロワーとお揃いの武器を追加します。
                            </description>
                            <image path="FOMod\Images\Weapon.jpg"/>
                            <files>
                                <folder source="20 Option - Weapon" destination="" priority="0"/>
                            </files>
                            <typeDescriptor>
                                <type name="Optional"/>
                            </typeDescriptor>
                        </plugin>
                        <plugin name="防具の追加">
                            <description>
                                フォロワーとお揃いの防具を追加します。
                            </description>
                            <image path="FOMod\Images\Armor.jpg"/>
                            <files>
                                <folder source="21 Option - Armor" destination="" priority="0"/>
                            </files>
                            <typeDescriptor>
                                <type name="Optional"/>
                            </typeDescriptor>
                        </plugin>
                    </plugins>
                </group>
            </optionalFileGroups>
        </installStep>

        <!-- *** 最終確認ページ *** -->

        <installStep name="">
            <optionalFileGroups order="Explicit">
                <group name="インストールの開始" type="SelectExactlyOne">
                    <plugins order="Explicit">
                        <plugin name="インストールの開始">
                            <description>
                                インストールオプションの選択が完了しました。&#xD;
インストールを開始します。
                            </description>
                            <image path=""/>
                            <files>
                            </files>
                            <typeDescriptor>
                                <type name="Required"/>
                            </typeDescriptor>
                        </plugin>
                    </plugins>
                </group>
            </optionalFileGroups>
        </installStep>

    </installSteps>
</config>

インストール方法

  • FOModTutor04フォルダごとZIPファイルなどに圧縮してMod管理ツールでインストールします。

動作確認のポイント

  • [次へ][前へ]ボタンを押してページが切り替わることを確認します。
  • "オールインワン"を選ぶとフォロワー選択ページがスキップされ、オプション選択ページに移動することを確認します。
  • "フォロワーを選択"を選ぶとフォロワー選択ページが表示されることを確認します。
  • インストールオプションを変えて、対応するダミーファイルがインストールされることを確認します。

f:id:thinkingskeever:20150429195525j:plain
f:id:thinkingskeever:20150429195528j:plain

解説

  • フォロワー選択ページでは"SelectAtLeastOne"を使って1名以上のフォロワーを選択させます。
  • オプション選択ページでは"SelectAny"を使って0個以上のアイテムを選択させます。
  • インストール種別ページで"フォロワーを選択"を選んだとき、ファイルをコピーするのではなく、<conditionFlags>、<flag>を使ってフラグ"SelectFlag"に"On"を設定します。
  • フォロワー選択ページでは、<visible>、<flagDependency>を使って、フラグ"SelectFlag"が"On"のときのみページを表示します。


以上

Copyright (C) 2015-2020 ThinkingSkeever, All Rights Reserved.
ブログの記事内に記載されているメーカー名、製品名称等は、日本及びその他の国における各企業の商標または登録商標です。
リンクはご自由に。記事の転載はご遠慮ください。記事を引用する場合はトラックバックするか元のURLを明記してください。