Results 1 to 9 of 9

Thread: Making units dependent on two buildings?

  1. #1
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Making units dependent on two buildings?

    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.
    Not used mods before? Looking for something small and fun?!
    Download the:

  2. #2
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Making units dependent on two buildings?

    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.
    "One of the most sophisticated Total War mods ever developed..."

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Making units dependent on two buildings?

    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.

  4. #4
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Making units dependent on two buildings?

    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.
    "One of the most sophisticated Total War mods ever developed..."

  5. #5
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Making units dependent on two buildings?

    Quote Originally Posted by Dol Guldur
    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.

  6. #6
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Making units dependent on two buildings?

    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.
    "One of the most sophisticated Total War mods ever developed..."

  7. #7
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Making units dependent on two buildings?

    [QUOTE]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.[/
    QUOTE]

    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.
    Not used mods before? Looking for something small and fun?!
    Download the:

  8. #8
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Making units dependent on two buildings?

    Quote Originally Posted by Makanyane
    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?

  9. #9
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Making units dependent on two buildings?

    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.
    Not used mods before? Looking for something small and fun?!
    Download the:

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO