xml question

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

Moderators: Cartographers, Global Moderators

Forum rules
Please read the Community Guidelines before posting.

xml question

Postby Oneyed on Fri Dec 07, 2012 1:40 pm

is possible to code:
when you hold XYZ and ABC bonus is valid only for the first holding? or something similar?

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Re: xml question

Postby ManBungalow on Fri Dec 07, 2012 1:54 pm

Not that I know of.

I've wondered before what would happen if region X is a bonus, but is also set to revert to neutral at the start of a turn. That way one would have to re-take the bonus to get it the next turn, which is a little bit like what you're asking.

Perhaps it would be processed in order of the appearance of the function in the XML - ie. by reading the XML from top to bottom.

One could probably find out by analysing the logs of some games on existing maps with killer neutrals. I suspect that the killer neutrals are processed before anything else though.
Image
User avatar
Brigadier ManBungalow
 
Posts: 3243
Joined: Sun Jan 13, 2008 7:02 am
Location: On a giant rock orbiting a star somewhere
Medals: 84
Standard Achievement (4) Doubles Achievement (4) Triples Achievement (3) Quadruples Achievement (3) Terminator Achievement (2)
Assassin Achievement (2) Manual Troops Achievement (3) Freestyle Achievement (4) Polymorphic Achievement (1) Nuclear Spoils Achievement (2)
Fog of War Achievement (4) Trench Warfare Achievement (2) Speed Achievement (4) Teammate Achievement (2) Random Map Achievement (2)
Cross-Map Achievement (3) Beta Map Achievement (1) Battle Royale Achievement (1) Ratings Achievement (4) Tournament Achievement (2)
General Achievement (10) Clan Achievement (12) Tournament Contribution (3) General Contribution (6)

Re: xml question

Postby Oneyed on Fri Dec 07, 2012 2:07 pm

this is my whole idea:

player holds France and he gains bonus for France and for France colonies if he holds any. when this player conquered England he will gains bonus for England, but no for England colonies.

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Re: xml question

Postby nolefan5311 on Fri Dec 07, 2012 2:44 pm

Code: Select all
    <continent>
    <bonuses>
    <bonus required="5">5</bonus>
    <bonus required="8">15</bonus>
    <bonus required="11">45</bonus>
    </bonuses>
    <components>
    <component type="mandatory">essential country 1</component>
    <component type="mandatory">essential country 2</component>
    <component type="blocker">bad country!</component>
    <component>variable country 1</component>
    <component>variable country 2</component>
    <component>variable country 3</component>
    <component>variable country 4</component>
    <component>variable country 5</component>
    <component>variable country 6</component>
    <component>variable country 7/component>
    <component>variable country 8</component>
    <component>variable country 9</component>
    </components>
    </continent>


What this does, is say you hold all of France (that's would go under the "mandatory tag". You also hold French colonies (that would also go under the mandatory tag). But, if you put a "blocker" territory in there, let's say in this case England, you would then lose the bonus for France until you no longer held England. Is this what you mean Oneyed?
Image
User avatar
Major nolefan5311
 
Posts: 1623
Joined: Mon Nov 22, 2010 11:51 am
Location: Florida
Medals: 108
Standard Achievement (3) Doubles Achievement (4) Triples Achievement (3) Quadruples Achievement (3) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (2) Freestyle Achievement (2) Polymorphic Achievement (1) Nuclear Spoils Achievement (2)
Fog of War Achievement (4) Trench Warfare Achievement (2) Speed Achievement (1) Teammate Achievement (2) Random Map Achievement (2)
Cross-Map Achievement (4) Beta Map Achievement (1) Ratings Achievement (3) Tournament Achievement (29) General Achievement (5)
Clan Achievement (12) Map Contribution (4) Tournament Contribution (12) General Contribution (4)

Re: xml question

Postby Oneyed on Fri Dec 07, 2012 3:30 pm

nolefan5311 wrote:What this does, is say you hold all of France (that's would go under the "mandatory tag". You also hold French colonies (that would also go under the mandatory tag). But, if you put a "blocker" territory in there, let's say in this case England, you would then lose the bonus for France until you no longer held England. Is this what you mean Oneyed?


my idea is adversive. when you hold France at the first (and bonus for France ofcourse), then bonus for France colonies and then you capture England you will have only bonus for England but not for England colonies. until you have France.

when you lose France (and ofcourse bonus for France and its colonise) you gain alos bonus for England colonies.

is this possible?

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Re: xml question

Postby nolefan5311 on Fri Dec 07, 2012 3:57 pm

Hmm. I'm not 100% sure what you mean.
Image
User avatar
Major nolefan5311
 
Posts: 1623
Joined: Mon Nov 22, 2010 11:51 am
Location: Florida
Medals: 108
Standard Achievement (3) Doubles Achievement (4) Triples Achievement (3) Quadruples Achievement (3) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (2) Freestyle Achievement (2) Polymorphic Achievement (1) Nuclear Spoils Achievement (2)
Fog of War Achievement (4) Trench Warfare Achievement (2) Speed Achievement (1) Teammate Achievement (2) Random Map Achievement (2)
Cross-Map Achievement (4) Beta Map Achievement (1) Ratings Achievement (3) Tournament Achievement (29) General Achievement (5)
Clan Achievement (12) Map Contribution (4) Tournament Contribution (12) General Contribution (4)

Re: xml question

Postby Oneyed on Fri Dec 07, 2012 4:10 pm

nolefan5311 wrote:Hmm. I'm not 100% sure what you mean.


it is my bad english....

France +3, +1 for every 2 French colonies
England +2, +1 for every 2 English colonies

so player holds France. then he conquer 4 French colonies. so he gains +5.
latter he conquer England. so he gains also +2. then he conquer 2 English colonies, but he does not has bonus for them beause he holds bonus for French colonies.

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Re: xml question

Postby thenobodies80 on Fri Dec 07, 2012 5:33 pm

so you want to achieve this:

England = X
England + any england colonies = X + K
France = Y
France + any french colonies = Y + Z
England + France + any french colonies (or any england colonies) = X+Y+Z or (K)
England + France + any england colonies + any french colonies = X+Y+K

yes it is possible.
gimme few mins to write the code ;)

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
Foundry Foreman
Foundry Foreman
 
Posts: 5637
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)

Re: xml question

Postby ManBungalow on Fri Dec 07, 2012 6:21 pm

My interpretation.

Oneyed wrote:France +3, +1 for every 2 French colonies
England +2, +1 for every 2 English colonies

so player holds France. then he conquer 4 French colonies. so he gains +5.
latter he conquer England. so he gains also +2. then he conquer 2 English colonies, but he does not has bonus for them beause he holds bonus for French colonies.


England = A
England + English Colonies = A + B

France = C
France + French Colonies = C + D

England + France = A + C

England + France + French Colonies = A + C + D

England + France + English Colonies = A + B + C

England + France + French Colonies + English Colonies = A + C + D


As nobodies says, this is possible. However, I worry more about how the information will be conveyed on a map.
Image
User avatar
Brigadier ManBungalow
 
Posts: 3243
Joined: Sun Jan 13, 2008 7:02 am
Location: On a giant rock orbiting a star somewhere
Medals: 84
Standard Achievement (4) Doubles Achievement (4) Triples Achievement (3) Quadruples Achievement (3) Terminator Achievement (2)
Assassin Achievement (2) Manual Troops Achievement (3) Freestyle Achievement (4) Polymorphic Achievement (1) Nuclear Spoils Achievement (2)
Fog of War Achievement (4) Trench Warfare Achievement (2) Speed Achievement (4) Teammate Achievement (2) Random Map Achievement (2)
Cross-Map Achievement (3) Beta Map Achievement (1) Battle Royale Achievement (1) Ratings Achievement (4) Tournament Achievement (2)
General Achievement (10) Clan Achievement (12) Tournament Contribution (3) General Contribution (6)

Re: xml question

Postby thenobodies80 on Fri Dec 07, 2012 7:02 pm

here what you need:

first of all you need to code the two main bonuses
Code: Select all
<continent>
<name>England</name>
<bonus>2</bonus>
<components>
<territory>TerrA</territory>
etc etc
</components>
</continent>
<continent>
<name>France</name>
<bonus>3</bonus>
<components>
<territory>TerrB</territory>
etc etc
</components>
</continent>



Now you can list all your colonies bonues (in this example I've set the limit to 6 for an easier code)

Code: Select all
<continent>
<name>2 English Colonies<name>
<bonus>0</bonus>
<components>
<territory>Eng Colony 1</territory>
<territory>Eng Colony 2</territory>
<territory>Eng Colony 3</territory>
<territory>Eng Colony 4</territory>
<territory>Eng Colony 5</territory>
<territory>Eng Colony 6</territory>
</components>
<required>2</required>
</continent>
<continent>
<name>4 English Colonies<name>
<bonus>0</bonus>
<components>
<territory>Eng Colony 1</territory>
<territory>Eng Colony 2</territory>
<territory>Eng Colony 3</territory>
<territory>Eng Colony 4</territory>
<territory>Eng Colony 5</territory>
<territory>Eng Colony 6</territory>
</components>
<required>4</required>
<overrides>
<override>2 English Colonies</override>
</overrides>
</continent>
<continent>
<name>6 English Colonies<name>
<bonus>0</bonus>
<components>
<territory>Eng Colony 1</territory>
<territory>Eng Colony 2</territory>
<territory>Eng Colony 3</territory>
<territory>Eng Colony 4</territory>
<territory>Eng Colony 5</territory>
<territory>Eng Colony 6</territory>
</components>
<required>6</required>
<overrides>
<override>2 English Colonies</override>
<override>4 English Colonies</override>
</overrides>
</continent>
<continent>
<name>2 French Colonies<name>
<bonus>0</bonus>
<components>
<territory>Fr Colony 1</territory>
<territory>Fr Colony 2</territory>
<territory>Fr Colony 3</territory>
<territory>Fr Colony 4</territory>
<territory>Fr Colony 5</territory>
<territory>Fr Colony 6</territory>
</components>
<required>2</required>
</continent>
<continent>
<name>4 French Colonies<name>
<bonus>0</bonus>
<components>
<territory>Fr Colony 1</territory>
<territory>Fr Colony 2</territory>
<territory>Fr Colony 3</territory>
<territory>Fr Colony 4</territory>
<territory>Fr Colony 5</territory>
<territory>Fr Colony 6</territory>
</components>
<required>4</required>
<overrides>
<override>2 French Colonies</override>
</overrides>
</continent>
<continent>
<name>6 French Colonies<name>
<bonus>0</bonus>
<components>
<territory>Fr Colony 1</territory>
<territory>Fr Colony 2</territory>
<territory>Fr Colony 3</territory>
<territory>Fr Colony 4</territory>
<territory>Fr Colony 5</territory>
<territory>Fr Colony 6</territory>
</components>
<required>6</required>
<overrides>
<override>2 French Colonies</override>
<override>4 French Colonies</override>
</overrides>
</continent>


Now you need to create nested continents:
Code: Select all
<continent>
<name> England and 2 Colonies</name>
<bonus>3</bonus>
<components>
<continent>England</continent>
<continent>2 English Colonies</continent>
<components>
<overrides>
<override>England</override>
<override>2 English Colonies</override>
</overrides>
</continent>
<continent>
<name> England and 4 Colonies</name>
<bonus>4</bonus>
<components>
<continent>England</continent>
<continent>4 English Colonies</continent>
<components>
<overrides>
<override>England</override>
<override>4 English Colonies</override>
<override>England and 2 Colonies</override>
<override>France and 2 Colonies</override>
</overrides>
</continent>
<continent>
<name> England and 6 Colonies</name>
<bonus>5</bonus>
<components>
<continent>England</continent>
<continent>6 English Colonies</continent>
<components>
<overrides>
<override>England</override>
<override>6 English Colonies</override>
<override>England and 4 Colonies</override>
<override>France and 2 Colonies</override>
<override>France and 4 Colonies</override>
</overrides>
</continent>
<continent>
<name>France and 2 Colonies</name>
<bonus>4</bonus>
<components>
<continent>France</continent>
<continent>2 French Colonies</continent>
<components>
<overrides>
<override>France</override>
<override>2 French Colonies</override>
<override>England and 2 Colonies</override>
</overrides>
</continent>
<continent>
<name> France and 4 Colonies</name>
<bonus>5</bonus>
<components>
<continent>France</continent>
<continent>4 French Colonies</continent>
<components>
<overrides>
<override>France</override>
<override>4 French Colonies</override>
<override>France and 2 Colonies</override>
<override>England and 2 Colonies</override>
<override>England and 4 Colonies</override>
</overrides>
</continent>
<continent>
<name> France and 6 Colonies</name>
<bonus>6</bonus>
<components>
<continent>France</continent>
<continent>6 French Colonies</continent>
<components>
<overrides>
<override>France</override>
<override>6 French Colonies</override>
<override>France and 4 Colonies</override>
<override>England and 2 Colonies</override>
<override>England and 4 Colonies</override>
<override>England and 6 Colonies</override>
</overrides>
</continent>


Now, probably you can clean the code, afterall it's just an example. ;)
It would be quicker if collection would allow to use the <continent> tag as component but actually it's not possible (i'm working to have it allowed :-$ :-# )

Hope it helps, sorry if I missed something.
Nobodies

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
Foundry Foreman
Foundry Foreman
 
Posts: 5637
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)

Re: xml question

Postby Oneyed on Sat Dec 08, 2012 1:50 am

ManBungalow wrote:As nobodies says, this is possible. However, I worry more about how the information will be conveyed on a map.


I need day-two and I will post new map. you can find this there ;)
thenobodies80 wrote:Now, probably you can clean the code, afterall it's just an example. ;)
It would be quicker if collection would allow to use the <continent> tag as component but actually it's not possible (i'm working to have it allowed :-$ :-# )


this sounds as big help to xml codders. good luck with it :)
thenobodies80 wrote:Hope it helps, sorry if I missed something.
Nobodies


big thanks guys. be patient and wait how I implement this to map.

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Re: xml question

Postby thenobodies80 on Sat Dec 08, 2012 9:35 am

I'm sorry but I noticed only now I wrote something not true.

The continent component is allowed with collections, but you can't set a type option into it.

So <continent> tag ca be used but, at the moment, you can NOT have tags like these as components: (using your england france colonies case as example)

<continent type="mandatory">England</continent>
<continent type="blocker">England</continent>
<continent type="multiplier" factor="1.5">England</continent>

The type options can be used only within <territory> tags, obivously if components of a bonus.
The <territory> and the <continent> tags can be mixed while listed as components, but all the type options are an exclusive of the former tag only so, for example, something like this IS possible:

<components>
<territory type="mandatory">English Colony 1</territory>
<continent>England</continent</continent>
</components>

So in few word, actually we lack only a way to set a whole continent as mandatory, blocker or multiplier for another continent (bonus).
Have these options will save time and lot of lines of code, but it was kept out for now to save processing power.

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
Foundry Foreman
Foundry Foreman
 
Posts: 5637
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)

Re: xml question

Postby Oneyed on Sat Dec 08, 2012 4:08 pm

to be honest I do not much understand what you wrote, nobodies.

but could you look here viewtopic.php?f=63&t=182388&view=unread#unread and say if the bonuses are possible to code as I set up them?

thanks

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Re: xml question

Postby thenobodies80 on Sat Dec 08, 2012 8:14 pm

Mmmm...i'm not sure I understand what you're trying to do with that map, the legend is not so clear, at least to me.
But I'm sure you can not give a bonus because it's the one you hold as first. Priority levels are set with overrides so it doesn't matter the order in which you hold a bonus.
If I got it right you want that if I hold england and you hold france, we both receive the bonuses, but if i take france from you i do not receive france bonus but just england bonus because I had the british one before. On the opposite if you take england for me, you want to have the bonus for france but not for england.
Then this is not possible. If you set that england bonus overrides (cancel) france bonus it will always in that way. It doesn't matter which one you hold first, overrides set priority levels.

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
Foundry Foreman
Foundry Foreman
 
Posts: 5637
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)

Re: xml question

Postby Oneyed on Sun Dec 09, 2012 4:40 am

lets look at WWI map and lets spoke about "real" bonuses.

"Hold more as one entire states of the same Power, bonus for occupied regions valid only once."

so when you hold French Republic (you gain +3) and Westphalia, Bavaria you gain +1 for 2 occupied CP regions. when you then take Kingdom of Italy (you gain +2), but you will not gain +1 for Westphalia, Bavaria. is this possible?

"Hold entire states of different Powers, bonus for occupied regions valids only for the first one held."

this seems, when I good understand you, as impossible. yes? but the bonus is different here: the Entite Powers have bonus for occupied Central Powers regions, while Central Powers have bonus for occupied non Central Powers regions - so these regions are different.

it also seems that there would be realy huge work with codding, it is not possible to code something like:
German Empire (3) + any 3 occupied non CP regions (2) = 6
but
French Republic (3)+ German Empire (3) + any 3 occupied non CP regions = 6, here bonus for German Empire occupied regions will not valids.

does xml works that is is important order how are names/bonuses written? I mean is there difference:
German Empire + French Republic and French Republic + German Empire?

EDIT: it looks to me similar as bonus in Fragmentation of CSFR. here when you hold 1 Kraj in the SR you gain +2, but when you hold Praha you gain -1 for this Kraj...

Oneyed
Sergeant 1st Class Oneyed
 
Posts: 857
Joined: Sat Dec 10, 2011 12:29 pm
Medals: 11
Standard Achievement (2) Doubles Achievement (1) Terminator Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (2) Teammate Achievement (1) Cross-Map Achievement (1)

Next

Return to Foundry Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

Login