XML bonuses question - overrides

Topics that are not maps. Discuss general map making concepts, techniques, contests, etc, here.

Moderator: Cartographers

Forum rules
Please read the Community Guidelines before posting.
User avatar
Industrial Helix
Posts: 3462
Joined: Mon Jul 14, 2008 6:49 pm
Gender: Female
Location: Ohio

XML bonuses question - overrides

Post by Industrial Helix »

Ok, for my 13 American Colonies map I have run into a bit of a dilemma.

Basically, in order for the bonuses to work on a number of colonies basis I've found that I have to write the continent as it is and then have it override all other possible bonuses in the same number of colonies category as well as in every lesser number of colonies category.

For Example:

Continent is Georgia and South Carolina, therefore it must override all other 2 colony bonuses.

Continent is Georgia, South Carolina, North Carolina and Virginia, therefore it must override all 2 colony, 3 colony and 4 colony bonuses.

I'm at 200 microsoft word pages already and I've only finished the 2 colony bonus overrides. I've got a long way to go and I'm wondering if there is a more efficient way of writing this XML.

Is there a code for Any two of the following continents equals a bonus of x code or something?

Thanks!
Last edited by MrBenn on Tue Dec 15, 2009 6:10 pm, edited 1 time in total.
Reason: edited title
Sketchblog [Update 07/25/11]: http://indyhelixsketch.blogspot.com/
Living in Japan [Update 07/17/11]: http://mirrorcountryih.blogspot.com/
Russian Revolution map for ConquerClub [07/20/11]: http://www.conquerclub.com/forum/viewto ... 1&t=116575
User avatar
AndrewB
Posts: 1814
Joined: Mon Jun 12, 2006 5:02 pm
Location: Edmonton, Canada, MST

Re: XML bonuses question

Post by AndrewB »

I think this way should work:

For example:

Conceptual model:

Continent 1
Colony A
Colony B
Colony C
Colony D

Required = 2 bonus = 1

Continent 2
Colony A
Colony B
Colony C
Colony D

Required = 3 bonus = 1 (on top of the Continent 1 bonus to the total bonus of 2)

Continent 3
Colony A
Colony B
Colony C
Colony D

Required = 4 bonus = 2 (on top of the Continent 1 and 2 bonus to the total bonus of 4)


There is another way as well, but it is not suited for every bonus structure:
Create a pairs combinations (as it is done in USApocalipse xml).

For example:
Bonus 1
Colony A
Colony B
Bonus = 1

Bonus 2
Colony A
Colony C
Bonus = 1

Bonus 3
Colony B
Colony C
Bonus = 1

In this case, if the player will hold all 3 colonies he will get 1+1+1 bonus.
Image
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Re: XML bonuses question

Post by yeti_c »

AndrewB wrote:I think this way should work:

For example:

Conceptual model:

Continent 1
Colony A
Colony B
Colony C
Colony D

Required = 2 bonus = 1

Continent 2
Colony A
Colony B
Colony C
Colony D

Required = 3 bonus = 1 (on top of the Continent 1 bonus to the total bonus of 2)

Continent 3
Colony A
Colony B
Colony C
Colony D

Required = 4 bonus = 2 (on top of the Continent 1 and 2 bonus to the total bonus of 4)
This looks good...

But I would actually set the bonuses to their correct values - then override the previous ones up the chain - that way the log looks cleaner and the code is easier to understand.

C.
Image
Highest score : 2297
User avatar
AndrewB
Posts: 1814
Joined: Mon Jun 12, 2006 5:02 pm
Location: Edmonton, Canada, MST

Re: XML bonuses question

Post by AndrewB »

Actually if you name the continents in that example all the same, then they all will be combined. And it will be even cleaner probably?

Not
Continent 1
Continent 2
Continent 3

But just
Continent
Image
User avatar
Industrial Helix
Posts: 3462
Joined: Mon Jul 14, 2008 6:49 pm
Gender: Female
Location: Ohio

Re: XML bonuses question

Post by Industrial Helix »

AndrewB wrote:I think this way should work:

For example:

Conceptual model:

Continent 1
Colony A
Colony B
Colony C
Colony D

Required = 2 bonus = 1

Continent 2
Colony A
Colony B
Colony C
Colony D

Required = 3 bonus = 1 (on top of the Continent 1 bonus to the total bonus of 2)

Continent 3
Colony A
Colony B
Colony C
Colony D

Required = 4 bonus = 2 (on top of the Continent 1 and 2 bonus to the total bonus of 4)


There is another way as well, but it is not suited for every bonus structure:
Create a pairs combinations (as it is done in USApocalipse xml).

For example:
Bonus 1
Colony A
Colony B
Bonus = 1

Bonus 2
Colony A
Colony C
Bonus = 1

Bonus 3
Colony B
Colony C
Bonus = 1

In this case, if the player will hold all 3 colonies he will get 1+1+1 bonus.
Ok, But the colony's break down into smaller territories. Is there a way to group them territory x,y and z = colony and then colony 1, colony 2, colony 3 and coloney 4, hold two for a bonus of 3?
Sketchblog [Update 07/25/11]: http://indyhelixsketch.blogspot.com/
Living in Japan [Update 07/17/11]: http://mirrorcountryih.blogspot.com/
Russian Revolution map for ConquerClub [07/20/11]: http://www.conquerclub.com/forum/viewto ... 1&t=116575
User avatar
thenobodies80
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Gender: Male
Location: Milan

Re: XML bonuses question

Post by thenobodies80 »

Code: Select all

<continent>
<name>2 colonies</name>
<bonus>3</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>2</required>
</continet>
<continent>
<name>3 colonies</name>
<bonus>4</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>3</required>
<overrides>
<override>2 colonies</override>
</overrides>
</continet>
<continent>
<name>4 colonies</name>
<bonus>5</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>4</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
</overrides>
</continet>
<continent>
<name>5 colonies</name>
<bonus>6</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>5</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
</overrides>
</continet>
<continent>
<name>6 colonies</name>
<bonus>7</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>6</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
</overrides>
</continet>
<continent>
<name>7 colonies</name>
<bonus>8</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>7</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
</overrides>
</continet>
<continent>
<name>8 colonies</name>
<bonus>9</bonus>
<components>
<territory>colony 1</territory>
<territory>colony 2</territory>
<territory>colony 3</territory>
<territory>colony 4</territory>
<territory>colony 5</territory>
<territory>colony 6</territory>
<territory>colony 7</territory>
<territory>colony 8</territory>
<territory>colony 9</territory>
<territory>colony 10</territory>
<territory>colony 11</territory>
<territory>colony 12</territory>
<territory>colony 13</territory>
</components>
<required>8</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
<override>7 colonies</override>
</overrides>
</continet>
<continent>
<name>colony 1</name>
<bonus>0</bonus>
<components>
<territory>region 1</territory>
<territory>region 2</territory>
<territory>region 3</territory>
</components>
</continet>
<continent>
<name>colony 2</name>
<bonus>0</bonus>
<components>
<territory>region 4</territory>
<territory>region 5</territory>
<territory>region 6</territory>
</components>
</continet>
<continent>
<name>colony 3</name>
<bonus>0</bonus>
<components>
<territory>region 7</territory>
<territory>region 8</territory>
<territory>region 9</territory>
<territory>region 10</territory>
</components>
</continet>
<continent>
<name>colony 4</name>
<bonus>0</bonus>
<components>
<territory>region 11</territory>
<territory>region 12</territory>
<territory>region 13</territory>
</components>
</continet>

etc etc
User avatar
Industrial Helix
Posts: 3462
Joined: Mon Jul 14, 2008 6:49 pm
Gender: Female
Location: Ohio

Re: XML bonuses question

Post by Industrial Helix »

Ok, so essentially I'm creating two types of continents. 1) The colonies made up of their territories worth nothing. 2) The combination of colony continents previously defined worth x amount of armies.

Did not know I could do that.
Sketchblog [Update 07/25/11]: http://indyhelixsketch.blogspot.com/
Living in Japan [Update 07/17/11]: http://mirrorcountryih.blogspot.com/
Russian Revolution map for ConquerClub [07/20/11]: http://www.conquerclub.com/forum/viewto ... 1&t=116575
User avatar
AndrewB
Posts: 1814
Joined: Mon Jun 12, 2006 5:02 pm
Location: Edmonton, Canada, MST

Re: XML bonuses question

Post by AndrewB »

Industrial Helix wrote:Ok, so essentially I'm creating two types of continents. 1) The colonies made up of their territories worth nothing. 2) The combination of colony continents previously defined worth x amount of armies.

Did not know I could do that.
No, you cannot do that Helix. Shoot me a PM and I can help you with an XML, if u want me too.
Image
User avatar
thenobodies80
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Gender: Male
Location: Milan

Re: XML bonuses question

Post by thenobodies80 »

AndrewB wrote:
Industrial Helix wrote:Ok, so essentially I'm creating two types of continents. 1) The colonies made up of their territories worth nothing. 2) The combination of colony continents previously defined worth x amount of armies.

Did not know I could do that.
No, you cannot do that Helix.Shoot me a PM and I can help you with an XML, if u want me too.
You right,bad typo (i used the territory tag instead of the continent tag) :oops: #-o
But it can be done...

Code: Select all

<continent>
<name>2 colonies</name>
<bonus>3</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>2</required>
</continet>
<continent>
<name>3 colonies</name>
<bonus>4</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>3</required>
<overrides>
<override>2 colonies</override>
</overrides>
</continet>
<continent>
<name>4 colonies</name>
<bonus>5</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>4</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
</overrides>
</continet>
<continent>
<name>5 colonies</name>
<bonus>6</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>5</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
</overrides>
</continet>
<continent>
<name>6 colonies</name>
<bonus>7</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>6</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
</overrides>
</continet>
<continent>
<name>7 colonies</name>
<bonus>8</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>7</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
</overrides>
</continet>
<continent>
<name>8 colonies</name>
<bonus>9</bonus>
<components>
<continent>colony 1</continent>
<continent>colony 2</continent>
<continent>colony 3</continent>
<continent>colony 4</continent>
<continent>colony 5</continent>
<continent>colony 6</continent>
<continent>colony 7</continent>
<continent>colony 8</continent>
<continent>colony 9</continent>
<continent>colony 10</continent>
<continent>colony 11</continent>
<continent>colony 12</continent>
<continent>colony 13</continent>
</components>
<required>8</required>
<overrides>
<override>2 colonies</override>
<override>3 colonies</override>
<override>4 colonies</override>
<override>5 colonies</override>
<override>6 colonies</override>
<override>7 colonies</override>
</overrides>
</continet>
<continent>
<name>colony 1</name>
<bonus>0</bonus>
<components>
<territory>region 1</territory>
<territory>region 2</territory>
<territory>region 3</territory>
</components>
</continet>
<continent>
<name>colony 2</name>
<bonus>0</bonus>
<components>
<territory>region 4</territory>
<territory>region 5</territory>
<territory>region 6</territory>
</components>
</continet>
<continent>
<name>colony 3</name>
<bonus>0</bonus>
<components>
<territory>region 7</territory>
<territory>region 8</territory>
<territory>region 9</territory>
<territory>region 10</territory>
</components>
</continet>
<continent>
<name>colony 4</name>
<bonus>0</bonus>
<components>
<territory>region 11</territory>
<territory>region 12</territory>
<territory>region 13</territory>
</components>
</continet>

etc etc
edit: public discussions on threads will help more people than a PM ;)
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Re: XML bonuses question

Post by yeti_c »

AndrewB wrote:Actually if you name the continents in that example all the same, then they all will be combined. And it will be even cleaner probably?

Not
Continent 1
Continent 2
Continent 3

But just
Continent
Yes that would work - but makes the XML harder to understand and the bonuses harder to equate...

The overrides method makes it easier for the standard player to understand and cleaner in the logs.

C.
Image
Highest score : 2297
User avatar
Industrial Helix
Posts: 3462
Joined: Mon Jul 14, 2008 6:49 pm
Gender: Female
Location: Ohio

maximum bonuses?

Post by Industrial Helix »

For my 13 colonies map, I'm looking at having 7,085 different bonuses based on the various combinations of the 13 colonies. Is this going to crash the game engine or whatever? Can I do this and not have to worry about something going catastrophically wrong?
Sketchblog [Update 07/25/11]: http://indyhelixsketch.blogspot.com/
Living in Japan [Update 07/17/11]: http://mirrorcountryih.blogspot.com/
Russian Revolution map for ConquerClub [07/20/11]: http://www.conquerclub.com/forum/viewto ... 1&t=116575
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Re: maximum bonuses?

Post by yeti_c »

Industrial Helix wrote:For my 13 colonies map, I'm looking at having 7,085 different bonuses based on the various combinations of the 13 colonies. Is this going to crash the game engine or whatever? Can I do this and not have to worry about something going catastrophically wrong?
You need to code your XML better.

C.
Image
Highest score : 2297
User avatar
Industrial Helix
Posts: 3462
Joined: Mon Jul 14, 2008 6:49 pm
Gender: Female
Location: Ohio

Re: maximum bonuses?

Post by Industrial Helix »

I've talked to a few other people about it and there doesn't seem to be any other way than to make a boatload of bonuses.
Sketchblog [Update 07/25/11]: http://indyhelixsketch.blogspot.com/
Living in Japan [Update 07/17/11]: http://mirrorcountryih.blogspot.com/
Russian Revolution map for ConquerClub [07/20/11]: http://www.conquerclub.com/forum/viewto ... 1&t=116575
User avatar
thenobodies80
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Gender: Male
Location: Milan

Re: maximum bonuses?

Post by thenobodies80 »

Helix if you use the super continents you will have less bonuses. Look my post here http://www.conquerclub.com/forum/viewto ... 9#p2245859.
You don't need to code all the combinations because the <continent> tag can be used instead of the <territory> one in the bonuses.
Code some supercontinents (2 colonies/3 colonies,etc),then use <override>.
You will have 7 bonuses for your groups of colonies (from 2 to 8 ), 13 for your colonies, 2 for ships
Total 22 bonuses.
Your xml will work and it will be smaller

Nobodies
User avatar
Industrial Helix
Posts: 3462
Joined: Mon Jul 14, 2008 6:49 pm
Gender: Female
Location: Ohio

Re: maximum bonuses?

Post by Industrial Helix »

Gotcha... i dunno how I missed that the first time. Thanks for being patient with me!
Sketchblog [Update 07/25/11]: http://indyhelixsketch.blogspot.com/
Living in Japan [Update 07/17/11]: http://mirrorcountryih.blogspot.com/
Russian Revolution map for ConquerClub [07/20/11]: http://www.conquerclub.com/forum/viewto ... 1&t=116575
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Re: maximum bonuses?

Post by yeti_c »

http://www.conquerclub.com/forum/viewto ... 27&t=98509

Not sure how you missed it - it was in your own topic?!

C.
Image
Highest score : 2297
User avatar
thenobodies80
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Gender: Male
Location: Milan

Re: XML bonuses question

Post by thenobodies80 »

Merged with your old topic.

[ Merged ]
ManBungalow
Posts: 3431
Joined: Sun Jan 13, 2008 7:02 am
Location: On a giant rock orbiting a star somewhere

Re: XML bonuses question - overrides

Post by ManBungalow »

I have a related XML issue. Having had a chat with MrBenn, I've come to the conclusion that there are two solutions to the problem I have. The map looks like this:
Click image to enlarge.
image
I'm trying to create the bonus effect of +1 for every 2 green regions across the whole map. Number one is to use the bonus over-ride rule:

Code: Select all

<continent>
<name>2 Green regions</name>
<bonus>1</bonus>
<components>
<territory>LIST</territory>
<territory>ALL</territory>
<territory>GREEN</territory>
<territory>REGIONS</territory>
<territory>HERE</territory>
</components>
<required>2</required>
</continent>

<continent>
<name>4 Green regions</name>
<bonus>2</bonus>
<components>
<territory>LIST</territory>
<territory>ALL</territory>
<territory>GREEN</territory>
<territory>REGIONS</territory>
<territory>HERE</territory>
</components>
<required>4</required>

<overrides>
<override>2 Green regions</override>
</overrides>
</continent>
This would mean copying the whole continent (112 regions) 56 times over (changing the name, bonus troops and regions required each time) and adding an extra bonus to the over-ride each time. That's fine with me, but it would make for a very long and presumably lag-inducing XML.

--

The alternative seems to be to use a Reinforcement rule of +1 per any 2 regions on the map and add negative bonuses to sets of non-green regions held. I'm not all in favour of this variation due to the questions raised by the negative bonuses.

--

Is there an alternate way of coding this and, if not, which way is "better" ?
Image
ManBungalow
Posts: 3431
Joined: Sun Jan 13, 2008 7:02 am
Location: On a giant rock orbiting a star somewhere

Re: XML bonuses question - overrides

Post by ManBungalow »

Using the override setup I will soon have just over 18,000 lines of XML purely to work out the +1 for 2 greens. This worries me. It seems very inefficient and will surely affect the quality of the system as a whole. Is this a concern for anyone else ?
Image
User avatar
natty dread
Posts: 12876
Joined: Fri Feb 08, 2008 8:58 pm
Location: just plain fucked

Re: XML bonuses question - overrides

Post by natty dread »

I can't see an alternative... Perhaps a gameplay change is in order. Say, a cap at 20 or 30 green territories.
Image
User avatar
ender516
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Gender: Male
Location: Waterloo, Ontario

Re: XML bonuses question - overrides

Post by ender516 »

I'm quite new at XML editing, but I think perhaps an internal entity would help here. Could we not define one containing the <components>...</components> section (114 lines), and then put that in the 56 continents?
User avatar
natty dread
Posts: 12876
Joined: Fri Feb 08, 2008 8:58 pm
Location: just plain fucked

Re: XML bonuses question - overrides

Post by natty dread »

ender516 wrote:I'm quite new at XML editing, but I think perhaps an internal entity would help here. Could we not define one containing the <components>...</components> section (114 lines), and then put that in the 56 continents?
No... because you will need different "required" tags for each bonus. You can only define one required tag for one continent.
Image
User avatar
chipv
Head Tech
Head Tech
Posts: 3231
Joined: Mon Apr 28, 2008 5:30 pm

Re: XML bonuses question - overrides

Post by chipv »

If we had an XML update allowing reinforcement tags inside continents, this would do it. (Or even vice versa).
User avatar
ender516
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Gender: Male
Location: Waterloo, Ontario

Re: XML bonuses question - overrides

Post by ender516 »

natty_dread wrote:
ender516 wrote:I'm quite new at XML editing, but I think perhaps an internal entity would help here. Could we not define one containing the <components>...</components> section (114 lines), and then put that in the 56 continents?
No... because you will need different "required" tags for each bonus. You can only define one required tag for one continent.
But the <required></required> tag is outside the <components></components> tag, while still being within the <continent></continent>. It might look something like this:

Code: Select all

<continent>
  <name>2 Green regions</name>
  <bonus>1</bonus>
  &GreenRegionComponents;
  <required>2</required>
</continent>

<continent>
  <name>4 Green regions</name>
  <bonus>2</bonus>
  &GreenRegionComponents;
  <required>4</required>
  <overrides>
    <override>2 Green regions</override>
  </overrides>
</continent>

<continent>
  <name>6 Green regions</name>
  <bonus>3</bonus>
  &GreenRegionComponents;
  <required>6</required>
  <overrides>
    <override>2 Green regions</override>
    <override>4 Green regions</override>
  </overrides>
</continent>
I won't attempt the entity definition here, since I'm not exactly sure of the syntax. This doesn't help reduce the number of continents or the increasing number of overrides in each one, but it should help some.

Say, what if each of those 56 continents just gave a bonus of 1 and there were no overrides, wouldn't that add up properly?
User avatar
natty dread
Posts: 12876
Joined: Fri Feb 08, 2008 8:58 pm
Location: just plain fucked

Re: XML bonuses question - overrides

Post by natty dread »

Oh, so that's what you mean. Yeah, it could work, maybe. I'm not sure how the CC XML engine handles internal entities.
Say, what if each of those 56 continents just gave a bonus of 1 and there were no overrides, wouldn't that add up properly?
Yes, but it would look really awful in game log...
Image
Post Reply

Return to “Foundry Discussions”