C2C - mass XML changes parser

@TB

Thanks i will use it for test.
NOw i working on UI improvements

NEW UPDATE

  • added ability to search via multiple values in select list
  • added ability to search in select list values via jquery plugin
  • added suporrt for logic OR - ||

Note that now thanks for logic operator || (OR) you can search for example all archer and bow in unit name by"
'archer || bow'
So if you want all archer and bow units from mounted to chec bombard accuracy you can use this query (extracted from URL)
?Class=archer+||+bow&Combat[]=UNITCOMBAT_MOUNTED

NEXT what i plan to do is add abiity to adding subtags (ex subcombat classes) inline
 
Something you might want to work into your program... As you'll notice on the Unit Assignments page there, I've included the file path to find the proper xml entry for each particular unit. (That took forever to arrange btw!) Each of these file paths begins with Assets (much earlier on the path and you may have some variance from one system to the next and from Firaxis Games through to Assets are the same for every entry.) You might want to try to make it so that the program can seek and find the file then update then go to the next line and repeat until it finds no more entries. That would make things a lot easier for you if you could work that in.
 
@TB
I can do that. I will after mass changes from csv will be added.

You should hire someone to help with subcombats in google doc.
 
Ok i working on new funcion.

Copy to CFC currently displayed and checked resuls. Output looks like here

Type | Capture | Combat | SubCombatTypes |
UNIT_SCRAMJET |NONE |UNITCOMBAT_STEALTH |UNITCOMBAT_COMBATANT |
UNIT_HAND_RAM |UNITCLASS_HAND_RAM |UNITCOMBAT_SIEGE |UNITCOMBAT_COMBATANT |
UNIT_BATTERING_RAM |UNITCLASS_BATTERING_RAM |UNITCOMBAT_SIEGE |UNITCOMBAT_COMBATANT |
UNIT_SIEGE_RAM |UNITCLASS_SIEGE_RAM |UNITCOMBAT_SIEGE |UNITCOMBAT_COMBATANT |
UNIT_SEMIRAMIS |NONE |UNITCOMBAT_HERO |UNITCOMBAT_MELEE UNITCOMBAT_COMBATANT |
 
@Thunderbrd
I've included the file path to find the proper xml entry for each particular unit. (That took forever to arrange btw!)
Please say, when you need such things. I have not too much time, indeed. But this is maybe 10 minutes of work for me. -- Of course, if you don't enjoy this kind of stuff. :)

@Nimek
You said: php is slow to read XML. - look how fast it is now
Have I drunken too much tea again? I can't recall it. Anyway, are you tweaking speed in your script just to show me, how fast php is?
60fd5c9dc150771d9573b775bd316682_1325806541.jpg


You said: does your XML parser will be able to read TrainCondition and other heavy nested tags - now it is
You said: does it can to add +2 or +20% to each selected item - work in progress - it will
That is good. But as I said, you can do anything, if you create a specific code for it. The problem I meant is, you are overdoing it this way. And the second thing is, if there will be a functionality needed which you would not program and you will be nowhere around to add it, what then? And the third, some powers of XSLT are beyond yours, even if you would try to write a specific code to cover them, I believe. ;)

Note that now thanks for logic operator || (OR) you can search for example all archer and bow in unit name by"
'archer || bow'
So if you want all archer and bow units from mounted to chec bombard accuracy you can use this query (extracted from URL)
?Class=archer+||+bow&Combat[]=UNITCOMBAT_MOUNTED
Are you reimplementing XPath?
 
NEW UPDATES

  • UI improvements
  • add copy to CFC button

Note that copy button respects table order and checked rows

@n47

I am not perfect and My parser will also not be perfect but it will make a lot of things much easier than now.
I know that i could use Xpath but i dont do it at the begining of this project so maybe in future i will use it.

Now I am focusing on good UI and useful things like copy to CFC forum.
 
@TB
I can do that. I will after mass changes from csv will be added.

You should hire someone to help with subcombats in google doc.
Cool! And yeah, I could use some help but it's pretty monotonous stuff. Hydro has pitched in. And if anyone else is willing I can discuss how they can help with them if they simply pm me or ask on the first Combat Mod introduction thread.

@Thunderbrd

Please say, when you need such things. I have not too much time, indeed. But this is maybe 10 minutes of work for me. -- Of course, if you don't enjoy this kind of stuff. :)
Meh... I did it while I was connecting the names to the xml <Type> tags. Yeah, I'm sure there was a more 'automated' way to do that but I'm not the type to just ask for something like all that to be done and sit back and wait - particularly when it not having been done would hold me up. It was just a routine and monotonous task is all.

What you may be able to help me with is developing something that can double check the list to make sure it's accurate where the file paths are concerned and to cross reference our entire xml modules to make sure that ALL units are included on our list - something to run to double check that we haven't added, removed, or moved a unit definition. Mind... such a tool would also have to somehow differentiate second and third unit definitions that were created to add an optional element to the unit in modular format. I dunno... would be an interesting project I'd like to see how you could make work.

Also... are you so sure that your XSLT and such that you're talking about would be able to work so well with our modular environment? I tried working with Excell to interface with our XML and found it produced unusual results thanks to our modularization making things a little difficult for it. So I'm thinking even one who's accomplished with this program or method or whatever it is that XSLT IS would have some work cut out for them to make it operate correctly for us. Keep in mind I say this having no concept whatsoever of what you mean when you refer to XSLT. Perhaps it would be helpful to share a little education on what the subject even refers to.
 
@TB
Dont add this file paths now. Once tag name column will be fulfilled filepath will be easy to add from parser.

Please give me filepaths to all files where unit are stored.
 
Meh... I did it while I was connecting the names to the xml <Type> tags. Yeah, I'm sure there was a more 'automated' way to do that but I'm not the type to just ask for something like all that to be done and sit back and wait - particularly when it not having been done would hold me up. It was just a routine and monotonous task is all.

What you may be able to help me with is developing something that can double check the list to make sure it's accurate where the file paths are concerned and to cross reference our entire xml modules to make sure that ALL units are included on our list - something to run to double check that we haven't added, removed, or moved a unit definition. Mind... such a tool would also have to somehow differentiate second and third unit definitions that were created to add an optional element to the unit in modular format. I dunno... would be an interesting project I'd like to see how you could make work.
Show me the file. (And I will tell you your destiny, my young ... or maybe not ... brave knight. :D ) And I would like to know, how do you want to take module units redefinitions into the list. Isn't that modules can be turned on and off?

Also... are you so sure that your XSLT and such that you're talking about would be able to work so well with our modular environment? I tried working with Excell to interface with our XML and found it produced unusual results thanks to our modularization making things a little difficult for it. So I'm thinking even one who's accomplished with this program or method or whatever it is that XSLT IS would have some work cut out for them to make it operate correctly for us. Keep in mind I say this having no concept whatsoever of what you mean when you refer to XSLT. Perhaps it would be helpful to share a little education on what the subject even refers to.
It isn't mine. ;) It is one of XML extension languages. The one designed for XML transformations, so this what we exactly do here. XSLT is indeed designed to work one file at once. But when we would like to transform some tag (like modify its values), we will probably expect to the result of it be in the same file, so I guess there would not much problems about it.

Yea, yea, I know. No one will like to learn now a some XML extension language. But the thing is, we could put it in the middle. Between users and the engine of the editor. The big picture could look somehow like this in the attachment.

So someone who would want to learn XSLT would be able to write translation code and use everything what XSLT offers or use together with others more user-friendly GUI, like this what Nimek is hardly working on in his kitchen. Well, except building his own refrigerator. (You know, buying ready solutions is for sissies.)
 

Attachments

  • big_pic_xslt_editor.jpg
    big_pic_xslt_editor.jpg
    48.7 KB · Views: 76
@TB

Dont add filepaths at all.
After rethink my entire system I have an idea how to easy tweak it to work with multiple files at once.

So you will be able to search/edit mass edit or update fields by csv import with all files at once.

Thats why I need filepaths for all units files for test reasons.

EDIT

Great news guys first test proved that my parser works great with multiple files.
I developed core to suport multiple files new only UI and edit tweaks and viola :)
 
@Nimek: If you'd take a look at the google doc in my sig line (Combat Class plans - it's a link) you'd see that what you're asking me to do (and not do) is already done there on the unit assignments page.

@n47: You asked me to show you the file... same reference. I just would like something that could double-check the base file paths and such on that page to make sure it's all still accurate as things can be changed by other users during planning.
 
@TB, this is what came. But as I've said, I do not know how to treat extensions defined in modules, so they just appear as lacking.

Subdued animals are cased by the ".xm" extension.

Code:
*** bad enries ***
Assets\XML\Units\CIV4UnitInfos.xml
	119: UNIT_BULLDOZER
	629: UNIT_MOTAR
	829: TXT_KEY_UNIT_QUINQUEREME
	1096: UNIT_GWANGGAETO
	1169: UNIT_ABAOJI
Assets\Modules\Custom_Religions\Tengri\Tengri_CIV4UnitInfos.xml
	276: UNIT_UNDEAD_WORKER
	971: UNIT_VOODOO_MISSIONARY
Assets\Modules\DancingHoskuld\Subdue_Animals\Subdue_Animals_CIV4UnitInfos.xm
	7: UNIT_SUBDUED_AARDVARK
	29: UNIT_SUBDUED_ANTEATER
	52: UNIT_SUBDUED_COW
	59: UNIT_SUBDUED_BADGER
	62: UNIT_SUBDUED_BALLPYTHON
	72: UNIT_SUBDUED_BARBARYAPE
	79: UNIT_SUBDUED_BEAR
	85: UNIT_SUBDUED_BEAVER
	87: UNIT_SUBDUED_BELUGA
	89: UNIT_SUBDUED_BENGALTIGER
	93: UNIT_BIG_GAME_HUNTER
	97: UNIT_SUBDUED_BISON
	100: UNIT_SUBDUED_BLACKBEAR
	111: UNIT_SUBDUED_BONGO
	123: UNIT_SUBDUED_CAMEL
	140: UNIT_SUBDUED_CAPUCHIN
	142: UNIT_SUBDUED_CAPYBARA
	148: UNIT_SUBDUED_CARIBOU
	153: UNIT_SUBDUED_CASSOWARY
	159: UNIT_SUBDUED_CAVEBEAR
	161: UNIT_SUBDUED_CAVE_LION
	169: UNIT_SUBDUED_CHEETAH
	173: UNIT_SUBDUED_CHIMPANZEE
	185: UNIT_SUBDUED_COBRA
	187: UNIT_SUBDUED_COD
	198: UNIT_SUBDUED_CRAB
	207: UNIT_SUBDUED_CROW
	217: UNIT_SUBDUED_DARTFROG
	224: UNIT_SUBDUED_DESERT_TORTOISE
	228: UNIT_SUBDUED_DIREWOLF
	233: UNIT_SUBDUED_DOLPHIN
	246: UNIT_SUBDUED_DUCK
	248: UNIT_SUBDUED_DUGONG
	336: UNIT_GAME_HUNTER
	444: UNIT_HUNTER
	623: UNIT_SUBDUED_ASIANBEAR
	668: UNIT_SUBDUED_DONKEY
	710: UNIT_SUBDUED_PIG_NEW
	755: UNIT_RANGER
	935: UNIT_TRACKER
	950: UNIT_SUBDUED_TUNA
	1002: UNIT_SUBDUED_WARTHOG
	1004: UNIT_SUBDUED_BUFFALO
	1010: UNIT_SUBDUED_BOAR
	1012: UNIT_SUBDUED_TURKEY


*** lacking enries ***
Assets\Modules\Custom_Religions\Yoruba\Yoruba_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Shaman\Shaman_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Ngai\Ngai_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\NomadDemo\NomadDemo_CIV4UnitInfos.xml
	UNIT_BAND
Assets\Modules\OrionsMods\Aviation\Aviation_CIV4UnitInfos.xml
	UNIT_JET_FIGHTER
	UNIT_FIGHTER
Assets\Modules\Vokarya\Wonders\WarholFactory\WarholFactory_Civ4UnitInfos.xml
	UNIT_ARTIST
Assets\Modules\Alt_Timelines\MegaFauna\Mammoths\Paleolithic_CIV4UnitInfos.xml
	UNIT_SUBDUED_MAMMOTH
Assets\Modules\Alt_Timelines\MegaFauna\Sabretooth\ExoticAnimals-0.3_CIV4UnitInfos.xml
	UNIT_SABRETOOTH
	UNIT_SABRETOOTH
Assets\Modules\Custom_Religions\Jainism\Jainism_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\DeerRider\DeerRider_CIV4UnitInfos.xml
	UNIT_SUBDUED_STAG_DEER
	UNIT_SUBDUED_MOOSE
	UNIT_SUBDUED_CARIBOU
Assets\Modules\Alt_Timelines\Beastmaster\Beastmaster_CIV4UnitInfos.xml
	UNIT_SUBDUED_ASIANBEAR
	UNIT_SUBDUED_BEAR
	UNIT_SUBDUED_BENGALTIGER
	UNIT_SUBDUED_BLACKBEAR
	UNIT_SUBDUED_CAVEBEAR
	UNIT_SUBDUED_CAVE_LION
	UNIT_SUBDUED_CHEETAH
	UNIT_SUBDUED_DIREWOLF
	UNIT_SUBDUED_JAGUAR
	UNIT_SUBDUED_LION
	UNIT_SUBDUED_LION_PACK
	UNIT_SUBDUED_LYNX
	UNIT_SUBDUED_PANDA_BEAR
	UNIT_SUBDUED_PANTHER
	UNIT_SUBDUED_POLARBEAR
	UNIT_SUBDUED_REDFOX
	UNIT_SUBDUED_SIBERIANTIGER
	UNIT_SUBDUED_SLOTHBEAR
	UNIT_SUBDUED_SNOWLEOPARD
	UNIT_SUBDUED_SPECTACLEDBEAR
	UNIT_SUBDUED_SUNBEAR
Assets\Modules\Custom_Religions\Andean\Andean_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\My_Mods (unloaded)\SlowReligionSpread\philipschall_CIV4UnitInfos.xml
	UNIT_ANDEAN_MISSIONARY
	UNIT_ASATRU_MISSIONARY
	UNIT_CANAANITE_MISSIONARY
	UNIT_DRUID_MISSIONARY
	UNIT_JAINISM_MISSIONARY
	UNIT_MESO_MISSIONARY
	UNIT_NGAI_MISSIONARY
	UNIT_SHAMAN_MISSIONARY
	UNIT_SHINTO_MISSIONARY
	UNIT_TENGRI_MISSIONARY
	UNIT_VOODOO_MISSIONARY
	UNIT_YORUBA_MISSIONARY
Assets\Modules\Alt_Timelines\Beastmaster\Beastmaster_Upgrades_CIV4UnitInfos.xml
	UNIT_TAMED_PANTHER
	UNIT_TAMED_LION
	UNIT_TAMED_BEAR
	UNIT_TAMED_WOLF
Assets\Modules\Alt_Timelines\MegaFauna\Rhinoceros\Rhinoceros_CIV4UnitInfos.xml
	UNIT_SUBDUED_RHINO
Assets\Modules\Custom_Religions\Asatru\Asatru_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\DancingHoskuld\Subdue_Animals\Subdue_Animals_CIV4UnitInfos.xml
	UNIT_SCOUT
	UNIT_TRACKER
	UNIT_HUNTER
	UNIT_RANGER
	UNIT_GAME_HUNTER
	UNIT_BIG_GAME_HUNTER
	UNIT_SUBDUED_AARDVARK
	UNIT_SUBDUED_ANTEATER
	UNIT_SUBDUED_BADGER
	UNIT_SUBDUED_BALLPYTHON
	UNIT_SUBDUED_BARBARYAPE
	UNIT_SUBDUED_ASIANBEAR
	UNIT_SUBDUED_BEAR
	UNIT_SUBDUED_BEAVER
	UNIT_SUBDUED_BELUGA
	UNIT_SUBDUED_BENGALTIGER
	UNIT_SUBDUED_BISON
	UNIT_SUBDUED_BLACKBEAR
	UNIT_SUBDUED_BOAR
	UNIT_SUBDUED_PIG_NEW
	UNIT_SUBDUED_WARTHOG
	UNIT_SUBDUED_BONGO
	UNIT_SUBDUED_BUFFALO
	UNIT_SUBDUED_CAMEL
	UNIT_SUBDUED_CAPUCHIN
	UNIT_SUBDUED_CAPYBARA
	UNIT_SUBDUED_CARIBOU
	UNIT_SUBDUED_CASSOWARY
	UNIT_SUBDUED_CAVEBEAR
	UNIT_SUBDUED_CAVE_LION
	UNIT_SUBDUED_CHEETAH
	UNIT_SUBDUED_CHIMPANZEE
	UNIT_SUBDUED_COBRA
	UNIT_SUBDUED_COD
	UNIT_SUBDUED_COW
	UNIT_SUBDUED_CRAB
	UNIT_SUBDUED_CROW
	UNIT_SUBDUED_DARTFROG
	UNIT_SUBDUED_DESERT_TORTOISE
	UNIT_SUBDUED_DIREWOLF
	UNIT_SUBDUED_DOLPHIN
	UNIT_SUBDUED_DONKEY
	UNIT_SUBDUED_DUCK
	UNIT_SUBDUED_DUGONG
	UNIT_SUBDUED_TUNA
	UNIT_SUBDUED_TURKEY
	UNIT_GREAT_GENERAL
Assets\Modules\Custom_Religions\Mesopotamian\Mesopotamian_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\Giraffe_Archer\GiraffeArcher_CIV4UnitInfos.xml
	UNIT_SUBDUED_GIRAFFE
Assets\Modules\Alt_Timelines\MegaFauna\Bison_Rider\BisonRider_CIV4UnitInfos.xml
	UNIT_SUBDUED_BISON
Assets\Modules\Modifieda4\Basic_Solar_Panels\Solar_CIV4UnitInfos.xml
	UNIT_WORKER_INDUSTRIAL
	UNIT_WORKER_MODERN
	UNIT_CLONES
	UNIT_WORKER_ANDROID
Assets\Modules\Custom_Religions\Bahai\Bahai_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Vokarya\Wonders\Bauhaus\Bauhaus_CIV4UnitInfos.xml
	UNIT_ARTIST
Assets\Modules\Custom_Religions\Canaanism\Canaanism_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Mormon\Mormon_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Scientology\Scientology_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\DancingHoskuld\Captives\GP_CIV4UnitInfos.xml
	UNIT_TRIBE
	UNIT_SETTLER
	UNIT_COLONIST
	UNIT_PIONEER
	UNIT_PROPHET
	UNIT_ARTIST
	UNIT_SCIENTIST
	UNIT_MERCHANT
	UNIT_ENGINEER
	UNIT_GREAT_GENERAL
	UNIT_GREAT_SPY
	UNIT_GREAT_DOCTOR
	UNIT_ZOROASTRIAN_MISSIONARY
	UNIT_LAWYER
Assets\Modules\Custom_Religions\Tengri\Tengri_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Shinto\Shinto_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Druid\Druid_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\Big_Cats\BIG_CATS_CIV4UnitInfos.xml
	UNIT_SUBDUED_BENGALTIGER
	UNIT_SUBDUED_CAVE_LION
	UNIT_SUBDUED_CHEETAH
	UNIT_SUBDUED_JAGUAR
	UNIT_SUBDUED_LION
	UNIT_SUBDUED_LION_PACK
	UNIT_SUBDUED_LYNX
	UNIT_SUBDUED_PANTHER
	UNIT_SUBDUED_SIBERIANTIGER
	UNIT_SUBDUED_SNOWLEOPARD
Assets\Modules\Custom_Religions\Sikh\Sikh_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\XML\Units\CIV4UnitInfos.xml
	UNIT_QUINQUEREME
	UNIT_GREAT_BOMBARD
	UNIT_BARBAROSSA
	UNIT_SPARTACUS
Assets\Modules\Custom_Religions\Voodoo\Voodoo_CIV4UnitInfos.xml
	UNIT_UNDEAD_WORKER
	UNIT_VOODOO_MISSIONARY
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\Bear_Rider\bearrider_CIV4UnitInfos.xml
	UNIT_SUBDUED_BEAR
	UNIT_SUBDUED_POLARBEAR
	UNIT_SUBDUED_CAVEBEAR
	UNIT_SUBDUED_PANDA_BEAR
	UNIT_SUBDUED_ASIANBEAR
	UNIT_SUBDUED_BLACKBEAR
	UNIT_SUBDUED_SLOTHBEAR
	UNIT_SUBDUED_SPECTACLEDBEAR
	UNIT_SUBDUED_SUNBEAR
	UNIT_SUBDUED_GRIZZLY
Assets\Modules\Natural_Wonders\NaturalWonder_CIV4UnitInfos.xml
	UNIT_MODERN_WORKBOAT
	UNIT_CONSTRUCT_SHIP
Assets\Modules\Modifieda4\Basic_Forestry\BasicForestry_CIV4UnitInfos.xml
	UNIT_WORKER
	UNIT_WORKANIMAL
	UNIT_WORKMULE
	UNIT_WORKELEPHANT
	UNIT_WORKBUFFALO
	UNIT_WORKER_INDUSTRIAL
	UNIT_WORKER_MODERN
	UNIT_CLONES
	UNIT_WORKER_ANDROID
	UNIT_WORKANIMAL
	UNIT_WORKMAMMOTH
	UNIT_WORKLLAMA
	UNIT_WORKCAMEL
	UNIT_UNDEAD_WORKER
 
Big update

  • added ability to read/edit multiple files at once (you can simply load more than one file)
  • added option to copy to google docs

Now you can for example load all units files and edit their tags inline. Parser will automaticly recognize with file you edit. You dont care about it at all :)

@n47

You doing great job in finding this bugs. Thanks :)
 
@Nimek, at your place, I think a better attitude would be.
SuperStock_2016-137.jpg


:p

But thank you... even if I can't see any greatness in just parsing XML files and calling a single XPath query. ;)
 
@TB, this is what came. But as I've said, I do not know how to treat extensions defined in modules, so they just appear as lacking.

Subdued animals are cased by the ".xm" extension.

Code:
*** bad enries ***
Assets\XML\Units\CIV4UnitInfos.xml
	119: UNIT_BULLDOZER
	629: UNIT_MOTAR
	829: TXT_KEY_UNIT_QUINQUEREME
	1096: UNIT_GWANGGAETO
	1169: UNIT_ABAOJI
Assets\Modules\Custom_Religions\Tengri\Tengri_CIV4UnitInfos.xml
	276: UNIT_UNDEAD_WORKER
	971: UNIT_VOODOO_MISSIONARY
Assets\Modules\DancingHoskuld\Subdue_Animals\Subdue_Animals_CIV4UnitInfos.xm
	7: UNIT_SUBDUED_AARDVARK
	29: UNIT_SUBDUED_ANTEATER
	52: UNIT_SUBDUED_COW
	59: UNIT_SUBDUED_BADGER
	62: UNIT_SUBDUED_BALLPYTHON
	72: UNIT_SUBDUED_BARBARYAPE
	79: UNIT_SUBDUED_BEAR
	85: UNIT_SUBDUED_BEAVER
	87: UNIT_SUBDUED_BELUGA
	89: UNIT_SUBDUED_BENGALTIGER
	93: UNIT_BIG_GAME_HUNTER
	97: UNIT_SUBDUED_BISON
	100: UNIT_SUBDUED_BLACKBEAR
	111: UNIT_SUBDUED_BONGO
	123: UNIT_SUBDUED_CAMEL
	140: UNIT_SUBDUED_CAPUCHIN
	142: UNIT_SUBDUED_CAPYBARA
	148: UNIT_SUBDUED_CARIBOU
	153: UNIT_SUBDUED_CASSOWARY
	159: UNIT_SUBDUED_CAVEBEAR
	161: UNIT_SUBDUED_CAVE_LION
	169: UNIT_SUBDUED_CHEETAH
	173: UNIT_SUBDUED_CHIMPANZEE
	185: UNIT_SUBDUED_COBRA
	187: UNIT_SUBDUED_COD
	198: UNIT_SUBDUED_CRAB
	207: UNIT_SUBDUED_CROW
	217: UNIT_SUBDUED_DARTFROG
	224: UNIT_SUBDUED_DESERT_TORTOISE
	228: UNIT_SUBDUED_DIREWOLF
	233: UNIT_SUBDUED_DOLPHIN
	246: UNIT_SUBDUED_DUCK
	248: UNIT_SUBDUED_DUGONG
	336: UNIT_GAME_HUNTER
	444: UNIT_HUNTER
	623: UNIT_SUBDUED_ASIANBEAR
	668: UNIT_SUBDUED_DONKEY
	710: UNIT_SUBDUED_PIG_NEW
	755: UNIT_RANGER
	935: UNIT_TRACKER
	950: UNIT_SUBDUED_TUNA
	1002: UNIT_SUBDUED_WARTHOG
	1004: UNIT_SUBDUED_BUFFALO
	1010: UNIT_SUBDUED_BOAR
	1012: UNIT_SUBDUED_TURKEY


*** lacking enries ***
Assets\Modules\Custom_Religions\Yoruba\Yoruba_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Shaman\Shaman_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Ngai\Ngai_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\NomadDemo\NomadDemo_CIV4UnitInfos.xml
	UNIT_BAND
Assets\Modules\OrionsMods\Aviation\Aviation_CIV4UnitInfos.xml
	UNIT_JET_FIGHTER
	UNIT_FIGHTER
Assets\Modules\Vokarya\Wonders\WarholFactory\WarholFactory_Civ4UnitInfos.xml
	UNIT_ARTIST
Assets\Modules\Alt_Timelines\MegaFauna\Mammoths\Paleolithic_CIV4UnitInfos.xml
	UNIT_SUBDUED_MAMMOTH
Assets\Modules\Alt_Timelines\MegaFauna\Sabretooth\ExoticAnimals-0.3_CIV4UnitInfos.xml
	UNIT_SABRETOOTH
	UNIT_SABRETOOTH
Assets\Modules\Custom_Religions\Jainism\Jainism_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\DeerRider\DeerRider_CIV4UnitInfos.xml
	UNIT_SUBDUED_STAG_DEER
	UNIT_SUBDUED_MOOSE
	UNIT_SUBDUED_CARIBOU
Assets\Modules\Alt_Timelines\Beastmaster\Beastmaster_CIV4UnitInfos.xml
	UNIT_SUBDUED_ASIANBEAR
	UNIT_SUBDUED_BEAR
	UNIT_SUBDUED_BENGALTIGER
	UNIT_SUBDUED_BLACKBEAR
	UNIT_SUBDUED_CAVEBEAR
	UNIT_SUBDUED_CAVE_LION
	UNIT_SUBDUED_CHEETAH
	UNIT_SUBDUED_DIREWOLF
	UNIT_SUBDUED_JAGUAR
	UNIT_SUBDUED_LION
	UNIT_SUBDUED_LION_PACK
	UNIT_SUBDUED_LYNX
	UNIT_SUBDUED_PANDA_BEAR
	UNIT_SUBDUED_PANTHER
	UNIT_SUBDUED_POLARBEAR
	UNIT_SUBDUED_REDFOX
	UNIT_SUBDUED_SIBERIANTIGER
	UNIT_SUBDUED_SLOTHBEAR
	UNIT_SUBDUED_SNOWLEOPARD
	UNIT_SUBDUED_SPECTACLEDBEAR
	UNIT_SUBDUED_SUNBEAR
Assets\Modules\Custom_Religions\Andean\Andean_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\My_Mods (unloaded)\SlowReligionSpread\philipschall_CIV4UnitInfos.xml
	UNIT_ANDEAN_MISSIONARY
	UNIT_ASATRU_MISSIONARY
	UNIT_CANAANITE_MISSIONARY
	UNIT_DRUID_MISSIONARY
	UNIT_JAINISM_MISSIONARY
	UNIT_MESO_MISSIONARY
	UNIT_NGAI_MISSIONARY
	UNIT_SHAMAN_MISSIONARY
	UNIT_SHINTO_MISSIONARY
	UNIT_TENGRI_MISSIONARY
	UNIT_VOODOO_MISSIONARY
	UNIT_YORUBA_MISSIONARY
Assets\Modules\Alt_Timelines\Beastmaster\Beastmaster_Upgrades_CIV4UnitInfos.xml
	UNIT_TAMED_PANTHER
	UNIT_TAMED_LION
	UNIT_TAMED_BEAR
	UNIT_TAMED_WOLF
Assets\Modules\Alt_Timelines\MegaFauna\Rhinoceros\Rhinoceros_CIV4UnitInfos.xml
	UNIT_SUBDUED_RHINO
Assets\Modules\Custom_Religions\Asatru\Asatru_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\DancingHoskuld\Subdue_Animals\Subdue_Animals_CIV4UnitInfos.xml
	UNIT_SCOUT
	UNIT_TRACKER
	UNIT_HUNTER
	UNIT_RANGER
	UNIT_GAME_HUNTER
	UNIT_BIG_GAME_HUNTER
	UNIT_SUBDUED_AARDVARK
	UNIT_SUBDUED_ANTEATER
	UNIT_SUBDUED_BADGER
	UNIT_SUBDUED_BALLPYTHON
	UNIT_SUBDUED_BARBARYAPE
	UNIT_SUBDUED_ASIANBEAR
	UNIT_SUBDUED_BEAR
	UNIT_SUBDUED_BEAVER
	UNIT_SUBDUED_BELUGA
	UNIT_SUBDUED_BENGALTIGER
	UNIT_SUBDUED_BISON
	UNIT_SUBDUED_BLACKBEAR
	UNIT_SUBDUED_BOAR
	UNIT_SUBDUED_PIG_NEW
	UNIT_SUBDUED_WARTHOG
	UNIT_SUBDUED_BONGO
	UNIT_SUBDUED_BUFFALO
	UNIT_SUBDUED_CAMEL
	UNIT_SUBDUED_CAPUCHIN
	UNIT_SUBDUED_CAPYBARA
	UNIT_SUBDUED_CARIBOU
	UNIT_SUBDUED_CASSOWARY
	UNIT_SUBDUED_CAVEBEAR
	UNIT_SUBDUED_CAVE_LION
	UNIT_SUBDUED_CHEETAH
	UNIT_SUBDUED_CHIMPANZEE
	UNIT_SUBDUED_COBRA
	UNIT_SUBDUED_COD
	UNIT_SUBDUED_COW
	UNIT_SUBDUED_CRAB
	UNIT_SUBDUED_CROW
	UNIT_SUBDUED_DARTFROG
	UNIT_SUBDUED_DESERT_TORTOISE
	UNIT_SUBDUED_DIREWOLF
	UNIT_SUBDUED_DOLPHIN
	UNIT_SUBDUED_DONKEY
	UNIT_SUBDUED_DUCK
	UNIT_SUBDUED_DUGONG
	UNIT_SUBDUED_TUNA
	UNIT_SUBDUED_TURKEY
	UNIT_GREAT_GENERAL
Assets\Modules\Custom_Religions\Mesopotamian\Mesopotamian_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\Giraffe_Archer\GiraffeArcher_CIV4UnitInfos.xml
	UNIT_SUBDUED_GIRAFFE
Assets\Modules\Alt_Timelines\MegaFauna\Bison_Rider\BisonRider_CIV4UnitInfos.xml
	UNIT_SUBDUED_BISON
Assets\Modules\Modifieda4\Basic_Solar_Panels\Solar_CIV4UnitInfos.xml
	UNIT_WORKER_INDUSTRIAL
	UNIT_WORKER_MODERN
	UNIT_CLONES
	UNIT_WORKER_ANDROID
Assets\Modules\Custom_Religions\Bahai\Bahai_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Vokarya\Wonders\Bauhaus\Bauhaus_CIV4UnitInfos.xml
	UNIT_ARTIST
Assets\Modules\Custom_Religions\Canaanism\Canaanism_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Mormon\Mormon_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Scientology\Scientology_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\DancingHoskuld\Captives\GP_CIV4UnitInfos.xml
	UNIT_TRIBE
	UNIT_SETTLER
	UNIT_COLONIST
	UNIT_PIONEER
	UNIT_PROPHET
	UNIT_ARTIST
	UNIT_SCIENTIST
	UNIT_MERCHANT
	UNIT_ENGINEER
	UNIT_GREAT_GENERAL
	UNIT_GREAT_SPY
	UNIT_GREAT_DOCTOR
	UNIT_ZOROASTRIAN_MISSIONARY
	UNIT_LAWYER
Assets\Modules\Custom_Religions\Tengri\Tengri_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Shinto\Shinto_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Custom_Religions\Druid\Druid_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\Big_Cats\BIG_CATS_CIV4UnitInfos.xml
	UNIT_SUBDUED_BENGALTIGER
	UNIT_SUBDUED_CAVE_LION
	UNIT_SUBDUED_CHEETAH
	UNIT_SUBDUED_JAGUAR
	UNIT_SUBDUED_LION
	UNIT_SUBDUED_LION_PACK
	UNIT_SUBDUED_LYNX
	UNIT_SUBDUED_PANTHER
	UNIT_SUBDUED_SIBERIANTIGER
	UNIT_SUBDUED_SNOWLEOPARD
Assets\Modules\Custom_Religions\Sikh\Sikh_CIV4UnitInfos.xml
	UNIT_PROPHET
Assets\XML\Units\CIV4UnitInfos.xml
	UNIT_QUINQUEREME
	UNIT_GREAT_BOMBARD
	UNIT_BARBAROSSA
	UNIT_SPARTACUS
Assets\Modules\Custom_Religions\Voodoo\Voodoo_CIV4UnitInfos.xml
	UNIT_UNDEAD_WORKER
	UNIT_VOODOO_MISSIONARY
	UNIT_PROPHET
Assets\Modules\Alt_Timelines\MegaFauna\Bear_Rider\bearrider_CIV4UnitInfos.xml
	UNIT_SUBDUED_BEAR
	UNIT_SUBDUED_POLARBEAR
	UNIT_SUBDUED_CAVEBEAR
	UNIT_SUBDUED_PANDA_BEAR
	UNIT_SUBDUED_ASIANBEAR
	UNIT_SUBDUED_BLACKBEAR
	UNIT_SUBDUED_SLOTHBEAR
	UNIT_SUBDUED_SPECTACLEDBEAR
	UNIT_SUBDUED_SUNBEAR
	UNIT_SUBDUED_GRIZZLY
Assets\Modules\Natural_Wonders\NaturalWonder_CIV4UnitInfos.xml
	UNIT_MODERN_WORKBOAT
	UNIT_CONSTRUCT_SHIP
Assets\Modules\Modifieda4\Basic_Forestry\BasicForestry_CIV4UnitInfos.xml
	UNIT_WORKER
	UNIT_WORKANIMAL
	UNIT_WORKMULE
	UNIT_WORKELEPHANT
	UNIT_WORKBUFFALO
	UNIT_WORKER_INDUSTRIAL
	UNIT_WORKER_MODERN
	UNIT_CLONES
	UNIT_WORKER_ANDROID
	UNIT_WORKANIMAL
	UNIT_WORKMAMMOTH
	UNIT_WORKLLAMA
	UNIT_WORKCAMEL
	UNIT_UNDEAD_WORKER
Interesting... some might be pointing at things I should be looking at while most of these are additional entries in modules that I did not include because I didn't consider it to be the core entry for that object.

We could get a more accurate list if we could keep the list from including those entries that do have the same <Type> tag as another fully valid entry on the list.

You'll notice the list is FILLED with workers right? This is because in various modules, we are adding definitions to the build tags on those workers to enable workers to be able to build improvements only included elsewhere in the module. These build definitions simply add themselves to the list for those workers. Most of the main stats on those workers, however, are included in the core xml/units/unitinfos.xml.

However, you found " 829: TXT_KEY_UNIT_QUINQUEREME" which is obviously a problem as I probably included the Description tag where I should've included the Type tag. So some valid errors are found this way.

Big update

  • added ability to read/edit multiple files at once (you can simply load more than one file)
  • added option to copy to google docs

Now you can for example load all units files and edit their tags inline. Parser will automaticly recognize with file you edit. You dont care about it at all :)

@n47

You doing great job in finding this bugs. Thanks :)

We're still keeping the ability to take a CSV and convert directly to written xml in our files right? And did you as well take into consideration that units are defined more than once throughout modules so as to add more definition? How are you taking that into account? Are you trying to say it will be unnecessary to include a column that indicates the file path to the core definition of the unit?
 
New updates

  • added autocomplete for inline editing
  • column with all unque values in now marked by red *
  • fixed bug that forces to apply files twice
  • other small bugfixes

Are you trying to say it will be unnecessary to include a column that indicates the file path to the core definition of the unit?

Yes it is unnecessary since my parser works at multiple files at once. So it will search for unit type in all added files.

Another thing - I added new function copy to google doc - with small tweak i can give you entire list of filename - type - anything that you want

Did you ever try this parser?
http://hiarte.hostings.pl/civ4/index.php
 
Is there a way to decide which <UnitInfo> tag is main definition and which is redefinition of a unit? Except checking their lengths and taking longer as definition, of course?

As I understand redefinitions in modules can modify objects from Assets/XML and from other modules? But what if in one module a value in some object is set to something and in other module it is set to something another? Which one will take action then?

Precisely, if in one module you would have
Code:
<UnitInfo>
			<Class>UNITCLASS_CAVE_LION</Class>
			<Type>UNIT_CAVE_LION</Type>
and in another
Code:
<UnitInfo>
			<Class>UNITCLASS_CAVE_CAT</Class>
			<Type>UNIT_CAVE_LION</Type>
which class will have Cave Lion?

edit

@Thunderbrd, I think you should include files with redefinitions in your list. Take in consideration what will happen, if someone will set a bad value there. You will get some buggy behavior in the game and you will not know where to look for it. Maybe just add a column "Modifying Files" (or something more English :p) with coma separated lists of files, which modify the tag from File column?
 
Type tag has only unique values.

At least in files that i checked.
NOw my XML parser displays red * in unique column and Type looks always unique

EDIT
When compared Subdue_Animals_CIV4UnitInfos.xml and Civ4UnitInfos.xml type tag is not unique
there are two same values:
'UNIT_SCOUT'
'UNIT_GREAT_GENERAL'

Question is do we need to use this ability to redefine the same unit by type tag?
Now it is used very rare so it will be simple to fix it.
 
@n47

What is correct syntax for xpath in this case
Code:
$xml = simplexml_load_file('upload/CIV4UnitInfos.xml'); 
$nodes = $xml->xpath("//UnitInfos/UnitInfo/Type");
var_dump($nodes);
 
@n47

What is correct syntax for xpath in this case
Code:
$xml = simplexml_load_file('upload/CIV4UnitInfos.xml'); 
$nodes = $xml->xpath("//UnitInfos/UnitInfo/Type");
var_dump($nodes);
Well, not the nicest one. We have all our tags in namespaces and a namespace is a part of tag name. So it would probably be something like this, if I recall correctly.
Code:
//{x-schema:C2C_CIV4UnitSchema.xml}UnitInfos/{x-schema:C2C_CIV4UnitSchema.xml}UnitInfo/{x-schema:C2C_CIV4UnitSchema.xml}Type
But most of sane people ignore namespaces.

xpath1.0
Code:
//*[local-name()='UnitInfos']/*[local-name()='UnitInfo']/*[local-name()='Type']

xpath2.0 (this one I haven't checked)
Code:
//*:UnitInfos/*:UnitInfo/*:Type'
 
Back
Top Bottom