Thunderbrd
C2C War Dog
Been thinking on this one and without adding another tag (which could be just an indicator that is included in the schema but has no load-in process in the dll as it would be entirely unnecessary there - probably a boolean would be easiest) I don't think there's any given tag that is reliable enough to set this 'primary key' definition on... I'd say whichever one defines the <Button> tag but even that COULD be subject to change by modular edit.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?
Where you would have two re/over writes you'd find that the tags in the last loaded file in the modular loading sequence would take precedence.n47 said: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?
Presuming the second one was the last to be loaded, the Cave Cat would have it.n47 said:Precisely, if in one module you would have
and in anotherCode:<UnitInfo> <Class>UNITCLASS_CAVE_LION</Class> <Type>UNIT_CAVE_LION</Type>
which class will have Cave Lion?Code:<UnitInfo> <Class>UNITCLASS_CAVE_CAT</Class> <Type>UNIT_CAVE_LION</Type>
True that I'd like this list to be an xml modder's help guide to rapidly find given units but it would be unnecessary for an edit planning document, which is what this basically is. I'd find it would muddy the waters for the purpose of design planning spreadsheeting.n47 said:@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) with coma separated lists of files, which modify the tag from File column?
It's not so rare as you think. n47's list of inaccuracies derived above is a fairly close approximation of how often it takes place. The REASON for the necessity for this kind of modularization is better explained by DH but I can try. Basically it's so that if a module is introducing a new concept, units, promotions, etc can be updated to adapt to that concept without having to place such adaptations on the core definition. Therefore, if you then turn OFF the module, you won't have a bunch of references not finding their targets.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.
Take for example many of the worker Build actions. Say a module adds a new type of improvement. Then in that module we add further definition to our workers, adding the build type (action) that produces that new improvement, enabling our workers to now build said improvement. At that point, the worker is otherwise unchanged... only the new feature has been added.
If you turn off the module, not only does the improvement vanish from the assets but so does the worker build definitions.
But if you put those build definitions on the core worker definition on the main UnitInfos.xml, then turn off the improvement, the build lists will start throwing errors when it can't find the definition of that new improvement.
May be a poorly worded example but hopefully you follow.
I'd still keep the file paths on these planning docs though since it helps the planner immensely.
@ Both of you: It occurs to me that it should be painfully easy to flesh out the Era CCs... it would just take a query that would find the prereqtech's era and match it to the corresponding (which we'd have to probably add a tag for in UnitCombats) Era CC then fill it in for the unit on that list appropriately. Anyone want to see what can be done to make that process a bit faster? Even generating a list for the units where the era can be copied into the google doc would be extremely helpful.