Conquer Club

XML Coding Questions and Suggestions

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.

XML Coding Questions and Suggestions

Postby edbeard on Mon Mar 24, 2008 10:41 pm

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!
User avatar
Lieutenant edbeard
 
Posts: 2501
Joined: Thu Mar 29, 2007 12:41 am

Postby yeti_c on Tue Mar 25, 2008 3:36 am

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

Re: XML Coding Questions and Suggestions

Postby zimmah on Sun Jun 08, 2008 8:47 pm

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
Click image to enlarge.
image
User avatar
Major zimmah
 
Posts: 1652
Joined: Fri Jun 01, 2007 12:43 pm
Location: VDLL

Re: XML Coding Questions and Suggestions

Postby AndyDufresne on Sun Jun 08, 2008 8:55 pm

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
User avatar
Corporal 1st Class AndyDufresne
 
Posts: 24935
Joined: Fri Mar 03, 2006 8:22 pm
Location: A Banana Palm in Zihuatanejo

Re: XML Coding Questions and Suggestions

Postby blakebowling on Mon Jun 09, 2008 2:17 am

i thought that if the topic was locked, it could only be edited by a mod.
Private blakebowling
 
Posts: 5093
Joined: Wed Jan 23, 2008 12:09 pm
Location: 127.0.0.1

Re: XML Coding Questions and Suggestions

Postby yeti_c on Tue Jun 10, 2008 8:45 am

blakebowling wrote:i thought that if the topic was locked, it could only be edited by a mod.


You are correct!!

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

Re: XML Coding Questions and Suggestions

Postby t-o-m on Tue Jun 10, 2008 10:36 am

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
User avatar
Major t-o-m
 
Posts: 2918
Joined: Sat Mar 22, 2008 2:22 pm

Re: XML Coding Questions and Suggestions

Postby gimil on Tue Jun 10, 2008 4:24 pm

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
What do you know about map making, bitch?

natty_dread wrote:I was wrong


Top Score:2403
User avatar
Corporal 1st Class gimil
 
Posts: 8599
Joined: Sat Mar 03, 2007 12:42 pm
Location: United Kingdom (Scotland)

Re: XML Coding Questions and Suggestions

Postby t-o-m on Tue Jun 10, 2008 4:27 pm

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.
User avatar
Major t-o-m
 
Posts: 2918
Joined: Sat Mar 22, 2008 2:22 pm

Re: XML Coding Questions and Suggestions

Postby MrBenn on Fri Jun 13, 2008 5:53 am

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?
Image
PB: 2661 | He's blue... If he were green he would die | No mod would be stupid enough to do that
User avatar
Lieutenant MrBenn
 
Posts: 6880
Joined: Wed Nov 21, 2007 9:32 am
Location: Off Duty

Re: XML Coding Questions and Suggestions

Postby yeti_c on Fri Jun 13, 2008 6:06 am

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

Re: XML Coding Questions and Suggestions

Postby blakebowling on Mon Jun 23, 2008 8:53 pm

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
Private blakebowling
 
Posts: 5093
Joined: Wed Jan 23, 2008 12:09 pm
Location: 127.0.0.1

Re: XML Coding Questions and Suggestions

Postby yeti_c on Tue Jun 24, 2008 2:10 am

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

Re: XML Coding Questions and Suggestions

Postby fireedud on Tue Jun 24, 2008 6:23 am

YOu jave a mistake in the objectives part. You said suppose the objective is to hold Asia, but you coded for Great Britain.
me have no sig
Cook fireedud
 
Posts: 1704
Joined: Fri Mar 02, 2007 10:06 pm

Re: XML Coding Questions and Suggestions

Postby yeti_c on Tue Jun 24, 2008 8:41 am

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

Re: XML Coding Questions and Suggestions

Postby lanyards on Thu Jun 26, 2008 2:33 pm

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
Image
WANT AN ADVANTAGE WHILE WORKING TOWARDS MEDALS?
https://www.conquerclub.com/forum/viewtopic.php?f=529&t=226714
User avatar
Major lanyards
 
Posts: 1378
Joined: Sat Feb 24, 2007 1:31 am
2

Re: XML Coding Questions and Suggestions

Postby t-o-m on Thu Jun 26, 2008 2:36 pm

lanyards wrote:
I think "Lets" should be "Let's".

what letter is missing there?

"let is"
:shock:
?
User avatar
Major t-o-m
 
Posts: 2918
Joined: Sat Mar 22, 2008 2:22 pm

Re: XML Coding Questions and Suggestions

Postby oaktown on Thu Jun 26, 2008 2:37 pm

t-o-m wrote:
lanyards wrote:
I think "Lets" should be "Let's".

what letter is missing there?

u
User avatar
Captain oaktown
 
Posts: 4451
Joined: Sun Dec 03, 2006 9:24 pm
Location: majorcommand

Re: XML Coding Questions and Suggestions

Postby yeti_c on Thu Jun 26, 2008 2:40 pm

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


Return to Foundry Discussions

Who is online

Users browsing this forum: No registered users

cron