Conquer Club

xml question

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 question

Postby koontz1973 on Sun Dec 09, 2012 4:59 am

oneyed, from what I am reading, is this:
Hold British bonus you get a +2
Hold British and 2 other types of territs you get +6. This is easy to code. All it is is a simple over ride.
To hold german empire (3) and france (3) is 6. That is a simple normal bonus structure.

But if you hold france(3), germany(3) and occupied regions (3) again this is possible. You code this as an over ride.

France (3)
Germany (3)
Germany with occupied land (6)
France with Germany (6) over rides normal Germany and France bonuses
France with Germany and occupied lands (6) over ride all bonuses that come before in this series.

Go and look at the xml for Rorke's Drift or Kingdom of Korea. Both use over rides a lot so you can see how they work. You only need to over ride the last over ride bonus so it is easy to code.

Over rides are easy to code in as it is only one extra line for the bonuses. Just remember to write them in sequence so you do not get a conflict.

Write all normal continent bonuses first.
Then the ones with a continent and occupied lands (These over ride the first lot)
Then do the ones that have more land. Again these over ride the second lot.
So on and so on.

Hope that helps.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby thenobodies80 on Sun Dec 09, 2012 8:10 am

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


What I'm saying is that the above is not possible....or at least bad written on the map.
It can't be "only for the first held". It could be "only once".

As I said earlier it doesn't matter what region you hold first, overrides don't work in that way.

EDIT: a solution could be to set overrides so you give away only one bonus (not the first) and it is always the biggest the player holds. It can be done with overrides, like koontz said.
User avatar
Sergeant 1st Class thenobodies80
 
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Location: Milan

Re: xml question

Postby Oneyed on Sun Dec 09, 2012 2:33 pm

thenobodies80 wrote:It could be "only once".


this is also fine and the right thing which I needs for "holding more entire states of the same Power".
thenobodies80 wrote:EDIT: a solution could be to set overrides so you give away only one bonus (not the first) and it is always the biggest the player holds. It can be done with overrides, like koontz said.


this sounds also fine. just how "the biggest" bonus works? is it depends on current situation or is it which bonus is still higher?
example:
England +2, +1 for every 2 colonies
Germany +3, +1 for every 2 colonies

1, I hold Germany (+3) and England with 2 colonies (+2+1), so how will xml solve this?

2, I hold Germany (+3). then England (+2) then 4 english colonies (+2+2) - will be valid English bonus? and then when I take 4 German colonies (+3+2) - will the bonus change because German bonus is higher?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby thenobodies80 on Sun Dec 09, 2012 4:36 pm

for 1 you can decide as you want, if they have the same value it's up to you decide which one overrides the other.
for 2 i think it's possible. Just make the german bonus overrides the english one.
User avatar
Sergeant 1st Class thenobodies80
 
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Location: Milan

Re: xml question

Postby Oneyed on Sun Jan 20, 2013 4:29 am

I have another XML quetsion:

is possible to code that player A receive bonus if player B holds XYZ?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Sun Jan 20, 2013 5:26 am

Oneyed wrote:I have another XML quetsion:

is possible to code that player A receive bonus if player B holds XYZ?

Oneyed

No.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby Oneyed on Fri Jan 25, 2013 6:50 pm

is possible to:
if player holds A, B he can bombards X. when he holds A, B, C, D he can bombards Y but not X?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby ender516 on Sun Jan 27, 2013 10:37 pm

Make a continent, "Can Bombard X", with components A and B and blocker components C and D. Use that as the condition for bombarding X. Make another continent, "Can Bombard Y" with components C and D, and use it as the condition for bombarding Y.
User avatar
Sergeant 1st Class ender516
 
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Location: Waterloo, Ontario

Re: xml question

Postby Oneyed on Mon Jan 28, 2013 4:24 am

ender516 wrote:Make a continent, "Can Bombard X", with components A and B and blocker components C and D. Use that as the condition for bombarding X. Make another continent, "Can Bombard Y" with components C and D, and use it as the condition for bombarding Y.


what are blocker? it is something what can be codded in xml?
thanks.

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Mon Jan 28, 2013 5:45 am

Oneyed wrote:
ender516 wrote:Make a continent, "Can Bombard X", with components A and B and blocker components C and D. Use that as the condition for bombarding X. Make another continent, "Can Bombard Y" with components C and D, and use it as the condition for bombarding Y.


what are blocker? it is something what can be codded in xml?
thanks.

Oneyed

Yes. XML Guide
Oneyed, here is the guide from the xml guide, but it is worth reading it all. Most of it is old but their is a lot of new things now that can be played with.

4.3.3 - <mandatory>, <blocker> and <multiplier>

Blocker

Syntax
<continent>
__<name>ConName</name>
__<bonuses>
____<bonus required="#">BonusVal</bonus>
____...
__</bonuses>
__<components>
____<territory type="blocker">TerrName</territory>
____...
__</components>
</continent>


The blocker type identify a particular type of component. If you hold a blocker component you do NOT hold the continent.
To specify the blocker type for a territory you need to add type="blocker" into the opening territory tag: <territory type="blocker">

For example
Code: Select all
<continent>
    <bonuses>
    <bonus required="1">1</bonus>
    <bonus required="2">3</bonus>
    <bonus required="3">5</bonus>
    </bonuses>
    <components>
    <territory type="blocker">country 1</territory>
    <territory>country 2</territory>
    <territory>country 3</territory>
    <territory>country 4</territory>
    </components>
    </continent>


With the above code, if the player holds country 1 (it doesn't matter how many other territories he has) he doesn't hold the continent at all and that means if it was a subcontinent he doesn't hold that either, like in the example into the following spoiler:
show


IMPORTANT
The blocker type can be used ONLY with <territory> components. Do NOT use it with <continent>
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby Oneyed on Mon Jan 28, 2013 8:38 am

this is crashing answer :)
thank you.

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby Oneyed on Wed Jan 30, 2013 1:36 am

I have another question:
is possible to have different ways for attack and for reinfoce? so from region A is not possible to attack region B, but it is possible to reinforce? for example use blocker...?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Wed Jan 30, 2013 1:59 am

I doubt it but not 100% sure. As far as I am aware, a border is a border, without or without conditions.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby Oneyed on Wed Jan 30, 2013 2:37 am

koontz1973 wrote:I doubt it but not 100% sure. As far as I am aware, a border is a border, without or without conditions.


you meant with or without. :)

hm, and what about this:
to attack region A player must holds A, B, C. is possible to code this? this allows only reinforce, becaue player can not attack his regions...

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Wed Jan 30, 2013 3:18 am

You can only reinforce if a border exists. If a border exists, you can also attack. Does not matter how you code it.

The only limit is with bombards. You can bombard but not reinforce.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby Oneyed on Wed Jan 30, 2013 3:37 am

I understan this. but what about possibility which I wrote:

to attack A you need hold A, B, C?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Wed Jan 30, 2013 3:38 am

Thats fine. It is a conditional border.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby Oneyed on Wed Jan 30, 2013 3:41 am

koontz1973 wrote:Thats fine. It is a conditional border.


but it is possible to code in xml? because it sounds a little alogical - who wants to attack region which he holds?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Wed Jan 30, 2013 4:11 am

You cannot attack a region you hold. :?

You asked, can you attack if you hold ABC. If you do not hold them, you cannot attack. That is a conditional border.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby Oneyed on Wed Jan 30, 2013 4:49 am

koontz1973 wrote:You cannot attack a region you hold. :?


I know. but is possible to code this? does xml allowed this?
koontz1973 wrote:You asked, can you attack if you hold ABC. If you do not hold them, you cannot attack. That is a conditional border.


not exactly. I asked if I can attack A when I hold A B C.

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby koontz1973 on Wed Jan 30, 2013 5:33 am

Now I understand. No is the answer. You cannot attack a region you hold in any form.
Image
User avatar
Lieutenant koontz1973
 
Posts: 6960
Joined: Thu Jan 01, 2009 10:57 am

Re: xml question

Postby thenobodies80 on Wed Jan 30, 2013 8:01 am

Technically is possible, but as koontz said it makes no sense. That region would be impossible to take.
User avatar
Sergeant 1st Class thenobodies80
 
Posts: 5400
Joined: Wed Sep 05, 2007 4:30 am
Location: Milan

Re: xml question

Postby Oneyed on Wed Jan 30, 2013 8:16 am

thenobodies80 wrote:Technically is possible,


so it is possible!
thenobodies80 wrote:but as koontz said it makes no sense.


for what I need it makes sense.
thenobodies80 wrote:That region would be impossible to take.


but it would be possible to reinforce this region, right? this is my idea - these units in region A are not for attack but for reinforce.
so when I good understand it is possible to code and use this?

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Re: xml question

Postby ender516 on Wed Jan 30, 2013 10:50 pm

If you hold A, there is NO WAY to attack A, regardless of any other territories you might hold. However, you might be able to close the borders of A by holding A, B, and C such that once you have taken it, you cannot reinforce in or out of A. Exactly how the game engine would respond in this case is probably untested. I wonder if you might even have trouble advancing troops upon conquest in such a situation.
User avatar
Sergeant 1st Class ender516
 
Posts: 4455
Joined: Wed Dec 17, 2008 6:07 pm
Location: Waterloo, Ontario

Re: xml question

Postby Oneyed on Thu Jan 31, 2013 3:42 am

ender516 wrote:If you hold A, there is NO WAY to attack A, regardless of any other territories you might hold.


this is fine (for me). I do not want to attack A from B anyway.
ender516 wrote:However, you might be able to close the borders of A by holding A, B, and C such that once you have taken it, you cannot reinforce in or out of A.


this is not what is my idea...
ender516 wrote:Exactly how the game engine would respond in this case is probably untested. I wonder if you might even have trouble advancing troops upon conquest in such a situation.


...but when I good understood thenobodies the game works step by step:

so here it could looks like:
1, which regions player holds
2, from where and which regions he can attacks/bombards
3, from where and which region he can reinforce.

so if I hold A and B at the start (and there is one way attack from A to B, but B is possible to attack from another region)) I can not attack A from B.
but at the end of my turn I can reinforce from A to B because there is executed condition for open border (hold A and B to one way attack/reinforce A to B).

Oneyed
User avatar
Private 1st Class Oneyed
 
Posts: 1058
Joined: Sat Dec 10, 2011 12:29 pm

Next

Return to Foundry Discussions

Who is online

Users browsing this forum: No registered users