Log in

View Full Version : Making units dependent on two buildings?



Makanyane
02-01-2006, 20:54
Does anyone know of any way of making unit production dependent on two buildings.

We are trying a mod to force us to convert religious buildings in taken cities before being able to recruit higher level units. Have tried using lines such as:

recruit "carthaginian medium infantry" 0 requires factions { carthage, } and building_present_min_level temple_of_justice_carthage temple_of_justice_temple

in EDB. This works to an extent in that unit recruitment is restricted until the temple is built, but causes CTD's without -show_err messages when you try to view some of the building descriptions (the two higher level stables), or for the buildings that display OK, when you try to view the restricted units descriptions from within their display screens. The above EDB line generates a discription in the barracks description screen :
Libyan Spearman Temple of Baal
which causes a CTD when clicked on.

Don't really want to just build units from temples as I think you should be forced to build barracks as well. Could make unique Carthaginian barracks which are dependent on building Carthaginian temples but that would mean starting from scratch with the military and religious buildings when taking a city. So would really prefer to use 2nd dependency for units if possible.

Dol Guldur
02-02-2006, 12:26
building_present_min_level should only really be used as a conditional for buildings and not for units. I appreciate a lot of mods use it as a conditional for unit recruitment, but you must suffer the value (the building) tagged onto the end of your unit name in the building description scroll (as you have already discovered).

This is a pain because resources are of course fixed and thus building_present_min_level provides the only varying conditional. If you want a unit dependent upon more than one building being present it is best to make building_present_min_level the conditional for that building. If you have other units or bonuses in that building that you want available without the need for the second building then you will have to rethink the whole way you recruit and build.

I am not entirely sure of what you are trying to achieve. Do you wish to recruit units from conquered temples (belonging to other factions) after your conquering army has built a barracks? This would also be true or not for your own temples?

The CTD is probably EB related. Post the entry for the EDB and EB here and I or someone else may be able to help.

Monkwarrior
02-02-2006, 13:54
I used this double conditional also to recruit carthaginian sacred band. I noticed the temple appeared besides the unit in the barracks description but I didn't notice the CTD problem (I will check it again).

Regarding the obligation to destroy the original temples and build those corresponding to the faction, I used the conditional "requires faction {carthage, }" for the temple bonuses. In that way the conqueror shouldn't get those bonuses and it is worthy to build its own temples.
Even negative bonuses could be included for the foreign cultures or factions to make this effect stronger.

Dol Guldur
02-02-2006, 14:20
No, the CTD is likely export_buildings.txt related. I would need to see both entries in both files.

Yes, the capabilities can be so conditioned (and should be) but I would imagine for even more (and perhaps essential) realism you would want to destroy and build.

Monkwarrior
02-02-2006, 14:26
Yes, the capabilities can be so conditioned (and should be) but I would imagine for even more (and perhaps essential) realism you would want to destroy and build.
In general, all those questions about requirements and buildings arrive to a "dead point": the AI.
I think (please, correct me if I'm wrong) that the AI doesn't destroy any building after conquering a settlement. This means that strong (or complicated) requirements would make the campaign even easier for the human player.

Dol Guldur
02-02-2006, 14:46
I think that is true - at least I've never seen the AI destroy buildings (not that I've studied it greatly).

One could argue that this reality should be taken into account when creating the strat_map balance in a mod - the more complex activities being the advantage of the local (human) player. In the end, the player gets more enjoyment from the faction he is playing *and*, of course, may play any playable faction and engage the complexities.

Such complexities should thus give access to extra bonuses/units rather than the standards otherwise the AI really will be too easy to thrash.

Makanyane
02-02-2006, 18:32
Originally posted by MonkWarrior
In general, all those questions about requirements and buildings arrive to a "dead point": the AI.
I think (please, correct me if I'm wrong) that the AI doesn't destroy any building after conquering a settlement. This means that strong (or complicated) requirements would make the campaign even easier for the human player.

I agree I don't think the complex requirements work for the AI we are just writing a mod for the faction we are going to play (carthage) so it will only be the human player that has these requirements. (It would need rewriting to get a sensible result playing as another faction, but once we've got the principles working that shouldn't take too long.)

Will have another look at txt files before posting re: CTD.

Monkwarrior
02-02-2006, 18:57
I agree I don't think the complex requirements work for the AI we are just writing a mod for the faction we are going to play (carthage) so it will only be the human player that has these requirements. (It would need rewriting to get a sensible result playing as another faction, but once we've got the principles working that shouldn't take too long.)

Doesn't the AI use the same recruitment system as the human player?
Or is it a mod that has Carthage as the only playable faction?

Makanyane
02-02-2006, 19:19
We're only making things difficult for Carthage, with the intention of only playing as Carthage - could therefore make all the others factions non-playable.


Originally posted by Monkwarrior
I used this double conditional also to recruit carthaginian sacred band. I noticed the temple appeared besides the unit in the barracks description but I didn't notice the CTD problem (I will check it again).

Please let us know if you do check this out, our main CTD was when right clicking the line where the temple appeared besides the unit. Have since tried various combinations of trying to add a combined infantry_temple line into export_units and export_desrc_units_enums but still have same CTD.