Jump to content

Can I Use Flag Values In a Calculation for Dependencies?


DeJuanNOnley

Recommended Posts

I hope I'm phrasing this right. I've made many FOMOD installers before, but never one this complex. Here's the situation. I have 4 install steps. Each step sets a flag with an integer value based on the option the user chooses. Let's call these, x, y, z. The fourth step needs to warn the user if they pick an option that is incompatible with the previous ones. Let's call this 4th value a. I need to create a dependency that ensures the following evaluates as true and throw a warning if not:

 

x + y*4 - z > a

 

Essentially, I want to do something like this:

<conditionFlags>
    <flag name="a">100</flag>
</conditionFlags>
<typeDescriptor>
    <dependencyType>
        <defaultType name="Optional"/>
        <patterns>
            <pattern>
                x.value + y.value * 4 - z.value <= 100    <-- THIS IS WHAT I DON'T KNOW HOW TO DO -->
                <type name="NotUsable"/>
            </pattern>

Obviously I can create multiple embedded dependencies that check for every possible value (and that's what I've done for now), but this adds around 1,500 lines to my ModuleConfig.xml. Here's what I'm doing for now and it works. But please tell me there is a better way.

<conditionFlags>
    <flag name="a">100</flag>
</conditionFlags>
<typeDescriptor>
    <dependencyType>
        <defaultType name="Optional"/>
        <patterns>
            <pattern>
                <dependencies operator="And">
                    <flagDependency flag="x" value="125"/>
                    <dependencies operator="And">
                        <flagDependency flag="z" value="100"/>
                        <dependencies operator="Or">
                            <flagDependency flag="y" value="0"/>
                            <flagDependency flag="y" value="5"/>
                            <flagDependency flag="y" value="10"/>
                            <flagDependency flag="y" value="15"/>
                        </dependencies>
                    </dependencies>
                </dependencies>
                <type name="NotUsable"/>
            </pattern>
            <pattern>
                <dependencies operator="And">
                    <flagDependency flag="x" value="125"/>
                    <dependencies operator="And">
                        <flagDependency flag="z" value="75"/>
                        <dependencies operator="Or">
                            <flagDependency flag="y" value="0"/>
                            <flagDependency flag="y" value="5"/>
                            <flagDependency flag="y" value="10"/>
                        </dependencies>
                    </dependencies>
                </dependencies>
                <type name="NotUsable"/>
            </pattern>
...
Edited by DeJuanNOnley
Link to comment
Share on other sites

I hate to bump, but I'm down to like page 6-7 now. If this isn't possible, I understand. Just seems like something this simple should be doable. If there is a better place to find information on FOMOD XML schema, I don't know where it is anymore. If it helps, I am only interested in NMM compatibility. So if there is even some proprietary method of achieving what I want for NMM, I would consider that.

Edited by DeJuanNOnley
Link to comment
Share on other sites

  • Recently Browsing   0 members

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