• The forum has been updated. For an explanation of some of the changes, head over here.

PartyTemplates.xml - Nested OR operator

Currently viewing this thread:

FiftyTifty

Regular
Currently, there is no way to pick between multiple entries. Instead, you have a % chance to spawn a troop in a party, with no actual flow control. To add variety, we need an OR operator for the XML. For example:
Code:
<MBPartyTemplate id="sea_raiders_boss_party_template" >

    <stacks>

        <PartyTemplateStack min_value="1" max_value="2" troop="NPCCharacter.aaafyty_f_sea_raiders_raider" />

        <PartyTemplateStack min_value="1" max_value="2" troop="NPCCharacter.sea_raiders_raider" />

        <PartyTemplateStack min_value="1" max_value="1" troop="NPCCharacter.aaafyty_f_sea_raiders_chief" />

        <PartyTemplateStack min_value="1" max_value="1" troop="NPCCharacter.sea_raiders_chief" />

        <PartyTemplateStack_OR>
        
            <SpawnChance percent="50" troop="NPCCharacter.aaafyty_f_sea_raiders_boss" />
            
            <SpawnChance percent="50" troop="NPCCharacter.sea_raiders_boss" />
            
        </PartyTemplateStack_OR>

    </stacks>

</MBPartyTemplate>

Without this, we simply have no way of adding diversity to existing parties without causing bugs. If you have min_value at 0, max_value at 1, and two entries, there's a 25% chance neither will spawn, and another 25% chance that both will spawn. We have no way of selecting only one of the two to spawn. This is bad, and needs to be remedied.
 
Top Bottom