Page 1 of 1

XML Coding Questions and Suggestions

PostPosted: Mon Mar 24, 2008 10:41 pm
by edbeard
I've asked this of yeti_c but I thought maybe someone else would know. Worst case scenario Andy has to ask Lack. And, I have a couple other things to say.


1. I was coding the Supermax XML and I was unsure of how the overrides work with each other.


I code continent called A

I subsequently code a continent called B. B has an override of A.

I then code a continent called C which overrides B.


Do I also need to include the override of A in the C continent, or is this done automatically. Common sense would say it is done automatically but it's better to check now than have a huge screwup when the map goes live.


2. I think there needs to be some changes made to the XML tutorial.

It doesn't include all the necessary information for coding all the functions.

For instance,

A. when you're coding Objectives the tutorial says to code it like this

<objective>
<components>
<continent>Asia</continent>
<territory>Alaska</territory>
</components>
</objective>

When in fact, it is missing one line

<objective>
<name>edbeard is great</name>
<components>
<continent>Asia</continent>
<territory>Alaska</territory>
</components>
</objective>


B. The bonus tag for territories is in the wrong spot

<territory>
<name>Alberta</name>
<borders>
<border>Alaska</border>
<border>Northwest Territory</border>
<border>Ontario</border>
<border>Western United States</border>
</borders>
<bonus>3</bonus>
<coordinates>
<smallx>90</smallx>
<smally>90</smally>
<largex>120</largex>
<largey>111</largey>
</coordinates>
<neutral killer="yes">10</neutral>
</territory>


It should be at the end of the territory. At least, when I was doing the ODW XML, it gave me errors unless the <bonus> </bonus> was at the very end. I'm not sure where it should relate to neutral killer though. At the very least, it was AFTER coordinates not before.


It might be a good idea to get someone quite familiar with XML syntax and ordering to redo/fix the tutorial.


Thanks!

PostPosted: Tue Mar 25, 2008 3:36 am
by yeti_c
1) The question you pose is more cute than you think it is...

Consider this...
Code: Select all

<continent>
  <name>C1
  <bonus>2
  <components>
    <territory>T1
    <territory>T2
    <territory>T3
    <territory>T4
    <territory>T5
    <territory>T6
  </components>
  <required>3
</continent>


<continent>
  <name>C2
  <bonus>3
  <components>
    <territory>T1
    <territory>T2
    <territory>T3
    <territory>T4
    <territory>T5
    <territory>T6
  </components>
  <required>5
  <overrides>
    <override>C1
  </overrides>
</continent>

<continent>
  <name>C3
  <bonus>4
  <components>
    <territory>T1
    <territory>T2
    <territory>T3
    <territory>T4
    <territory>T5
    <territory>T6
  </components>
  <overrides>
    <override>C2
  </overrides>
</continent>



In this instance C1 *must* be a subset of C2 - and C2 *must* be a subset of C3... in this instance the Overrides will work as you expect i.e. Chaining them out...

However consider this...

Code: Select all

<continent>
  <name>C1
  <bonus>2
  <components>
    <territory>T1
    <territory>T2
    <territory>T3
  </components>
</continent>


<continent>
  <name>C2
  <bonus>3
  <components>
    <territory>T4
    <territory>T5
    <territory>T6
  </components>
  <overrides>
    <override>C1
  </overrides>
</continent>

<continent>
  <name>C3
  <bonus>4
  <components>
    <territory>T1
    <territory>T2
    <territory>T3
    <territory>T4
    <territory>T5
    <territory>T6
  </components>
  <required>5</required>
  <overrides>
    <override>C2
  </overrides>
</continent>



In this instance - C3 Overrides C2 fine - but C2 may not override C1 as C2 may not be held - and thus the override is not triggered.

2) A) Also - the Tut needs to have <continent> removed from the <objective> tags - as they don't work.

2) B) Yes - needs fixing.

C.

Re: XML Coding Questions and Suggestions

PostPosted: Sun Jun 08, 2008 8:47 pm
by zimmah
edbeard wrote:
It should be at the end of the territory. At least, when I was doing the ODW XML, it gave me errors unless the <bonus> </bonus> was at the very end. I'm not sure where it should relate to neutral killer though. At the very least, it was AFTER coordinates not before.


It might be a good idea to get someone quite familiar with XML syntax and ordering to redo/fix the tutorial.


Thanks!



neutral killer tag is the same as normal neutral tags (it comes instead of the regular neutrals in this version of the code)

so it should be AFTER the neutrals i guess. doesn't matter if they're killer neutrals or not. (besides, having killer neutrals on a bonus territory won't work anyways, since the killer will kill the bonus too

Re: XML Coding Questions and Suggestions

PostPosted: Sun Jun 08, 2008 8:55 pm
by AndyDufresne
Yeti, as you know what needs clarification and fixing in the XML Tutorial more so than most others, I've changed the topic author to you...so you can make necessary changes and alterations. :D


--Andy

Re: XML Coding Questions and Suggestions

PostPosted: Mon Jun 09, 2008 2:17 am
by blakebowling
i thought that if the topic was locked, it could only be edited by a mod.

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 10, 2008 8:45 am
by yeti_c
blakebowling wrote:i thought that if the topic was locked, it could only be edited by a mod.


You are correct!!

C.

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 10, 2008 10:36 am
by t-o-m
yeti_c wrote:
blakebowling wrote:i thought that if the topic was locked, it could only be edited by a mod.


You are correct!!

C.

MAKE YETI A MOD!
so then you can edit all of the XML things ;p

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 10, 2008 4:24 pm
by gimil
t-o-m wrote:
yeti_c wrote:
blakebowling wrote:i thought that if the topic was locked, it could only be edited by a mod.


You are correct!!

C.

MAKE YETI A MOD!
so then you can edit all of the XML things ;p


Ill unlock it, anyone caught sneaking a post will be hurt :)

EDIT: nevermind its already been done

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 10, 2008 4:27 pm
by t-o-m
gimil wrote:
t-o-m wrote:
yeti_c wrote:
blakebowling wrote:i thought that if the topic was locked, it could only be edited by a mod.


You are correct!!

C.

MAKE YETI A MOD!
so then you can edit all of the XML things ;p


Ill unlock it, anyone caught sneaking a post will be hurt :)

EDIT: nevermind its already been done

damn, plan foiled. 8-)

back on topic.

has anyone seen edbeard? this is his thread and he's not returned.

Re: XML Coding Questions and Suggestions

PostPosted: Fri Jun 13, 2008 5:53 am
by MrBenn
gimil wrote:Ill unlock it, anyone caught sneaking a post will be hurt :)

EDIT: nevermind its already been done

Can you delete that post? Or will it stay for ever as a testament to the folly of unlocking a locked sticky?

Re: XML Coding Questions and Suggestions

PostPosted: Fri Jun 13, 2008 6:06 am
by yeti_c
On another note - I've just gone through and fixed the problems that I saw...

Please tell me if I've made mistakes though!!

C.

Re: XML Coding Questions and Suggestions

PostPosted: Mon Jun 23, 2008 8:53 pm
by blakebowling
yeti_c wrote:On another note - I've just gone through and fixed the problems that I saw...

Please tell me if I've made mistakes though!!

C.

but everyone always asks you, so how would we know if you made a mistake ((unless you told us)) :P

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 24, 2008 2:10 am
by yeti_c
blakebowling wrote:
yeti_c wrote:On another note - I've just gone through and fixed the problems that I saw...

Please tell me if I've made mistakes though!!

C.

but everyone always asks you, so how would we know if you made a mistake ((unless you told us)) :P


A veritable quandary indeed!!!

C.

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 24, 2008 6:23 am
by fireedud
YOu jave a mistake in the objectives part. You said suppose the objective is to hold Asia, but you coded for Great Britain.

Re: XML Coding Questions and Suggestions

PostPosted: Tue Jun 24, 2008 8:41 am
by yeti_c
fireedud wrote:YOu jave a mistake in the objectives part. You said suppose the objective is to hold Asia, but you coded for Great Britain.


Cheers.

C.

Re: XML Coding Questions and Suggestions

PostPosted: Thu Jun 26, 2008 2:33 pm
by lanyards
Yeti_C wrote:Start Positions

Lets say we found that whenever someone starts with Asia they win. This isn't true and nearly impossible but just go with it. We want to make that impossible to do. One way we could do this is using the new start position tool. Start positions are contained in a tag called <positions> which contains multiple <position> tags. These position tags can contain one or more <territory> tags, like so:


Code: Select all
<positions>
   <position>
      <territory>Ural</territory>
   </position>
   <position>
      <territory>Afghanistan</territory>
   </position>
   <position>
      <territory>Middle East</territory>
   </position>
   <position>
      <territory>Siberia</territory>
   </position>
   <position>
      <territory>Irkutsk</territory>
   </position>
   <position>
      <territory>Yakutsk</territory>
   </position>
   <position>
      <territory>Kamchatka</territory>
   </position>
   <position>
      <territory>Mongolia</territory>
   </position>
   <position>
      <territory>Japan</territory>
   </position>
   <position>
      <territory>China</territory>
   </position>
   <position>
      <territory>India</territory>
   </position>
   <position>
      <territory>Siam</territory>
   </position>
</positions>

So in the above example we have 12 start positions. When the game begins these start positions will be split up amongst the players. If there is a remainder, the territories of those start positions are dealt out as normal territories.


I think "Lets" should be "Let's".

Also, what do you mean by "normal" territories in the last part? Do you mean "neutral"?

--lanyards

Re: XML Coding Questions and Suggestions

PostPosted: Thu Jun 26, 2008 2:36 pm
by t-o-m
lanyards wrote:
I think "Lets" should be "Let's".

what letter is missing there?

"let is"
:shock:
?

Re: XML Coding Questions and Suggestions

PostPosted: Thu Jun 26, 2008 2:37 pm
by oaktown
t-o-m wrote:
lanyards wrote:
I think "Lets" should be "Let's".

what letter is missing there?

u

Re: XML Coding Questions and Suggestions

PostPosted: Thu Jun 26, 2008 2:40 pm
by yeti_c
lanyards wrote:
Yeti_C wrote:Start Positions

Lets say we found that whenever someone starts with Asia they win. This isn't true and nearly impossible but just go with it. We want to make that impossible to do. One way we could do this is using the new start position tool. Start positions are contained in a tag called <positions> which contains multiple <position> tags. These position tags can contain one or more <territory> tags, like so:


Code: Select all
<positions>
   <position>
      <territory>Ural</territory>
   </position>
   <position>
      <territory>Afghanistan</territory>
   </position>
   <position>
      <territory>Middle East</territory>
   </position>
   <position>
      <territory>Siberia</territory>
   </position>
   <position>
      <territory>Irkutsk</territory>
   </position>
   <position>
      <territory>Yakutsk</territory>
   </position>
   <position>
      <territory>Kamchatka</territory>
   </position>
   <position>
      <territory>Mongolia</territory>
   </position>
   <position>
      <territory>Japan</territory>
   </position>
   <position>
      <territory>China</territory>
   </position>
   <position>
      <territory>India</territory>
   </position>
   <position>
      <territory>Siam</territory>
   </position>
</positions>

So in the above example we have 12 start positions. When the game begins these start positions will be split up amongst the players. If there is a remainder, the territories of those start positions are dealt out as normal territories.


I think "Lets" should be "Let's".

Also, what do you mean by "normal" territories in the last part? Do you mean "neutral"?

--lanyards


a) I didn't write it - and you're probably correct (But let us focus on the details of XML and not the english language)

b) "Normal" territories are territories that are non neutral. Actually it's a bit of a misnomer here... and territories defined in the starting positions code that are assigned are fine.
Any that aren't are ignored.
In the 2nd pass any non neutral territories that haven't already been assigned are then dealt out randomly.

Note the way Das Schloss deals with the "spare" territories - it assigns them all neutral. - so they aren't dealt out.

If they are "Normal" territories - then they would be assigned - and this WAS happening before with Das Schloss - and thus making the starts not what was wanted.

C.