Mod-Modders Guide to Fall Further

So given the lack of checkbacks, I don't suppose there's a way to tear a unit away from it's summoner and then leave it in the game without unsummoning? Skeletons are what I'm looking at in particular.
 
Haven't checked out the module issue yet, time for bugfinding hasn't manifested quite as easily/quickly as I had hoped :(


You can divorce a summon from their master and keep them alive, but I am not certain I exposed all functions required to do such a thing to python. Skeletons are already permanent summons, so all that should be required for them is to remove the Master unit from the Skeleton and the Slave from the Master. Pretty sure that setup isn't exposed to python, and if it is I know it isn't set up to be quite as foolproof as the Commander system (where it will ensure that the relationship breaks in both directions at once)
 
So given the lack of checkbacks, I don't suppose there's a way to tear a unit away from it's summoner and then leave it in the game without unsummoning? Skeletons are what I'm looking at in particular.

I guess you can always rebuild a new unit with same type/stat/promo and kill the old one.
 
I was hoping it was some modular code or something I could steal - I really was hoping there was a simple way to make Cecilia's skeletons break off and become regular units once they got enough XP.
 
I would think at worst case you could give an invisible promotion that boosts AirCombat.
 
Modular loading doesn't seem to work right for units all the time. I am trying to mod some of Tarq's Holy Warriors, and I wanted to set it so champions upgrade correctly. I add this entry in the UnitInfo section of my module:

Code:
<UnitInfo>
	<Type>UNIT_BATTLEMASTER</Type>
	<UnitClassUpgrades>
		<UnitClassUpgrade>
			<UnitClassUpgradeType>UNITCLASS_EMPPAL</UnitClassUpgradeType>
			<bUnitClassUpgrade>1</bUnitClassUpgrade>
		</UnitClassUpgrade>
	</UnitClassUpgrades>
</UnitInfo>

However, when I look at the Pedia, I see combat as Strength: 6 / 0.

I checked and removed all other modules, files, etc, so just this one is in (I changed unit class to UNITCLASS_PALADIN, and still get this issue.

If I add an <iCombat> tag, the strength shows up correctly.

Should I adjust the schema somehow to prevent def strength from defaulting to zero?
 
Yeah, known bug. Just fill in an icombatdefense value for now - you have to do it every time you change a unit, at current.
 
I would think at worst case you could give an invisible promotion that boosts AirCombat.

Making yourself a stackable EffectProm would be the best approach currently

Sigh. Attempting to set up a jury-rigged partial-affinity system... Was going to apply the bonus via python, after checking the number of a mana. I suppose I can just apply (numRefinedMana) promotions, that have a turn timer of 1. Reapplied each turn... That way no holdover if you lose a mana. Should work well enough for now.
 
I am trying to get the AI to react to hell terrain, does the following code check the whole of the civs territory, or just around the capital for hell terrain?

Code:
#Is Hell Coming?

		if eTeam.isHasTech(gc.getInfoTypeForString('TECH_DIVINATION')) == False:
			if not pPlayer.hasBonus(gc.getInfoTypeForString('BONUS_MANA_LIFE')):
				iHell=0
				print iHell
				for i in range (CyMap().numPlots()):
					pPlot = CyMap().plotByIndex(i)
					if not pPlot.isNone():
						if pPlot.isOwned():
							if pPlot.getOwner() == ePlayer:
								eFeature = pPlot.getFeatureType()
								if eFeature == gc.getInfoTypeForString('FEATURE_FIELDS_OF_PERDITION'):
									iHell= iHell +1
								if eFeature == gc.getInfoTypeForString('FEATURE_BURNING_SANDS'):
									iHell= iHell +1
								if eFeature == gc.getInfoTypeForString('FEATURE_BLIGHTED_COAST'):
									iHell= iHell +1
				if iHell>=2:
					iTech = gc.getInfoTypeForString('TECH_DIVINATION')
 
What entry in the gamespeed controls the timers for things like the AC, project durations (dowsing), world spell durations, etc? Is it possible to add a tag for such things? Right now I'm building my "huge armies" Game Speed setting, and I'd like to know where I can ensure that the AC goes up at speed comparable to Epic, but right now its increasing at a quick speed rate, so it would seem.
 
AC is not adjusted for Gamespeed to my recollection. Projects/spells are mostly done in Python or by GrowthFactor.

Squirrel: that wouldcheck all their territory. But it might be better to just check pPlot().getPlotCounter() > 9, as that covers all Hell terrain, even tundra/snow/ocean
 
I think you might also consider the weight increased for Burning Sand because of the flames and its impact (no producrtion) on the civ.
Like +1 for other and +5 for burning sand and then check a hgher limit.
 
1) Is there a python function to determine an AIs relations towards another AI/human?

2) Is there a promotion field to give units access to weapon tiers (bronze/mithril/iron?) And what happens if I allow a summon to upgrade into another unit (skeles) Does it retain its link to the summoner, or do crazy thing happen?
 
1) Yes, probably pPlayer.getAttitudeVal(iPlayer2) or something like that. Look in the python file for the Worldbuilder screen, anything it displays can be asked for in python and has a handy example

2) PromotionAllow, or AllowPromotion, something along those lines anyway. That is how all weapon stuff is handled now instead of the previous numeric system.

2b) Upgrading a unit maintains the Master/Slave relationships from before the upgrade
 
Back
Top Bottom