Quantcast

Easy way to create territoryAttachments for XML?

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Easy way to create territoryAttachments for XML?

Frostion
This post was updated on .
I am working on a new WW2 map (details will be revealed soon! ).

I am mostly done with the graphics and the txt files. I am in the process of building the XML file. Until now I have built the file by hand manually. I also pasted in generated Territory Definitions and Territory Connections.

Is there also an easy way to auto generate all the territoryAttachments of the XML? Some easy way to generate them so they can be copy-pasted into the XML? Preferably with a Production = 0.

There are a total of 534 territories on the map (Land, Impassable, Lakes and Sea Zones). I think I did all my other maps in either Wisconsins v2 Map Creator or the hard way by manually pasting in names into “blank” territoryAttachments. I would hate to do this with 534 territories!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

crazy_german
I have done it before using excel. If you post a list of territories I can even do it for you

Its really annoying that the game crashes if a territory has no attachment, I see reason for it to do so
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
Thx, I would really appreciate that. I know very little excel. I will get back to you within the next few days. I guess I can give you a txt with all the names. Could you make use of a centers.txt without the coordinates behind the names? That would then be a long list of names, one name on every line. Or du I not even have to remove the coordinates? Maybe your script procedure could ignore them? Or maybe you can make a script that deletes the coordinates in the centers.txt? That would save me a lot of work also.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

crazy_german
Yea if you want just post the centers, its easy to extract the names and put them into excel.
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Cernel
In reply to this post by Frostion
Since WaW has 538 territories, Jurassic 624, and Domination 672, I guess this will qualify has the 4th biggest map of TripleA, but you can reach 3rd position by just adding 5 territories more!
(I'm not counting Apocalypse2012 (639), Domination_1914_Blood_And_Steel, nor Domination_1914_No_Mans_Land, as they are modified versions of Domination)

Rawest way is to just take the territory definitions, in note pad, and mass-change
<territory name="
to
<attachment name="territoryAttachment" attachTo="

mass change both
" water="true"/>
and
"/>
to
" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory"> ... </attachment>
And having the various option names instead of "...". Tho normal layout is to put an end line before and after each one, this is not needed.

More advanced stuff would involve using excel, macros, or some programs I don't know. I guess there should be programs allowing you to substitute a line with multiple, but notepad is not one of those, afaik.
I guess you should be easily able to find such programs, as this seems some basic stuff.
Alternatively, you could create lines via pasting html endline definitions, and then copy paste what you get from a html page display.

Since this looks like having the same dimensions as WaW, I hope you went for a more geographic consistent representation, like for example Moscow and Vladivostok being much farther away than Moscow and Berlin. Also, since stacking is mostly linear, big maps have the common issue of ending up with 200+ units stack, indefinitively increasing, which I think it's dumb; I hope you have devised some ways (upkeep costs ftw) to stop this happening. Just some off topics.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
In reply to this post by Frostion
@Cernel
I could add 5 more territories with ease. There are no HUGE land territories, but there are some large in the Americas that could be broken up. But I think I will try out the map before doing this. I wouldn’t make that change just to get the map up the size list

There are 534 lines in the centers, but there are actually three more islands (aprox.) that in the game just shares centers with some bigger islands. So it is more like 537 territories.

The geography is more “normal” in its dimensions than other TripleA maps, kind of like the Age of tribes map, but with larger territories. USSR is huge and consists of very many territories. The map has the same disproportionate misleading dimensions as most ordinary non-tripleA world maps, making Canada and USSR bigger than what it really is, but I think it is of no consequence. I see most northern and plentiful territories as a simulation of how hard and difficult it would be to march an army across the most northern part of earth in real life.

@Crazy_German
Here is the centers file. (right click to download)
centers.txt

I imagine that all land attachments could look like this (names not ending with “Sea Zone”):

        <attachment name="territoryAttachment" attachTo="???" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
            <option name="production" value="1"/>
        </attachment>

I imagine that all sea zone attachments could look like this (names ending with “Sea Zone”):

        <attachment name="territoryAttachment" attachTo="???" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
            <option name="originalOwner" value="Neutral"/>
            <option name="production" value="0"/>
        </attachment>

I have used the OriginalOwner on my latest maps’ sea territories (Dragon War, Star Trek and Age of Tribes). If this is set, then there is a sea capture sound when sailing into the territory. If no original owner, no capture sounds. On the star trek map it is warp speed sound and on the other maps it is water/sea/ocean sounds. It would be cool to have this also on this new map. Also I think the nukes of Age of Tribes demands this to work, and the Sea Dragon of Dragon War also needs it to be capturable.

I plan to have plain old passive neutrals on the map, but can they “own” territories from start? Will the OriginalOwner even work with them? Or will I have to name a player “Neutral” or “AI-Neutral” to make this work?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

crazy_german
There is no reason to ever set owner="Neutral", and I think it will produce an error (neutral is basically ownerless). If you want active neutral countries, you want to set them up as AI controlled nations like you did in Age of Tribes. I'm pretty sure you don't need originalOwner for those nukes to work, you just need the territory to have an owner at the beginning of the game (set a value in the ownerInitialize section)

Sea Zones don't normally need a territory attachment, unless you want them to have owners. Its much easier to edit if the names began with Sea Zone (instead of ending with it), but I got it to work.

Here are the territory attachments for sea zones. I left out the original owner because I'm quite sure you don't need it.
SeaZoneAttachments.txt

And here it is for land territories, all production set to 1.
LandAttachments.txt

I always like your maps and I'm very excited for another one! Let me know if I help more, I have an excel sheet set up which you can just plug in a centers file and it will create everything you need in an XML (like if you don't want to set water="true" by hand, I could do it in less than a minute)
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
@Crazy German
Would you please help out again? You know I will have flag pole like structures on my WW2 map called SS-Potential, and that they will generate 1 SS resource for the Germans to use. The SS-Potential can be captured by other Axis powers when attacking Allied controled territories with SS-Potential, so I need a condition and two triggers for every land territory, so that they will always be given to Germany after an axis capture of an SS-Potential. I got a working trigger and I would like you to create a trigger set for every land territory on the map.

This txt here is a list with all land territories (some names have changed since last), meaning no lakes and sea zones:
AllLandTerritoriesCenters.txt

This is the trigger that seems to do the job (??? Is written in place of territory names):
ConditionAndTrigger.txt

PS: Last time I had to “clean” the text you made and get rid of all tab-key spaces, thought I think it did not prevent the code from working. Maybe it was I that left some tabs in the text, or maybe you had used them. I would like to just use spaces. The text posted here should be clean of such tab things, and I hope you can duplicate it without tabs?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Cernel
Maybe better if you just give the list:

Abyysky
Aden
Afghanistan
Aklavik
Aktau
Aktobe
Albania
Alberta
Aldan
Algeria
Algerian Desert
Alice Springs
Altai
Amazonas
Ambon
Amoy
Amu River
Khabarovsk
Anadyr
Andaman
Andes
Ankara
Archangel
Arctic Canada
Arctic Greenland
Arctic USSR
Argentina
Aru
Astana
Attu
Austria-Bohemia
Ayan
Baffin
Baltic States
Bamako
Bartsk
Bashkortostan
Bechuanaland
Beira
Benelux
Bengal
Berlin
Bolivia
Boothia
Borneo
Brazil
British Columbia
British Guiana
Buenos Aires
Bulgaria
Burma
Burma Road
Buryat
Buzuluk
Byelorussia
Calgary
California
Cameroon
Campo Grande
Canadian Northwest
Cape Horn
Caucasus
Celebes
Central America
India
Central Russia
Central Turkey
Chad
Changsha
Chile
Chita
Chokurdakh
Chukotsky
Chungking
Colombia
Ceylon
Corsica
Crete
Croatia
Cuba
Cyprus
Dagestan
Dahomey
Darwin
Denmark
Dikson
Dutch Guiana
Dutch Harbor
East Prussia
Eastern Alaska
Eastern Angola
Eastern Finland
Eastern Greenland
Eastern Mongolia
Eastern Tibet
Eastern Turkey
Eastern Turkistan
Eastern Ukraine
Ecuador
Egypt
El Alamein
England
Equatorial Africa
Eritrea
Ethiopia
Evenkia
Faroe
Fiji
Finland
Flores
France
French Guiana
French India
French Indochina
Gabon
Galapagos
Gibraltar
Gizhiga
Gobi Desert
Gold Coast
Goldfields-Esperance
Gorki
Gotland
Great Plains
Greece
Guadalcanal
Guam
Guinea
Gulf Coast
Hailar
Hainan
Halifax
Halmahera
Hanoi
Hawaii
Hebrides
Himalayas
Hispaniola
Hokkaido
Hong Kong
Hsinking
Hungary
Iceland
Iran
Iraq
Ireland
Irkutsk
Istanbul
Italy
Ivory Coast
Iwo Jima
Jamaica
Japan
Java
Jehol
Jezkazgan
Kamchatka
Karagandy
Karakalpakstan
Karelia
Xinjiang
Kenya
Kerman
Khakassia
Khanatia
Khatanga
Khorasan
Kimberley-Pilbara
Kolyma
Komi
Korea
Kostanay
Krasnodar
Krasnoyarsk
Siberia
Kuwait
Almaty
Labrador
Lanchow
Lapland
Leningrad
Lensk
Lhasa
Sierra Leone
Libya
Libyan Desert
Lindi
Lower Burma
Luzon
Madagascar
Magadan
Malaya
Mallorca
Manitoba
Mansia
Mato Grosso
Mauritania
Mecca
Melbourne
Melville
Mexico City
Mid-West-Gascoyne
Midway
Mindanao
Montana
Morocco
Moscow
Mozambique
Murmansk
Namaqualand
Naryan-Mar
Nayba
Nenets
Nepal
New Britain
New Caledonia
New Hebrides
Newfoundland
Nigeria
Nikolaevsk
Nizhniye Kresty
Nordeste
Normandy
Norrland
North Borneo
North Island
North Queensland
North Sudan
Northern Congo
Northern Ireland
Northern Mexico
Northern Spain
Northern Tibet
Norway
Novosibirsk
Nubian Desert
Okinawa
Oman
Ontario
Orissa
Orkney
Oskemen
Palau
Palawan
Panama Canal
Panama City
Papua New Guinea
Para
Paraguay
Patagonia
Pavlodar
Peking
Peru
Portugal
Pretoria
Puerto Rico
Punjab
Quebec
Vladivostok
Rhodesia
Riyadh
Romania
Ryojun
Sahara Desert
Saipan
Sakha
Sakhalin
Samara
Sao Paulo
Sardinia
Saskatchewan
Scotland
Senegal
Shanghai
Shetland
Sicily
Sind
Qinghai
Slovakia
Solomon
Somalia
Somaliland
South Africa
South Australia
South Island
South Queensland
South Sudan
Southern Alaska
Southern Congo
Southern Greenland
Southern Mongolia
Southern Thailand
Spain
Stalingrad
Sumatra
Sumbawa
Svealand
Sverdlovsk
Sweden
Switzerland
Sydney
Syria
Formosa
Kashgar
Tanganyika
Tangier
Tasmania
Tatarstan
Taymyria
Texas
Thailand
Tien Shan
Timor
Tobruk
Toronto
Transjordan
Troms-Finnmark
Trondheim-Narvik
Tsitsihar
Tunesia
Tuvan
Ubangi-Shari
Uelen
Uganda
Ulan Bator
Ungave
United Provinces
Ural
Atyrau
Urimchi
Uruguay
USA Central
USA Midwest
USA North
USA North Atlantic
USA Northwest
USA South Atlantic
USA Southwest
Ust-Maysky
Uzbekistan
Venezuela
Vichy
Victoria
Visayas
Amur
Volga
Wabakimi
Wake
West Africa
West Germany
Western Alaska
Western Angola
Western Greenland
Western Mongolia
Western New Guinea
Western Tibet
Western Turkistan
Western Ukraine
Yakutia
Yakutsk
Yamalia
Yellowknife
Yemen
Yucatan

Also, if you are making a WWII map, I see that you have used several names that didn't exist or weren't really cool during WWII. I really suggest using a map printed during or shortly before WWII, when choosing names (don't trust historical maps, only originals!). Since I can see several names that were invented or introduced after WWII, I guess you have many others I don't see, as well. It really looks like you have used a map made not before the ninth decade of the XX century.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Cernel
In reply to this post by Frostion
Anyways, I'll go ahead (didn't test; so there may be bugs; in case, just find what the bugged line number is and correct it):

20160910_Frostion.txt
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
In reply to this post by Cernel
Well, I have a limited collection of WW2 era maps and many names have been based on them, but you are welcome to list or mark the names you find problematic. Maybe you can edit the list above and set a * at the end of such territory names. You don’t need to comment on the names, especially if there are many names in need of change. But OK if you do. When you have marked the names, then I can investigate.

PS: This has no influence on my request concerning a bunch of conditions and triggers with the above names!  I can always keep on changing names after the conditions and triggers have been generated and pasted into the XML.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

crazy_german
Checking the forum on my phone, funny enough I actually just did those exact things yesterday for a map I'm working on. The unit initiate section is very easy and I can have it done in like 5 minutes (once I'm home on my computer)

Those triggers should also be fairly easy. If I am reading correctly-
If another axis takes a territory, and an SS-potential is in the territory, it gets removed and a german SS-potential is placed. Just FYI, you don't need to separate those into 2 triggers, but if you want it that way its fine. Can you post something that is formatted exactly how you want it for me to copy (is that txt already done like that?)
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
@Crazy German
You are working on a map? Interesting! :-D
When I tested it out, it seemed that I did need two triggers; one for removing the non-german SS-Potential (as it was looking for german units per default and I had to state all the non-german axis players) and one trigger for placing the german owned SS-Potential, that would need the German player info.

When the remove and place were in the same trigger, and the trigger headline stated player "Germany", the trigger did not remove the non-german unit, it only placed the new German unit. Then the territory ended up with two units.
If you know how to make the trigger shorter, then plz share.

The unit SS-Potential can ATM be owned by Allies also, so I think that the triggers I made are good. Even if/when I make the unit be whenCaptureTurnsInto a new allied version that does not produce, and turn back when in axis hands, the triggers I made should still work unaffected.

(I know that the second trigger states Germany two times, in the headline and in the trigger itself, but that was mostly to make let people know what was happening when they looked at the code in the xml.

But yes, I did imagine that the tekst I sent you was the one that should be copied. (unless you have an idea of a better trigger)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

crazy_german
Just a heads up, your map has 364 land territories, which with the triggers you posted would mean 11,000 lines of code, in my experience this enough to slow the game down a little bit (that's 1/3 the length of TWW). So I think shortening the triggers would be a good move

I would remove the uneeded player=Germany line. Also, if you want, you can condense the removal triggers to just 1 trigger for the entire globe.

Yes Im working on a large scale WW1 map, which also has a flag in every territory to set off my own triggers.

PS-are you sure you need a unit, and you don't want to just give each territory an income of 1 SS?
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
Ok, lets remove the "player germany line", it works just as well without that line.

I would like to start out the development of this map WITH this SS-Potential unit instead of fixed territory SS income. Partly because it makes room for easy edits, balance experimentation and also it would allow easy modding of the map in the future, like different start setups.

Age of Tribes is like 20.000 lines, so I don't expect too much slowing down because of this. But I have already experianced a bit lacky loading of graphics. I don't know if it is because of the AI's thinkng process, but I personally suspect it is because of the 987 relief tiles made out of the 12000 pixels wide base image.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

crazy_german
Was busy with work this weekend, here are your triggers-
Frostion_Conditions.txt
FrostionTriggers.txt

I briefly tested them, I think it should work (of course I'm still getting errors because I don't have the rest of the XML). BTW, you can't use spaces in trigger or condition names, so for territories with a space in their name I put an underscore (this is why Cernel's attempt earlier on won't work)

For removing, rather than write 300 triggers you can use just 1 condition and 1 trigger, which I put here. Let me know if this doesn't work-
RemovalTriggerAndConditon.txt

Just to confirm, these are only going to work if there is a max of 1 SS-Potential per territory
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Easy way to create territoryAttachments for XML?

Frostion
Yes, max 1 SS-Potential per territory is what I aim for right now (Even though it breaks with history showing some areas supplying ten times more SS than others). I will try out your work, when I have time. Thanks!
Loading...