XML - Need Help Collections vs Overrides

How to make a map. Official Handbook, Guides, Tutorials and more...

Moderators: Global Moderators, Cartographers

Forum rules
Please read the Community Guidelines before posting.

XML - Need Help Collections vs Overrides

Postby dolomite13 on Fri Aug 16, 2013 1:10 am

So I have a bonus that looks like this

Territories
- Miners
- Mine 1
- Mine 2
- Mine 3

If you hold
- miners and 1 mine you get +2
- miners and 2 mines you get +4
- miners and 3 mines you get +8

My question is ... is it better to try and code this as a collection or with overrides? or am I doing this completely wrong?

=D13=

COLLECTIONS

Code: Select all
<continent>
   <name>1 Mine</name>
   <bonus>0</bonus>
   <components>
      <territory>F2 - Mines</territory>
      <territory>F3 - Mines</territory>
      <territory>S4 - Mines</territory>
   </components>
   <required>1</required>
</continent>

<continent>
   <name>2 Mines</name>
   <bonus>0</bonus>
   <components>
      <territory>F2 - Mines</territory>
      <territory>F3 - Mines</territory>
      <territory>S4 - Mines</territory>
   </components>
   <required>2</required>
</continent>

<continent>
   <name>3 Mines</name>
   <bonus>0</bonus>
   <components>
      <territory>F2 - Mines</territory>
      <territory>F3 - Mines</territory>
      <territory>S4 - Mines</territory>
   </components>
   <required>3</required>
</continent>

<continent>
   <name>Miners - Mines</name>
   <bonuses>
      <bonus required="2">2</bonus>
      <bonus required="3">2</bonus>
      <bonus required="4">4</bonus>
   </bonuses>
   <components>
      <continent>1 Mine</continent>
      <continent>2 Mines</continent>
      <continent>3 Mines</continent>
      <territory type="mandatory">Miners</territory>
   </components>
   <required>2</required>
</continent>



OVERRIDES

Code: Select all
<continent>
   <name>1 Mine</name>
   <bonus>0</bonus>
   <components>
      <territory>F2 - Mines</territory>
      <territory>F3 - Mines</territory>
      <territory>S4 - Mines</territory>
   </components>
   <required>1</required>
</continent>

<continent>
   <name>2 Mines</name>
   <bonus>0</bonus>
   <components>
      <territory>F2 - Mines</territory>
      <territory>F3 - Mines</territory>
      <territory>S4 - Mines</territory>
   </components>
   <required>2</required>
</continent>

<continent>
   <name>3 Mines</name>
   <bonus>0</bonus>
   <components>
      <territory>F2 - Mines</territory>
      <territory>F3 - Mines</territory>
      <territory>S4 - Mines</territory>
   </components>
   <required>3</required>
</continent>

<continent>
   <name>Miners - 1 Mine</name>
   <bonus>2</bonus>
   <components>
      <continent>1 Mine</continent>
      <territory>Miners</territory>
   </components>
   <required>2</required>
</continent>

<continent>
   <name>Miners - 2 Mines</name>
   <bonus>4</bonus>
   <components>
      <continent>2 Mines</continent>
      <territory>Miners</territory>
   </components>
   <required>2</required>
   <overrides>
      <override>Miners - 1 Mine</override>
   </overrides>
</continent>

<continent>
   <name>Miners - 3 Mines</name>
   <bonus>8</bonus>
   <components>
      <continent>3 Mines</continent>
      <territory>Miners</territory>
   </components>
   <required>2</required>
   <overrides>
      <override>Miners - 2 Mines</override>
   </overrides>
</continent>
User avatar
Cook dolomite13
Cartography Assistant
Cartography Assistant
 
Posts: 1458
Joined: Mon Aug 18, 2008 5:54 pm
Medals: 34
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (1)
Assassin Achievement (2) Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (1) Teammate Achievement (2) Cross-Map Achievement (3) Beta Map Achievement (1) Ratings Achievement (2)
General Achievement (2) Map Contribution (4) General Contribution (3)

Re: XML - Need Help Collections vs Overrides

Postby Gilligan on Fri Aug 16, 2013 7:28 am

The first one is perfect!
Image
User avatar
Major Gilligan
Cartography Assistant
Cartography Assistant
 
Posts: 12727
Joined: Thu May 11, 2006 4:59 pm
Location: Providence, RI
Medals: 202
Monthly Leader Silver (1) Monthly Leader Bronze (1) Most Improved Silver (1) Standard Achievement (4) Doubles Achievement (3)
Triples Achievement (3) Quadruples Achievement (3) Terminator Achievement (3) Assassin Achievement (3) Manual Troops Achievement (3)
Freestyle Achievement (4) Polymorphic Achievement (2) Nuclear Spoils Achievement (3) Fog of War Achievement (4) Trench Warfare Achievement (3)
Speed Achievement (4) Teammate Achievement (3) Random Map Achievement (3) Cross-Map Achievement (4) Beta Map Achievement (2)
Battle Royale Achievement (3) Bot Achievement (2) Ratings Achievement (4) Tournament Achievement (30) General Achievement (32)

Re: XML - Need Help Collections vs Overrides

Postby dolomite13 on Sun Aug 18, 2013 1:41 am

What if it was written like this

<continent>
<name>Miners - Mines</name>
<bonuses>
<bonus required="2">2</bonus>
<bonus required="3">2</bonus>
<bonus required="4">4</bonus>
</bonuses>
<components>
<territory>F2 - Mines</territory>
<territory>F3 - Mines</territory>
<territory>S4 - Mines</territory>
<territory type="mandatory">Miners</territory>
</components>
<required>2</required>
</continent>

Would this yield the result of

* Miners & 1 Mines = +2
* Miners & 2 Mines = +4
* Miners & 3 Mines = +8

Or is it necessary to code it with the extra continents like in example 1?

=D13=
User avatar
Cook dolomite13
Cartography Assistant
Cartography Assistant
 
Posts: 1458
Joined: Mon Aug 18, 2008 5:54 pm
Medals: 34
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (1)
Assassin Achievement (2) Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (1) Teammate Achievement (2) Cross-Map Achievement (3) Beta Map Achievement (1) Ratings Achievement (2)
General Achievement (2) Map Contribution (4) General Contribution (3)

Re: XML - Need Help Collections vs Overrides

Postby thenobodies80 on Mon Oct 07, 2013 3:49 am

it works. The main difference between overrides and collections is the fact that for collections the name is unique.
So if the result you want in the game log is to see " for holding Miners and 2 mines (3 mines, etc etc)" you need to use overrides instead of collections.
Obviously overrides makes the code longer

EDIT: I know I'm very late in replying to this, but at least someone else can use it as reference. ;)

Give every man your ear, but few thy voice. Take each man's censure, but reserve thy judgment.
show
User avatar
Corporal 1st Class thenobodies80
 
Posts: 5558
Joined: Wed Sep 05, 2007 4:30 am
Medals: 70
Standard Achievement (3) Doubles Achievement (2) Triples Achievement (1) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (2) Manual Troops Achievement (2) Freestyle Achievement (2) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (2) Teammate Achievement (1) Cross-Map Achievement (3) Bot Achievement (1) Ratings Achievement (4)
General Achievement (8) Map Contribution (7) Tournament Contribution (6) General Contribution (17)


Return to Tools & Guides

Who is online

Users browsing this forum: No registered users

cron
Login