FOMOD 튜토리얼 을 보지않았다면  글을 보기전에 먼저 마스터 하고오길 바란다


0. FOMOD의 구조


. 모드 폴더 
├── Fomod 폴더 
│   ├── Info.xml 
│   ├── ModuleConfig.xml
│   └── 모드들의 이미지.png
├── 모드 A
│   └── 모드 A 데이터
├── 모드 B
│   └── 모드 B 데이터
├── 파란색 텍스처 A
│   └── 파란색 텍스처 A 데이터
├── 파란색 텍스처 B
│   └── 파란색 텍스처 B 데이터
├── 빨간색 텍스처 A
│   └── 빨간색 텍스처 A 데이터
── 빨간색 텍스처 B
    └── 빨간색 텍스처 B 데이터


만일 이거보고 머리가 아프다면 FOMOD Creation Tool  을 쓰러가는것을 권장한다

튜토리얼을 마스터 했으면 구조 정도는 만들줄 안다고 생각하고 시작하겠다


1. ModuleConfig


심화 과정이니 이번엔 좀 길다


<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">


    <moduleName>예제 모드</moduleName>


    <moduleDependencies operator="And">

        <fileDependency file="필수 선행 모드.esp" state="Active"/>

        <dependencies operator="Or">

            <fileDependency file="필수 선행 모드 A.esp" state="Active"/>

            <fileDependency file="필수 선행 모드 B.esp" state="Active"/>

        </dependencies>

    </moduleDependencies>


    <installSteps order="Explicit">

        <installStep name="옵션 선택">

            <optionalFileGroups order="Explicit">


                <group name="옵션을 선택하세요:" type="SelectExactlyOne">

                    <plugins order="Explicit">


                        <plugin name="옵션 A">

                            <description>옵션 A를 설치합니다!</description>

                            <image path="fomod/option_a.png"/>

                            <conditionFlags>

                                <flag name="option_a">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Recommended"/>

                            </typeDescriptor>

                        </plugin>


                        <plugin name="옵션 B">

                            <description>옵션 B를 설치합니다!</description>

                            <image path="fomod/option_b.png"/>

                            <conditionFlags>

                                <flag name="option_b">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Optional"/>

                            </typeDescriptor>

                        </plugin>


                    </plugins>

                </group>


                <group name="텍스쳐 선택:" type="SelectExactlyOne">

                    <plugins order="Explicit">


                        <plugin name="파란색 텍스쳐">

                            <description>파란색 텍스쳐를 설치합니다!</description>

                            <image path="fomod/texture_blue.png"/>

                            <conditionFlags>

                                <flag name="texture_blue">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Optional"/>

                            </typeDescriptor>

                        </plugin>


                        <plugin name="빨간색 텍스쳐">

                            <description>빨간색 텍스쳐를 설치합니다!</description>

                            <image path="fomod/texture_red.png"/>

                            <conditionFlags>

                                <flag name="texture_red">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Optional"/>

                            </typeDescriptor>

                        </plugin>


                    </plugins>

                </group>


            </optionalFileGroups>

        </installStep>

    </installSteps>


    <conditionalFileInstalls>

        <patterns>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_a" value="selected"/>

                    <flagDependency flag="texture_blue" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_a"/>

                    <folder source="texture_blue_a"/>

                </files>

            </pattern>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_a" value="selected"/>

                    <flagDependency flag="texture_red" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_a"/>

                    <folder source="texture_red_a"/>

                </files>

            </pattern>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_b" value="selected"/>

                    <flagDependency flag="texture_blue" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_b"/>

                    <folder source="texture_blue_b"/>

                </files>

            </pattern>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_b" value="selected"/>

                    <flagDependency flag="texture_red" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_b"/>

                    <folder source="texture_red_b"/>

                </files>

            </pattern>

        </patterns>

    </conditionalFileInstalls>


</config>


길어보여도 중복이 많아 금방끝난다

눈썰미 좋은 사람은 폴더 선택문이 아래로 빠진걸 확인 했을거임

심화는 조건문이기 때문


    <moduleDependencies operator="And">

        <fileDependency file="필수.esp" state="Active"/>

        <dependencies operator="Or">

            <fileDependency file="조건 A.esp" state="Active"/>

            <fileDependency file="조건 B.esp " state="Active"/>

        </dependencies>

    </moduleDependencies>


    <requiredInstallFiles>

        <file source="필수.파일"/>

    </requiredInstallFiles>


필수적으로 선행되야 할 모드나 옵션 모드쪽에서 선행되야 할 모드가 있으면 자동으로 감지하고 설정하는 부분이다

독립 모드면 굳이 건들 필요가 없다


moduleDependencies operator moduleName 바로 다음에 들어가며 모드 설치전 필수 모드가 설치되어 있는지 확인하는 옵션이다

보다시피 And와 Or이 있는데 

And 는 무조건 필수적으로 있어야하는 모드고 Or 는 밑에 해당 모드 중 하나만 있어도 충족하는 설정이다


dependencies operator 도 위와 같은데


state 에도 Active, Inactive 가 있는데

Active 는 활성된 플러그인

Inactive 는 비활성된 플러그인이다


moduleDependenciesdependencies  의 차이를 묻는다면 나도 모른다

그냥 뭘 먼저 확인하냐의 차이인거같음


    <moduleDependencies>

        <gameDependency version="1.0"/>

    </moduleDependencies>


gameDependencies에는 gameDependency version이라는 옵션이 하나 더 있는데 모드 버전 체크하는 옵션이다

근데 써본적이 없어서 잘되는지는 모름


    <installSteps order="Explicit">

        <installStep name="모드">

            <optionalFileGroups order="Explicit">


                <group name="모드를 선택하세요:" type="SelectExactlyOne">

                    <plugins order="Explicit">


                        <plugin name="모드">

                            <description>모드를 설치합니다!</description>

                            <image path="fomod/mod.png"/>

                            <files> 

                                <folder source="모드 폴더" destination="" priority="0" /> 

                            </files>


                            <typeDescriptor> 

                                <dependencyType> 

                                    <defaultType name="Optional"/> 

                                    <patterns> 

                                        <pattern> 

                                            <dependencies operator="Or"> 

                                                <fileDependency file="LegacyoftheDragonborn.esm" state="Active"/> 

                                                <fileDependency file="LegacyoftheDragonborn.esm" state="Inactive"/> 

                                            </dependencies> 

                                            <type name="Recommended"/> 

                                        </pattern> 

                                    </patterns> 

                                </dependencyType> 

                            </typeDescriptor>


                        </plugin>


                    </plugins>

                </group>


dependencies operator 는 위의 예제처럼 모드 중간에 들어가 해당 모드가 조건에 맞으면 설정에 따라 해당 슬롯을 활성, 비활성 해줄수 있다


type은 튜토리얼에서 설명해준바있으니 생략한다


위 처럼 해주면 모드 오거나이저 우측에 플러그인에서 체크 해제한 esp도 감지해서 버튼을 활성화 해준다


                        <plugin name="옵션 A">

                            <description>옵션 A를 설치합니다!</description>

                            <image path="fomod/option_a.png"/>

                            <conditionFlags>

                                <flag name="option_a">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Recommended"/>

                            </typeDescriptor>

                        </plugin>


자 심화 과정의 핵심인 Flag 다 이거 없었으면 위에 옵션은 튜토리얼에 넣고 끝냈음


conditionFlags 는 플래그를 선언해주는 부분이다

flag name 플래그 이름을 선언해주는 부분이다 이 부분이 제일 중요함 오타나면 설치가 안되기 때문

꼭 재확인 하길 바란다

중간의 저 값은 selected 하나뿐임


나머지는 왜 설명 안해주냐고? 튜토리얼 보고와라


                <group name="옵션을 선택하세요:" type="SelectExactlyOne">

                    <plugins order="Explicit">


                        <plugin name="옵션 A">

                            <description>옵션 A를 설치합니다!</description>

                            <image path="fomod/option_a.png"/>

                            <conditionFlags>

                                <flag name="option_a">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Recommended"/>

                            </typeDescriptor>

                        </plugin>


                        <plugin name="옵션 B">

                            <description>옵션 B를 설치합니다!</description>

                            <image path="fomod/option_b.png"/>

                            <conditionFlags>

                                <flag name="option_b">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Optional"/>

                            </typeDescriptor>

                        </plugin>


                    </plugins>

                </group>


                <group name="텍스쳐 선택:" type="SelectExactlyOne">

                    <plugins order="Explicit">


                        <plugin name="파란색 텍스쳐">

                            <description>파란색 텍스쳐를 설치합니다!</description>

                            <image path="fomod/texture_blue.png"/>

                            <conditionFlags>

                                <flag name="texture_blue">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Optional"/>

                            </typeDescriptor>

                        </plugin>


                        <plugin name="빨간색 텍스쳐">

                            <description>빨간색 텍스쳐를 설치합니다!</description>

                            <image path="fomod/texture_red.png"/>

                            <conditionFlags>

                                <flag name="texture_red">selected</flag>

                            </conditionFlags>

                            <typeDescriptor>

                                <type name="Optional"/>

                            </typeDescriptor>

                        </plugin>


                    </plugins>

                </group>


            </optionalFileGroups>

        </installStep>

    </installSteps>


    <conditionalFileInstalls>

        <patterns>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_a" value="selected"/>

                    <flagDependency flag="texture_blue" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_a"/>

                    <folder source="texture_blue_a"/>

                </files>

            </pattern>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_a" value="selected"/>

                    <flagDependency flag="texture_red" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_a"/>

                    <folder source="texture_red_a"/>

                </files>

            </pattern>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_b" value="selected"/>

                    <flagDependency flag="texture_blue" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_b"/>

                    <folder source="texture_blue_b"/>

                </files>

            </pattern>

            <pattern>

                <dependencies operator="And">

                    <flagDependency flag="option_b" value="selected"/>

                    <flagDependency flag="texture_red" value="selected"/>

                </dependencies>

                <files>

                    <folder source="option_b"/>

                    <folder source="texture_red_b"/>

                </files>

            </pattern>

        </patterns>

    </conditionalFileInstalls>


어떻게 작동하는지 보기 쉽게 길게 가져온거니 conditionalFileInstalls 부터 보면 된다


conditionalFileInstalls 은 설치될 파일의 조건을 체크하는 부분이다

이 코드를 사용해서 pattern의 행열(matrix)을 구성 할수있다


patterns 과 pattern 은 각각 group과 plugin의 관계와 같다


flagDependency flag 는 위에서 했던 플래그 이름을 선언했던 부분을 여기서 써먹으면 된다

복붙아니면 자동 완성 기능을 쓰길 바란다 오타나면 찾기 귀찮은 부분 중 하나다


항상 만들어야 할 conditionalFileInstalls 에서의 pattern 항목은

aₙ = 2ⁿ (여기서 n 은 선택 가능한 옵션의 갯수) 이다


이렇게 심화 과정도 끝났다

하지만 보통은 이런식으로 FOMOD를 구성하진 않으니 이런 방식도 있구나 하고 알아보기만 하면 된다


어려워보인다고? 길고 중복문이 많아서 그렇지 어렵진 않다

다만 헷갈리거나 오타나면 곤란한 부분이 많으니 툴 쓰는것을 추천한다


툴이 있어서 안쓰려했는데 자꾸 생각나서 씀