Jump to content

XML & FOMOD Installers


Rapscallion

Recommended Posts

OK I have gotten my FOMOD to about 90% completion. It is doing ALMOST everything I am asking of it. The last thing I need to figure out is:

 

If I have 2 groups of options in an install page, and I want to install a file that is dependent on those two choices, how do I do that?

 

Take a look at this sample code:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
<moduleName>Sample Module</moduleName>
<installSteps order="Explicit">
	<installStep name="Sample Step">
		<optionalFileGroups order="Explicit">
			<group name="Sample Group 1" type="SelectAtMostOne">
				<plugins>
					<plugin name="Sample Option A">
					<description>
						<![CDATA[Option "A" for the Mod]]>
					</description>
					<image path="fomod/images/option-a.png"/>
					<files>
						<folder source="option-a\textures" destination="textures"/>
					</files>
					<typeDescriptor>
						<type name="Optional"/>
					</typeDescriptor>
					</plugin>

					<plugin name="Sample Option B">
					<description>
						<![CDATA[Option "B" for the Mod]]>
					</description>
					<image path="fomod/images/option-b.png"/>
					<files>
						<folder source="option-b\textures" destination="textures"/>
					</files>
					<typeDescriptor>
						<type name="Optional"/>
					</typeDescriptor>
					</plugin>
				</plugins>
			</group>

			<group name="Sample Group 2" type="SelectAtMostOne">
				<plugins>
					<plugin name="Sample Option 1">
					<description>
						<![CDATA[Option "1" for the Mod]]>
					</description>
					<image path="fomod/images/option-1.png"/>
					<files>
						<folder source="option-1\textures" destination="textures"/>
					</files>
					<typeDescriptor>
						<type name="Optional"/>
					</typeDescriptor>
					</plugin>

					<plugin name="Sample Option 2">
					<description>
						<![CDATA[Option "2" for the Mod]]>
					</description>
					<image path="fomod/images/option-2.png"/>
					<files>
						<folder source="option-2\textures" destination="textures"/>
					</files>
					<typeDescriptor>
						<type name="Optional"/>
					</typeDescriptor>
					</plugin>
				</plugins>
			</group>
		</optionalFileGroups>
	</installStep>
</installSteps>
</config>

 

So in this Install Step, I have a pair of Options in group 1 (A & B) and a pair of options in Group 2 (1 & 2). Now lets say for arguments sake I have a custom mesh for each of those combinations (so one for Option A & Option 1, one for Option B & Option 1, one for Option A & Option 2, and one for Option B & Option 2). How do I tell the installer to recall those choices and apply the correct mesh? I assume you can set a flag in the first Options grouping then with each of the file copy commands in the second options grouping you can have it say "If flag = this install this mesh if flag = that install that mesh" or something to that effect. I just need to know how to do this in XML.

 

I am just using this as an example, my mod is all textures but wanted to help make my conundrum as clear as possible :) (plus I don't wanna give away what I am hatching here hehehe). Also having a group for each pairing would not work. In my mod the first group has 12 choices and the second group has 4.

Edited by Rapscallion
Link to comment
Share on other sites

For those who would like the solution to this here ya go:

 

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qconsulting.ca/fo3/ModConfig5.0.xsd">
       <moduleName>Sample Module</moduleName>
       <installSteps order="Explicit">
               <installStep name="Sample Step">
                       <optionalFileGroups order="Explicit">
                               <group name="Sample Group 1" type="SelectAtMostOne">
                                       <plugins>
                                               <plugin name="Sample Option A">
                                               <description>
                                                       <![CDATA[Option "A" for the Mod]]>
                                               </description>
                                               <image path="fomod/images/option-a.png"/>
                                               <files>
                                                       <folder source="option-a\textures" destination="textures"/>
                                               </files>
                                               <conditionFlags>
                                                       <flag name="group1">optiona</flag>
                                               </conditionFlags>
                                               <typeDescriptor>
                                                       <type name="Optional"/>
                                               </typeDescriptor>
                                               </plugin>

                                               <plugin name="Sample Option B">
                                               <description>
                                                       <![CDATA[Option "B" for the Mod]]>
                                               </description>
                                               <image path="fomod/images/option-b.png"/>
                                               <files>
                                                       <folder source="option-b\textures" destination="textures"/>
                                               </files>
                                               <conditionFlags>
                                                       <flag name="group1">optionb</flag>
                                               </conditionFlags>
                                               <typeDescriptor>
                                                       <type name="Optional"/>
                                               </typeDescriptor>
                                               </plugin>
                                       </plugins>
                               </group>

                               <group name="Sample Group 2" type="SelectAtMostOne">
                                       <plugins>
                                               <plugin name="Sample Option 1">
                                               <description>
                                                       <![CDATA[Option "1" for the Mod]]>
                                               </description>
                                               <image path="fomod/images/option-1.png"/>
                                               <files>
                                                       <folder source="option-1\textures" destination="textures"/>
                                               </files>
                                               <conditionFlags>
                                                       <flag name="group2">option1</flag>
                                               </conditionFlags>
                                               <typeDescriptor>
                                                       <type name="Optional"/>
                                               </typeDescriptor>
                                               </plugin>

                                               <plugin name="Sample Option 2">
                                               <description>
                                                       <![CDATA[Option "2" for the Mod]]>
                                               </description>
                                               <image path="fomod/images/option-2.png"/>
                                               <files>
                                                       <folder source="option-2\textures" destination="textures"/>
                                               </files>
                                               <conditionFlags>
                                                       <flag name="group2">option2</flag>
                                               </conditionFlags>
                                               <typeDescriptor>
                                                       <type name="Optional"/>
                                               </typeDescriptor>
                                               </plugin>
                                       </plugins>
                               </group>
                       </optionalFileGroups>
               </installStep>
       </installSteps>
       <conditionalFileInstalls>
	<patterns>
		<pattern>
			<dependencies>
				<flagDependency flag="group1" value="optiona"/>
				<flagDependency flag="group2" value="option1"/>
			</dependencies>
			<files>
				<file source="meshes\samplemesh_a1.NIF" destination="meshes\samplemesh.NIF"/>
			</files>
		</pattern>
		<pattern>
			<dependencies>
				<flagDependency flag="group1" value="optiona"/>
				<flagDependency flag="group2" value="option2"/>
			</dependencies>
			<files>
				<file source="meshes\samplemesh_a2.NIF" destination="meshes\samplemesh.NIF"/>
			</files>
		</pattern>
		<pattern>
			<dependencies>
				<flagDependency flag="group1" value="optionb"/>
				<flagDependency flag="group2" value="option1"/>
			</dependencies>
			<files>
				<file source="meshes\samplemesh_b1.NIF" destination="meshes\samplemesh.NIF"/>
			</files>
		</pattern>
		<pattern>
			<dependencies>
				<flagDependency flag="group1" value="optionb"/>
				<flagDependency flag="group2" value="option2"/>
			</dependencies>
			<files>
				<file source="meshes\samplemesh_b2.NIF" destination="meshes\samplemesh.NIF"/>
			</files>
		</pattern>
	</patterns>
      </conditionalFileInstalls>
</config>

 

Thank you Gribbleshnibit8!!!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...