Page 1 of 1

xml question

PostPosted: Wed Jan 06, 2010 8:46 pm
by captainwalrus
Is there an easy way to make it so that:

Given 5 territories A-E, where if A is held and either B, C or D is held a bonus is received (we will say it is worth one troop for this example), but if you hold A and both B and C or B and D or any combination of the 3 territories doesn't get any extra, so that holding A and B would get you +1 and holding A and C would get you +1, But holding A and B and C would just get you +1?

Now, if that is possible it is possible to make it so that if you hold territory E then you can get +1 for each, so that A and B and C would be +2 and A plus B and C and D would be +3?

Re: xml question

PostPosted: Thu Jan 07, 2010 5:59 am
by yeti_c
captainwalrus wrote:Is there an easy way to make it so that:

Given 5 territories A-E, where if A is held and either B, C or D is held a bonus is received (we will say it is worth one troop for this example), but if you hold A and both B and C or B and D or any combination of the 3 territories doesn't get any extra, so that holding A and B would get you +1 and holding A and C would get you +1, But holding A and B and C would just get you +1?


Yes

Something like this...

Code: Select all

<continent>
  <name>BCD1</name>
  <bonus>0</bonus>
  <components>
    <territory>B</territory>
    <territory>C</territory>
    <territory>D</territory>
  </components>
  <required>1</required>
</continent>

<continent>
  <name>A plus BCD1</name>
  <bonus>1</bonus>
  <components>
    <continent>BCD1</continent>
    <territory>A</territory>
  </components>
  <overrides>
    <override>BCD1</override>
  </overrides>
</continent>


captainwalrus wrote:Now, if that is possible it is possible to make it so that if you hold territory E then you can get +1 for each, so that A and B and C would be +2 and A plus B and C and D would be +3?


Yes...

Code: Select all

<continent>
  <name>BCD1</name>
  <bonus>0</bonus>
  <components>
    <territory>B</territory>
    <territory>C</territory>
    <territory>D</territory>
  </components>
  <required>1</required>
</continent>

<continent>
  <name>BCD2</name>
  <bonus>0</bonus>
  <components>
    <territory>B</territory>
    <territory>C</territory>
    <territory>D</territory>
  </components>
  <required>2</required>
</continent>

<continent>
  <name>BCD</name>
  <bonus>0</bonus>
  <components>
    <territory>B</territory>
    <territory>C</territory>
    <territory>D</territory>
  </components>
</continent>

<continent>
  <name>A plus BCD1</name>
  <bonus>1</bonus>
  <components>
    <continent>BCD1</continent>
    <territory>A</territory>
  </components>
  <overrides>
    <override>BCD1</override>
    <override>BCD2</override>
    <override>BCD</override>
  </overrides>
</continent>

<continent>
  <name>E plus A plus BCD2</name>
  <bonus>2</bonus>
  <components>
    <continent>BCD2</continent>
    <territory>A</territory>
    <territory>E</territory>
  </components>
  <overrides>
    <override>A plus BCD1</override>
  </overrides>
</continent>

<continent>
  <name>E plus A plus BCD</name>
  <bonus>3</bonus>
  <components>
    <continent>BCD</continent>
    <territory>A</territory>
    <territory>E</territory>
  </components>
  <overrides>
    <override>E plus A plus BCD2</override>
  </overrides>
</continent>


C.

Re: xml question

PostPosted: Thu Jan 07, 2010 6:19 am
by natty dread
Why not leave that BCD continent out and just make the last bonus like this:

Code: Select all
<continent>
  <name>ABCDE</name>
  <bonus>3</bonus>
  <components>
    <territory>A</territory>
    <territory>B</territory>
    <territory>C</territory>
    <territory>D</territory> 
    <territory>E</territory>
  </components>
  <overrides>
    <override>E plus A plus BCD2</override>
  </overrides>
</continent>



Would seem more logical to me.

Re: xml question

PostPosted: Thu Jan 07, 2010 6:40 am
by yeti_c
natty_dread wrote:Why not leave that BCD continent out and just make the last bonus like this:

Code: Select all
<continent>
  <name>ABCDE</name>
  <bonus>3</bonus>
  <components>
    <territory>A</territory>
    <territory>B</territory>
    <territory>C</territory>
    <territory>D</territory> 
    <territory>E</territory>
  </components>
  <overrides>
    <override>E plus A plus BCD2</override>
  </overrides>
</continent>



Would seem more logical to me.


Yes that would work as well... - I guess it depends on whether anything else is to be built on top!!
(Note that you would also have to remove the BCD override in A plus BCD1)

C.