|
||||
| ||||
|
|||||||
| Bug Reports Forum Have a bug to report? Please post here. |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Minors (Double A)
Join Date: May 2002
Location: Granby, CT
Posts: 176
|
Specifying Region Cities in World_Default.xml
Regions can consist of nations, states, and/or cities. The world_default.xml file has examples of the first two.
Code:
<REGION_NATIONS> </REGION_NATION id="xxxxx"/> </REGION_NATIONS> <REGION_STATES> </REGION_STATE id="xxxx"/> </REGION_STATES> Code:
<REGION_CITIES> </REGION_CITY id="xxxxx"/> </REGION_CITIES> Is there a way to add cities to regions in world-default.xml file or can it only be done within the game interface? |
|
|
|
|
|
#2 |
|
OOTP Developer
Join Date: Jun 2009
Location: Here and there
Posts: 16,254
|
REGION_CITY I think is the tag that should work. I think we ignore the group tag, and you need to make sure the syntax is correct (there's no leading slash in the inner one, so it's just <REGION_STATE id="2735" />).
As far as I know that should parse. If you have a sample XML that is failing, I would suggest to post it as there may be something else wrong. Last edited by Matt Arnold; 11-06-2023 at 10:08 PM. |
|
|
|
|
|
#3 |
|
Minors (Double A)
Join Date: May 2002
Location: Granby, CT
Posts: 176
|
Yeah; sorry that was a typo. I actually use Python code to generate the XML so it should be valid. My regions are loading.
I tried 4 variations: Code:
<REGION id="6000" sort_order="5000" name="METRO AREA: New York City 1"> <REGION_CITIES> <REGION_CITY id="840021134"/> <REGION_CITY id="840021136"/> <REGION_CITY id="840021135"/> <REGION_CITY id="840021133"/> <REGION_CITY id="840021137"/> </REGION_CITIES> </REGION> <REGION id="6001" sort_order="5000" name="METRO AREA: New York City 2"> <REGION_CITY id="840021134"/> <REGION_CITY id="840021136"/> <REGION_CITY id="840021135"/> <REGION_CITY id="840021133"/> <REGION_CITY id="840021137"/> </REGION> <REGION id="6002" sort_order="5000" name="METRO AREA: New York City 3"> <CITY id="840021134"/> <CITY id="840021136"/> <CITY id="840021135"/> <CITY id="840021133"/> <CITY id="840021137"/> </REGION> <REGION id="6003" sort_order="2000" name="METRO AREA: New York City 4"> <CITIES> <CITY id="840021134"/> <CITY id="840021136"/> <CITY id="840021135"/> <CITY id="840021133"/> <CITY id="840021137"/> </CITIES> </REGION> |
|
|
|
|
|
#4 |
|
OOTP Developer
Join Date: Jun 2009
Location: Here and there
Posts: 16,254
|
OK, REGION_CITY should work, but right now in the parser, each region needs at least one state or nation or else it gets ignored. So if you add in an empty state, I think that should work.
|
|
|
|
|
|
#5 |
|
Minors (Double A)
Join Date: May 2002
Location: Granby, CT
Posts: 176
|
Thanks. I can confirm that works.
|
|
|
|
![]() |
| Bookmarks |
|
|