Skaven Design and Ideas.

im not too sure, i cant see anything of that sort... here is a bigger section of code:

Code:
	def onUnitBuilt(self, argsList):
		'Unit Completed'
		city = argsList[0]
		unit = argsList[1]
		player = PyPlayer(city.getOwner())
		pPlayer = gc.getPlayer(unit.getOwner())

		iFreeProm = unit.getFreePromotionPick()
		
#		if unit.getUnitType() == gc.getInfoTypeForString('UNIT_BLOODTHIRSTER'):
#			iPop = city.getPopulation() - 4
#			if iPop <= 1:
#				iPop = 1
#			city.setPopulation(iPop)
#			city.setOccupationTimer(4)

#		if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_CHANCEL_OF_GUARDIANS')) > 0:
#			if CyGame().getSorenRandNum(100, "Bob") <= 20:
#				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DEFENSIVE'), True)

#		if (city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_CAVE_OF_ANCESTORS')) > 0 and unit.getUnitCombatType() == (gc.getInfoTypeForString('UNITCOMBAT_ADEPT'))):
#			i = 0
#			for iBonus in range(gc.getNumBonusInfos()):
#				if gc.getBonusInfo(iBonus).getBonusClassType() == gc.getInfoTypeForString('BONUSCLASS_MANA'):
#					if city.hasBonus(iBonus):
#						i = i + 1
#			if i >= 1:
#				unit.changeExperience(i, -1, False, False, False)

#		if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_GOLEM')):
#			if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_BLASTING_WORKSHOP')) > 0:
#				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_FIRE2'), True)
#			if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_GRIDLINES')) > 0:
#				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CITY_GARRISON1'), True)

#		if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_ASYLUM')) > 0:
#			if unit.isAlive():
#				if isWorldUnitClass(unit.getUnitClassType()) == False:
#					if CyGame().getSorenRandNum(100, "Bob") <= 10:
#						unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CRAZED'), True)
#						unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ENRAGED'), True)

#		if unit.getUnitType() == gc.getInfoTypeForString('UNIT_ACHERON'):
#			city.setNumRealBuilding(gc.getInfoTypeForString('BUILDING_THE_DRAGONS_HORDE'), 1)
#			iX = city.getX()
#			iY = city.getY()
#			for iiX in range(iX-1, iX+2, 1):
#				for iiY in range(iY-1, iY+2, 1):
#					pPlot = CyMap().plot(iiX,iiY)
#					if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_FOREST') or pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_JUNGLE')):
#						pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FLAMES'), 0)
#			cf.addPopup(CyTranslator().getText("TXT_KEY_POPUP_ACHERON_CREATION",()), str(gc.getUnitInfo(unit.getUnitType()).getImage()))

		if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF')):
			if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_BREWERY')) > 0:
				unit.changeExperience(2, -1, False, False, False)

#		if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON')):
#			if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_DEMONS_ALTAR')) > 0:
#				unit.changeExperience(2, -1, False, False, False)

#		if city.isHasCorporation(gc.getInfoTypeForString('CORPORATION_AERONS_BOUNTY')):
#			if unit.getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_ASSASSIN'):
#				unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_AERONS_CHOSEN'), True)

#		if city.isHasCorporation(gc.getInfoTypeForString('CORPORATION_CULT_OF_THE_DRAGON')):
#			if unit.getReligion() == -1:
#				if CyGame().getSorenRandNum(100, "Bob") <= 20:
#					unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CULT_OF_THE_DRAGON'), True)

		if unit.getFreePromotionPick() < iFreeProm:
			unit.changeFreePromotionPick(iFreeProm - unit.getFreePromotionPick())

		if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_WARRENS')) > 0:
			if isWorldUnitClass(unit.getUnitClassType()) == False:
				if isNationalUnitClass(unit.getUnitClassType()) == False:
					if unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_SIEGE'):
						if unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_NAVAL'):
							newUnit = pPlayer.initUnit(unit.getUnitType(), city.getX(), city.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
							city.applyBuildEffects(newUnit)

		CvAdvisorUtils.unitBuiltFeats(city, unit)
		
		if (not self.__LOG_UNITBUILD):
			return
		CvUtil.pyPrint('%s was finished by Player %d Civilization %s' 
			%(PyInfo.UnitInfo(unit.getUnitType()).getDescription(), player.getID(), player.getCivilizationName()))

thats the whole of the onunitbuild python in cvEventManager
 
ah. so it IS in onUnitBuilt and DOES define the city and unit from the event argslist. (at the top.)
so that is ok.
I don't see why it is not working then.

The intended effect is creating an additional copy of a built unit, right?
(It will not get the free promotions I guess...unless onUnitCreated is triggered on unit every created...which will create double units when units are summoned in a warren city too.)

I'll have to check other instances of units being created, but it seems all in order at first glance.
Maybe the fault lies with a simple typo in a XML reference or something;
the buildingInfos also have BUILDING_WARRENS right? :P

edit: Ah!
try replacing getUnitType() with gc.getInfoTypeForString('UNIT_WHATEVER')
or add iUnitType = unit.getUnitType() and replace 'UNIT_WHATEVER' with 'iUnitType' too.
 
There are other solutions I bet, like giving them lower cost units, or a building that gives production to a city (a % increase in unit production, so as not to double buildings). It would be easier to do.
 
bump!

Code:
def onUnitBuilt(self, argsList):
		'Unit Completed'
		city = argsList[0]
		unit = argsList[1]
		player = PyPlayer(city.getOwner())
		pPlayer = gc.getPlayer(unit.getOwner())
                iUnitType = unit.getUnitype()
...
		if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_WARRENS')) > 0:
			if isWorldUnitClass(unit.getUnitClassType()) == False:
				if isNationalUnitClass(unit.getUnitClassType()) == False:
					if unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_SIEGE'):
						if unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_NAVAL'):
							newUnit = pPlayer.initUnit(gc.getInfoTypeForString('iUnitType'), city.getX(), city.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
							city.applyBuildEffects(newUnit)

might do the trick
 
that may be so, but i want them to get 2 units for the price of one :p and i thought it would be easy because it was already possibly in FfH... apparently not so lol. but its still early days and i havent really taken a serious look at it yet so we shall see :p

but if all else fails making their untis 50% cheaper would definately work lol
 
edit: Ah!
try replacing getUnitType() with gc.getInfoTypeForString('UNIT_WHATEVER')
or add iUnitType = unit.getUnitType() and replace 'UNIT_WHATEVER' with 'iUnitType' too.

could you post the code block for the whole warrens thing for me with this change? im not sure which getUnitType() your specifying so it would be easyer to juts show me :p ta :)
 
there see the edit in previous post. (I deleted some irrelevant parts for clarity)
 
Maybe newUnit is just redefining the initial unit built and thus building only one, try adding a second line with unitBuilt2

:
Code:
newUnit1 = pPlayer.initUnit(gc.getInfoTypeForString('iUnitType'), city.getX(), city.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
newUnit2 = pPlayer.initUnit(gc.getInfoTypeForString('iUnitType'), city.getX(), city.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
 
boohoo! :'( dunno what's failing here then.

edit: ah on previous doubt: there are seperate triggers for units built and units created. Not that that helps us much.
 
you sure you're editing the right file?
Not a copy in a backup folder... I make that mistake sometimes.
I'm sure you've double checked that though. :P



Maybe I used the gc.getInfotypeForString() method wrongly,
try replacing 'iUnitType' for 'UNIT_ARCHER' (or other applicable skaven unit)

(One alternative is creating a tier 0 warrior unit or a worker/slave unit as mandatory extra unit.)

add a popup message line below the spawning code, then we'll at least notice whether the method is being called properly.

edit: goin' ta bed.
 
Maybe Skaven uber casters/warp units can be limited by warpstone sources?
 
Maybe Skaven uber casters/warp units can be limited by warpstone sources?

i have tried several mechanics all of which were epic fails and didnt work well at all. if you have any ideas to implement such a concept id love to hear them :)
 
Yeah, we tried several mechanics each one either too complex, too restrictive or too micromanagerial for any player to enjoy... including the AI.
Their development is probably documented at the start of this very thread.

At minimum skaven casters should have the prereq warpstone resource to be created.
(As they are currently.)

I don't think the unitcaps can be dynamic, but if they could: expanding the unitcap for each warpstone resource gained would be an obvious mechanic...
if only the AI could be convinced warpstone is cool and to acquire it even if it already has one.
 
I know that I am brand new to actually posting and being visible on this site but I have a few ideas here. I'm not sure about the plausibility but... here they are:

1.) Why not give the Skaven something like the Planar gate in FFH2 to start with in order to give them a unique and.or flavorful feeling. I'm thinking that this would make sense because they are a subterranean team and it would make sense that they could get around quickly.

2.) Instead of making them a sprawling team like the Kuriotates in FFH, why not instead simply decrease the city upkeep cost of an early and massive empire expansion.

3.) Maybe an option similar to FFH with the ship options, i.e. skeleton crew, privateer etc. This option would be different you could have, A.) Regular unit, B.) Underground/Invisible, and C.) ... I'll think on C... :)

I was also wondering if the Skaven or 'some' other team/units could split like the Tar demon does/did in FFH when defeated.

Now please understand that I am a relative novice to Warhammer, and a beginner/intermediate with Warhammer 40k, so if my ideas don't make sense please forgive me.
 
How about allowing skaven casters to cast a super special spell when they are on a warpstone resource. Make it a one time only cast.
 
I know that I am brand new to actually posting and being visible on this site but I have a few ideas here. I'm not sure about the plausibility but... here they are:

Welcome to CFC! :wavey:

all these ideas are plausable btw ;) there is very little that the civ engine cant do. and if we dont know how to code it, we ask for help or find a work around if the idea is good enough :p

I was also wondering if the Skaven or 'some' other team/units could split like the Tar demon does/did in FFH when defeated.

this is planned for water elementals and id like it for swarm units too (rat swarms, snotling swarm etc) :)

1.) Why not give the Skaven something like the Planar gate in FFH2 to start with in order to give them a unique and.or flavorful feeling. I'm thinking that this would make sense because they are a subterranean team and it would make sense that they could get around quickly.

definately something like this would be awsome for the skaven. we have toyed around with the idea of invisible roads that act as railroads (epic fail) and improvements that alow 'air dropping' (havent tried possibly even a really expensive wonder called Underempire Network which puts a Underempire Entrance in every city and alows 'air lifting'?

2.) Instead of making them a sprawling team like the Kuriotates in FFH, why not instead simply decrease the city upkeep cost of an early and massive empire expansion.

it could work, but i really like the sprawling trait and there is so much that is possible to make the skaven flavourful based on the city limit too (UBs, special improvements and such)
 
the problem with the skeleton crew type idea is
the hidden/subterranian units would not 'surface' when attacking/attacked,
which would be odd.
...
a similar thing might be done for weapons though ...
not a choice between spears or handweapons I think, but
a choice to add a weapons team, which adds a poison wind spell or a fire bombard ability, or an hidden assasin*
plaguemonks rather have single use/combat warpscroll, cencerbearers (and always are plaguebearers)

Each requiring the relevant clan buildings obviously.

*hidden assasins still need to be designed. Any ideas to how to make this work are welcome. One idea is a 50% chance of removing the hero promotion from an opposing unit, but this would be odd with individual hero units. else maybe remove a random 'command group' promotion. also add a single first strike in combat, but is lost on first combat. (assasins don't last very long on the battlefield)
 
Back
Top Bottom