natty_dread wrote: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...
It might be worth it from a performance point of view. Maybe the answer is some sort of negative bonus for non-green territories: shorter XML, cleaner log, but hard to fit in the storyline.
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:
<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?
This won't work - the required tag relates to the components in that continent... not the amount of territories in the list of continents added together.
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:
<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?
This won't work - the required tag relates to the components in that continent... not the amount of territories in the list of continents added together.
C.
I'm not sure what you are getting at. The entity would be defined as the <components> element, listing all the green territories, so each continent would be working from the same list, but with a different <required> element, so if the first continent requires 2 of the green territories and the second requires 4, and so on, and each gives me one bonus troop, then if I have five of the green territories, shouldn't the first two continents give me one each for a total of two, and the rest of the continents give me nothing for having less than the required amount?
The sub continent that you list - is 1 element in the components list...
You can have required tags in the sub continent that affect the amount of territories inside itself... but the parent continent only sees this as 1 component so <required>2</required> would mean 2 required components out of a list of 1...
natty_dread wrote: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...
Actually - this would work the best... as long as you listed them all as the same name - the CC engine overloads the continent in the game log... so you would only get 1 line. (See Conquer 4 - or USApocalypse for examples)
The sub continent that you list - is 1 element in the components list...
You can have required tags in the sub continent that affect the amount of territories inside itself... but the parent continent only sees this as 1 component so <required>2</required> would mean 2 required components out of a list of 1...
C.
The "&GreenRegionComponents" entity would not define an entire subcontinent, just the components list for whatever continent that included it, so each of the 56 continents would have the same 112 regions in its component list. I suppose when I get a chance, I should just try it and test it.
Oh I see... I assumed you meant a continent with all the regions in them...
I'm pretty sure that entities won't work... as you'd need to enter the details in the DTD for the document - whether or not Lack's code can parse XML's with those attached I don't know...
Also needless to say - the expanded code would be just as big if you copy'pastad it everywhere anyways.
yeti_c wrote:
... the expanded code would be just as big if you copy'pastad it everywhere anyways.
C.
Yes, but just where that expansion takes place could affect performance. Does it happen at the site, or in my browser after being transferred to my computer?
yeti_c wrote:
... the expanded code would be just as big if you copy'pastad it everywhere anyways.
C.
Yes, but just where that expansion takes place could affect performance. Does it happen at the site, or in my browser after being transferred to my computer?
TBH - I don't know... I've never really used Entities before.