Conquer Club

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.

Re: XML bonuses question - overrides

Postby ender516 on Sun Apr 18, 2010 6:27 pm

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.
User avatar
Sergeant 1st Class ender516
 
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Location: Waterloo, Ontario

Re: XML bonuses question - overrides

Postby yeti_c on Tue Apr 20, 2010 2:22 pm

ender516 wrote:
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?


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.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Re: XML bonuses question - overrides

Postby ender516 on Tue Apr 20, 2010 5:37 pm

yeti_c wrote:
ender516 wrote:
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?


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?
User avatar
Sergeant 1st Class ender516
 
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Location: Waterloo, Ontario

Re: XML bonuses question - overrides

Postby yeti_c on Wed Apr 21, 2010 2:29 am

No - it won't work...

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.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Re: XML bonuses question - overrides

Postby yeti_c on Wed Apr 21, 2010 2:31 am

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)

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Re: XML bonuses question - overrides

Postby yeti_c on Wed Apr 21, 2010 3:07 am

chipv wrote:If we had an XML update allowing reinforcement tags inside continents, this would do it. (Or even vice versa).


This could work...

Alternatively a perhaps more powerful way to do it would be to extend the required tag to have an attribute or something...

i.e. <required bonus="1">2</required>

Then wrap this up in a block with multiple required's...

i.e.
Code: Select all
<requirements>
  <required bonus="1">2</required>
  <required bonus="2">4</required>
  <required bonus="3">6</required>
  <required bonus="4">8</required>
</requirements>


C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Re: XML bonuses question - overrides

Postby ender516 on Wed Apr 21, 2010 12:21 pm

yeti_c wrote:No - it won't work...

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.
User avatar
Sergeant 1st Class ender516
 
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Location: Waterloo, Ontario

Re: XML bonuses question - overrides

Postby yeti_c on Wed Apr 21, 2010 1:54 pm

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.

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Re: XML bonuses question - overrides

Postby ender516 on Wed Apr 21, 2010 7:20 pm

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?
User avatar
Sergeant 1st Class ender516
 
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Location: Waterloo, Ontario

Re: XML bonuses question - overrides

Postby yeti_c on Thu Apr 22, 2010 1:29 pm

ender516 wrote:
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.

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Previous

Return to Foundry Discussions

Who is online

Users browsing this forum: No registered users