1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Sheaim Planar Gate stopped working at AC 30 (Blight started)

Discussion in 'Fall from Heaven Troubleshooting' started by Chim66, Aug 10, 2012.

  1. Chim66

    Chim66 Chieftain

    Joined:
    Feb 19, 2011
    Messages:
    5
    High, It is the first time I play the Sheaim and everything worked fine until I hit the AC 30 counter and the Blight started. Since then I had 5 planar gates with a lot of buildings to them and on average every 1-2 turns I got new units through them.

    At AC 30, when the Blight started, new units appeared any more. Now the Blight is over for a few turns (I play epic, so it must have been about 20 turns without units). The AC is at 37 now.

    I can see no world spell cast on the lower right screen and spells are working with my adepts and mages.

    What can be the problem here?

    I am grateful for every hint and help!

    A nice day and good play to all - and thanks to all who build this classic mod!!!!
     
  2. A Moon

    A Moon The "A" is silent

    Joined:
    Dec 31, 2009
    Messages:
    682
    Location:
    Me.
    Are you sure you haven't just reached your limit?

    For example, if you have three planar gates, all in a city with a temple of the veil, then you'll get 3 tar demons. Until one of them dies, or you get another gate with a temple in its city, or you increase the Armageddon counter to 50 (I think), you won't get any more tar demons, and this applies to all the gate units.
     
  3. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,157
    Location:
    Kael's head
    Here is the code that runs the Planar Gates:
    Code:
    
    		if pCity.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_PLANAR_GATE')) > 0:
    			iMax = 1
    			iMult = 1
    			if CyGame().getGlobalCounter() >= 50:
    				iMax = 2
    				iMult = 1.5
    			if CyGame().getGlobalCounter() >= 75:
    				iMax = 3
    				iMult = 2
    			if CyGame().getGlobalCounter() == 100:
    				iMax = 4
    				iMult = 2.5
    			if CyGame().getSorenRandNum(10000, "Planar Gate") <= gc.getDefineINT('PLANAR_GATE_CHANCE') * iMult:
    				listUnits = []
    				iMax = iMax * pPlayer.countNumBuildings(gc.getInfoTypeForString('BUILDING_PLANAR_GATE'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_GAMBLING_HOUSE')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_REVELERS')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_REVELERS'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_MAGE_GUILD')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_MOBIUS_WITCH')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_MOBIUS_WITCH'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_CARNIVAL')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_CHAOS_MARAUDER')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_CHAOS_MARAUDER'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_GROVE')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_MANTICORE')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_MANTICORE'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_PUBLIC_BATHS')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_SUCCUBUS')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_SUCCUBUS'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_OBSIDIAN_GATE')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_MINOTAUR')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_MINOTAUR'))
    				if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_TEMPLE_OF_THE_VEIL')) > 0:
    					if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_TAR_DEMON')) < iMax:
    						listUnits.append(gc.getInfoTypeForString('UNIT_TAR_DEMON'))
    				if len(listUnits) > 0:
    					iUnit = listUnits[CyGame().getSorenRandNum(len(listUnits), "Planar Gate")]
    					newUnit = pPlayer.initUnit(iUnit, pPlot.getX(), pPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
    					CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_PLANAR_GATE",()),'AS2D_DISCOVERBONUS',1,gc.getUnitInfo(newUnit.getUnitType()).getButton(),ColorTypes(8),pCity.getX(),pCity.getY(),True,True)
    					if iUnit == gc.getInfoTypeForString('UNIT_MOBIUS_WITCH'):
    						promotions = [ 'PROMOTION_AIR1','PROMOTION_BODY1','PROMOTION_CHAOS1','PROMOTION_DEATH1','PROMOTION_EARTH1','PROMOTION_ENCHANTMENT1','PROMOTION_ENTROPY1','PROMOTION_FIRE1','PROMOTION_LAW1','PROMOTION_LIFE1','PROMOTION_MIND1','PROMOTION_NATURE1','PROMOTION_SHADOW1','PROMOTION_SPIRIT1','PROMOTION_SUN1','PROMOTION_WATER1' ]
    						newUnit.setLevel(4)
    						newUnit.setExperience(14, -1)
    						for i in promotions:
    							if CyGame().getSorenRandNum(10, "Bob") == 1:
    								newUnit.setHasPromotion(gc.getInfoTypeForString(i), True)
    
    As you can see, both the chance of getting a unit and the limit on how many units you have have at one time are influenced by Armageddon Counter, but there is no difference between any AC values less than 50.

    Also note that the maximum limit applies per type of planar gate unit independently, not the total number overall. It also does not matter if the unit was generated by the planar gate or granted some other way, such as that Succubus-granting event or world builder.
     
  4. Chim66

    Chim66 Chieftain

    Joined:
    Feb 19, 2011
    Messages:
    5
    Thank you for your fast response!

    I think you are right. I was not aware that there is such a limit for each gate. I thought they will produce without any limits, so by time you can get many many unit, such as I can generate with normal "military buildings".

    So it seems, I have reached the limit you have described in your answer and everything is working as intented by the code. I will have to build gates and buildings in other cities then.
     
  5. Doug Piranha

    Doug Piranha Warlord

    Joined:
    Dec 19, 2008
    Messages:
    261
    Location:
    USA
    The limit on units is strictly based on the number of planar gates. You only need one of each enabling building to get (number of planar gates) units of that type.
     
  6. Chim66

    Chim66 Chieftain

    Joined:
    Feb 19, 2011
    Messages:
    5
    A question to the code:

    Is it correct, that you count all buildings the player has and not only the buildings in cities that also have a planar gate? E.g. when I have a city with Planar Gate but no Gambling House in this city but there is another city without a Planar Gate but with a Gambling House, then I have also the same chance to get an Reveler?

    So I do not have to build the "special unit buildings" and the planar gates in the same city?
     
  7. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,157
    Location:
    Kael's head
    Notice that the very first line of the code is if pCity.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_PLANAR_GATE')) > 0:, and that each of the lines like if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_MAGE_GUILD')) > 0: are counting things in the same city. The code does not cycle through all your cities to check to see if they have each of the buildings, only the current one. The code as a whole is found under def onCityDoTurn(self, argsList):, so it is run once per turn for every city in the game but the first conditional stops it from doing anything in cities without planar gates .

    The maximum limit on how many free units of each type you may get does not depend on having the gates and the other buildings in the same city, except that there must be one city with both in order to get any. However, the chance of getting a free unit when you have not yet reached your limit does depend on having them in the same city.


    I believe that it is theoretically possible for a single city to contain multiple copies of the same building, but this capacity is never used in vanilla civ and I can't think of any mods that use it either.
     

Share This Page