How to make new units depend on a new building?

tucoow

Chieftain
Joined
May 1, 2008
Messages
52
Location
A pasture, somewhere GMT+8
I found no appropriate thread to ask this question so I start a new thread.

I'm trying to build put "Drifa the white dragon", "Fiacra the north wind" etc units from FfH into normal BTS game, in ancient era. I will make them "world unit, 1 allow" and need Meditation, and need a world wonder "the Stag Hide"(3 allowed, so there can be competition).

I was able to do it when not using modular XML and they worked fine, and these monsters adds much fun to ancient era.:lol:

But with modular XML I find that these units change to require Angkor Wat(require philosophy) rather "the Stag Hide". I guess the building is "activated" behind units. There seems to be no way for modular XML to control it. This is the reason for me to find my way to this forum.:lol:

But with WoC v1 installed and I added my units, things seem to be the same. I had been expecting MLF to control the loading order but it seems to only control whether a module loads or not.

So the question is how to make new units depend on a new building?:confused:
 
But with modular XML I find that these units change to require Angkor Wat(require philosophy) rather "the Stag Hide". I guess the building is "activated" behind units. There seems to be no way for modular XML to control it.

true, modular xml (the BtS modular that is) cannot control load order, there is an inherent load order which always takes precedence over everything.

Buildings are therefore always loaded before units are loaded, no matter where they are located.

But with WoC v1 installed and I added my units, things seem to be the same. I had been expecting MLF to control the loading order but it seems to only control whether a module loads or not.

the MLF can influence load order, but it cannot override the inherent load order, so you cannot load units before buildings (as that is inherent), but you can define which building or unit to load first.

I.e. the MLF allows the same level of control as regular (non-modular) xml. In regular xml you achieve it by putting one definition before the other in one xml file, with the MLF you do it by putting the directory of the first modular definition before that of the second definition.

MLF controls both the order (what appears first in the MLF is loaded first) and whether something is loaded at all. As I said, you can only do so to the extent the inherent load order allows.

You can find the inherent load order here (under 'XML loading order')
 
Here is a Drifa, depending on a new building (albeit not yours, didn't find it in FfH).

Note, the unit does not work completely. At the very least it misses some sound effects, so when you create it, the game appears to hang (due to a hidden popup telling you that the sound is missing, use alt+tab to get to the popup).

But it does depend on the new building, which was the main focus here ;)
 
Here is a Drifa, depending on a new building (albeit not yours, didn't find it in FfH).

Thank you mamba, it's your demo drifa Unitinfo XML that help me out, otherwise I won't find out the reason throughout my life.

The reason for my units' wrong dependancy is: I had been using <PreReqTech>BUILDINGCLASS_STAG_HIDE<PreReqTech>.

Oh God the reason is so simple and so stupid for me. BUILDINGS are always loaded before UNITS. I should have made them work using modular XML without WoC. :lol:

I never saw demo code for this kind of unit (depend on building) before, so I didn't know the right gramma. I guessed it to be BUILDINGCLASS, and it does work when not using modular XML. So I never doubt about it from then on.

Thank you again mamba, thank you. [hug]:lol:

And BTW, my dragon drifa is from FfH ice age:lol:. But I remember years ago when I took a look at FfH there's also a dragon. Don't remember it's name.;)
 
Thank you mamba, it's your demo drifa Unitinfo XML that help me out, otherwise I won't find out the reason throughout my life.

The reason for my units' wrong dependancy is: I had been using <PreReqTech>BUILDINGCLASS_STAG_HIDE<PreReqTech>.

Well, I sure hope you move it from <PrereqTech> to <PrereqBuilding> as well ;) (should be the line right above <PrereqTech>). Also make sure you get the tag right, it's <PrereqTech>, no capital R anywhere.

EDIT: one thing bugged me, you wrote :

I never saw demo code for this kind of unit (depend on building) before, so I didn't know the right gramma. I guessed it to be BUILDINGCLASS, and it does work when not using modular XML. So I never doubt about it from then on.

If that did work, it does work in modular as well, the example I used as reference did contain BUILDING though (e.g. UNIT_JEWISH_MISSIONARY). There is NO difference between what can be done in modular and non-modular xml and there is NO difference how it is done either. So it either works in both cases or in neither (but never in one or the other) - with the exception that some things simply cannot be done in a modular way at all, techs for example (they are modular in WoC though, just not for plain BtS).

So if it did work for you in non-modular xml, chances are you actually used the right tag (i.e. <PrereqBuilding> instead of <PrereqTech>).
 
Well, I sure hope you move it from <PrereqTech> to <PrereqBuilding> as well ;) (should be the line right above <PrereqTech>). Also make sure you get the tag right, it's <PrereqTech>, no capital R anywhere.

:lol::lol::lol:

Don't worry. I didn't copy them, just type in by mistake.
<PrereqBuilding>BUILDING_STAG_HIDE</PrereqBuilding>

And actually I also have:
<PrereqBonuses>BONUS_GOLD</PrereqBonuses>

Otherwise this world unit will be given as a free unit in later era start. Sto taught me that. :)
http://forums.civfanatics.com/showthread.php?t=282513
 
Back
Top Bottom