Modding Events

Yep, that's correct, modular XML does the appending for you and you need to set ModularLoading = 1 in the ini.
 
OK, I managed to create one event. It works the way it's supposed -- it popped up on the turn after start as I forced it do that -- and I think it should be limited to a specific CIV.

I tried to further modify it so that it would appear on a given turn, but that didn't work however. Not sure what else to do here.

Python coding is as follows:

Code:
######## Destroyers4Bases (English event) #########

def canTriggerDestroyers4Bases(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)

	if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_ENGLAND")):
		game = gc.getGame()
						
		if (game.getTurnYear(turn) == 32):
			return true
		return false

	return false

The chance of the event appearing is 100. The trigger weight is 1000. The actual calendar date should be Week 1 September 1940, which translates into Turn #32 (the game starts at Turn #24, as indicated in the date anyway.) Maybe the date entry is wrong in the python code.
 
The function getTurnYear() converts a turn to a year.

Code:
if (game.getTurnYear(turn) == 32):

This translates to: "if the year is 32 AD" and 'turn' isn't defined anywhere.

Code:
######## Destroyers4Bases (English event) #########

def canTriggerDestroyers4Bases(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)
        turn = kTriggeredData.iTurn

	if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_ENGLAND")):
						
		if (turn == 32):
			return true
		return false

	return false

This should work though.
 
OK then. That's an easy fix! I got my first event.

What would be the coding needed to add unique names to units received through this event? This would probably have to come through yet another Python file, this one connecting to the actual event, right?
 
Correct, as you can see events themselves also have similar Python tags. For this particular case I would use <PythonCallback>, which would gift the free units and name them at the same time. So, I wouldn't use <iNumFreeUnits>. This is one of those limitations I mentioned earlier.

My first step is to look up the Python function for naming units in the Python API. The API is quite extensive, so I looked for the string 'name' in CyUnit and I found a setName() function.

The entire code for this would take some time to produce and therefore you might want to give it a try yourself first.

"I'm trying to free your mind, Ambreville. But I can only show you the door. You're the one that has to walk through it." ;)
 
Solver, is there any possibility to just raise the probability of random events happening? I mean not a particular event, but let's say no ANY event might happen every 50 turns and I want ANY event every 5 turns. Where is a global variable in the XML files which I can tweak to achieve this. Went through your guides, but couldn't find it.
 
Correct, as you can see events themselves also have similar Python tags. For this particular case I would use <PythonCallback>, which would gift the free units and name them at the same time. So, I wouldn't use <iNumFreeUnits>. This is one of those limitations I mentioned earlier. (...)

Thanks for your time.

BTW, the new Python coding you passed along this morning somehow doesn't appear to make the event in question pop up on Turn 32. :confused:
 
Ok, looks like I made a mistake. I thought kTriggeredData.iTurn was the actual gameturn, but it seems to be a number for amount of turns that have passed since the begin.

kTriggeredData.iTurn- will return the turn number on which the event was triggered. Useful for expiration checks &#8211; you can, for example, easily check how many turns it&#8217;s been since the event was triggered.

In your case it should be 32 - 24 = 8

EDIT: On the other hand, your first code was very close.

Code:
######## Destroyers4Bases (English event) #########

def canTriggerDestroyers4Bases(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)

	if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_ENGLAND")):
		game = gc.getGame()
						
		if (game.[B]getGameTurn[/B]() == 32):
			return true
		return false

	return false

This shows that I'm also just getting to know all the available Python functions.
 
Solver, is there any possibility to just raise the probability of random events happening? I mean not a particular event, but let's say no ANY event might happen every 50 turns and I want ANY event every 5 turns. Where is a global variable in the XML files which I can tweak to achieve this. Went through your guides, but couldn't find it.

I'm not sure Solver is reading this thread, but I might help you in the right direction. Random events were introduced in BTS, so let's see what Kael's Modders Guide to Beyond the Sword tells us:

11.1 New Global Defines

....
EVENT_PROBABILITY_ROLL_SIDES- The higher this number the less likely events are to occur

I guess you have to change that number from the default 100 to something lower to get a more 'eventful' game...
 
For those of your who are used to modding your own events. I'm running into an impasse with something that I thought would be easy. Maybe you can help.

I want to set up a recurring event. So far, the initial event triggers exactly when it's supposed to, and the event itself does what it's designed to do.

I've go the recurrent tag set to 1 in the trigger info. The odds of triggering are at 100, with the weight set to -1. I also included the event to clear itself in the event info (I tried this both ways actually).

I'm assuming that under these settings, this event should occur every turn. It does not. It only triggers once apparently.

Does anyone know what I'm missing??

Thanks!

-----------------

EDIT

Amazingly, I just noticed the previous post! Maybe this is what I need to deal with...

-----------------

EDIT #2

The Global Defines entry does accelerate the frequency of events in general, but it didn't fix the recurrence issue with my event. I don't think it is recurring at all...
 
For some reason, I can't get my quest event to actually fail and return the "quest failed text" when it's supposed to...

The quest event works when the player meets the required conditions. If unsuccessful, the quest's initial text remains in the player's quest log, and the event does not seem to terminate.

If anyone wants to help with this, here is the relevant code.

Spoiler :
Code:
		<EventTriggerInfo>
			<Type>EVENTTRIGGER_WOLF_PACKS</Type>
			<WorldNewsTexts>
				<Text>TXT_KEY_EVENTTRIGGER_WOLF_PACKS</Text>
			</WorldNewsTexts>
			<TriggerTexts>
				<TriggerText>
					<Text></Text>
					<Era>NONE</Era>
				</TriggerText>
			</TriggerTexts>
			<bSinglePlayer>0</bSinglePlayer>
			<iPercentGamesActive>100</iPercentGamesActive>
			<iWeight>-1</iWeight>
			<bProbabilityUnitMultiply>0</bProbabilityUnitMultiply>
			<bProbabilityBuildingMultiply>0</bProbabilityBuildingMultiply>
			<Civic>NONE</Civic>
			<iMinTreasury>0</iMinTreasury>
			<iMinPopulation>0</iMinPopulation>
			<iMaxPopulation>0</iMaxPopulation>
			<iMinMapLandmass>0</iMinMapLandmass>
			<iMinOurLandmass>0</iMinOurLandmass>
			<iMaxOurLandmass>-1</iMaxOurLandmass>
			<MinDifficulty>NONE</MinDifficulty>
			<iAngry>0</iAngry>
			<iUnhealthy>0</iUnhealthy>
			<UnitsRequired/>
			<iNumUnits>0</iNumUnits>
			<iNumUnitsGlobal>0</iNumUnitsGlobal>
			<iUnitDamagedWeight>0</iUnitDamagedWeight>
			<iUnitDistanceWeight>0</iUnitDistanceWeight>
			<iUnitExperienceWeight>0</iUnitExperienceWeight>
			<bUnitsOnPlot>0</bUnitsOnPlot>
			<BuildingsRequired/>
			<iNumBuildings>0</iNumBuildings>
			<iNumBuildingsGlobal>0</iNumBuildingsGlobal>
			<iNumPlotsRequired>0</iNumPlotsRequired>
			<bOwnPlot>0</bOwnPlot>
			<iPlotType>-1</iPlotType>
			<FeaturesRequired/>
			<TerrainsRequired/>
			<ImprovementsRequired/>
			<BonusesRequired/>
			<RoutesRequired/>
			<ReligionsRequired/>
			<iNumReligions>0</iNumReligions>
			<CorporationsRequired/>
			<iNumCorporations>0</iNumCorporations>
			<bPickReligion>0</bPickReligion>
			<bStateReligion>0</bStateReligion>
			<bHolyCity>0</bHolyCity>
			<bPickCorporation>0</bPickCorporation>
			<bHeadquarters>0</bHeadquarters>
			<Events>
				<Event>EVENT_WOLF_PACKS_1</Event>
			</Events>
			<PrereqEvents/>
			<bPrereqEventPlot>0</bPrereqEventPlot>
			<OrPreReqs/>
			<AndPreReqs/>
			<ObsoleteTechs/>
			<bRecurring>0</bRecurring>
			<bTeam>0</bTeam>
			<bGlobal>0</bGlobal>
			<bPickPlayer>0</bPickPlayer>
			<bOtherPlayerWar>0</bOtherPlayerWar>
			<bOtherPlayerHasReligion>0</bOtherPlayerHasReligion>
			<bOtherPlayerHasOtherReligion>0</bOtherPlayerHasOtherReligion>
			<bOtherPlayerAI>0</bOtherPlayerAI>
			<iOtherPlayerShareBorders>0</iOtherPlayerShareBorders>
			<OtherPlayerHasTech>NONE</OtherPlayerHasTech>
			<bPickCity>0</bPickCity>
			<bPickOtherPlayerCity>0</bPickOtherPlayerCity>
			<bShowPlot>0</bShowPlot>
			<iCityFoodWeight>0</iCityFoodWeight>
			<PythonCanDo>canTriggerWolfPacks</PythonCanDo>
			<PythonCanDoCity/>
			<PythonCanDoUnit/>
			<PythonCallback>doWolfPacks</PythonCallback>
		</EventTriggerInfo>
		<EventTriggerInfo>
			<Type>EVENTTRIGGER_WOLF_PACKS_DONE</Type>
			<WorldNewsTexts>
				<Text></Text>
			</WorldNewsTexts>
			<TriggerTexts>
				<TriggerText>
					<Text></Text>
					<Era>NONE</Era>
				</TriggerText>
			</TriggerTexts>
			<bSinglePlayer>0</bSinglePlayer>
			<iPercentGamesActive>100</iPercentGamesActive>
			<iWeight>-1</iWeight>
			<bProbabilityUnitMultiply>0</bProbabilityUnitMultiply>
			<bProbabilityBuildingMultiply>0</bProbabilityBuildingMultiply>
			<Civic>NONE</Civic>
			<iMinTreasury>0</iMinTreasury>
			<iMinPopulation>0</iMinPopulation>
			<iMaxPopulation>0</iMaxPopulation>
			<iMinMapLandmass>0</iMinMapLandmass>
			<iMinOurLandmass>0</iMinOurLandmass>
			<iMaxOurLandmass>-1</iMaxOurLandmass>
			<MinDifficulty>NONE</MinDifficulty>
			<iAngry>0</iAngry>
			<iUnhealthy>0</iUnhealthy>
			<UnitsRequired>NONE</UnitsRequired>
			<iNumUnits>0</iNumUnits>
			<iNumUnitsGlobal>0</iNumUnitsGlobal>
			<iUnitDamagedWeight>0</iUnitDamagedWeight>
			<iUnitDistanceWeight>0</iUnitDistanceWeight>
			<iUnitExperienceWeight>0</iUnitExperienceWeight>
			<bUnitsOnPlot>0</bUnitsOnPlot>
			<BuildingsRequired>BUILDINGCLASS_DRYDOCK</BuildingsRequired>
			<iNumBuildings>12</iNumBuildings>
			<iNumBuildingsGlobal>0</iNumBuildingsGlobal>
			<iNumPlotsRequired>0</iNumPlotsRequired>
			<bOwnPlot>0</bOwnPlot>
			<iPlotType>-1</iPlotType>
			<FeaturesRequired/>
			<TerrainsRequired/>
			<ImprovementsRequired/>
			<BonusesRequired/>
			<RoutesRequired/>
			<ReligionsRequired/>
			<iNumReligions>0</iNumReligions>
			<CorporationsRequired/>
			<iNumCorporations>0</iNumCorporations>
			<bPickReligion>0</bPickReligion>
			<bStateReligion>0</bStateReligion>
			<bHolyCity>0</bHolyCity>
			<bPickCorporation>0</bPickCorporation>
			<bHeadquarters>0</bHeadquarters>
			<Events>
				<Event>EVENT_WOLF_PACKS_DONE_1</Event>
			</Events>
			<PrereqEvents>
				<Event>EVENT_WOLF_PACKS_1</Event>
			</PrereqEvents>
			<bPrereqEventPlot>0</bPrereqEventPlot>
			<OrPreReqs/>
			<AndPreReqs/>
			<ObsoleteTechs/>
			<bRecurring>0</bRecurring>
			<bTeam>0</bTeam>
			<bGlobal>0</bGlobal>
			<bPickPlayer>0</bPickPlayer>
			<bOtherPlayerWar>0</bOtherPlayerWar>
			<bOtherPlayerHasReligion>0</bOtherPlayerHasReligion>
			<bOtherPlayerHasOtherReligion>0</bOtherPlayerHasOtherReligion>
			<bOtherPlayerAI>0</bOtherPlayerAI>
			<iOtherPlayerShareBorders>0</iOtherPlayerShareBorders>
			<OtherPlayerHasTech>NONE</OtherPlayerHasTech>
			<bPickCity>0</bPickCity>
			<bPickOtherPlayerCity>0</bPickOtherPlayerCity>
			<bShowPlot>0</bShowPlot>
			<iCityFoodWeight>0</iCityFoodWeight>
			<PythonCanDo>canTriggerWolfPacksDone</PythonCanDo>
			<PythonCanDoCity/>
			<PythonCanDoUnit/>
			<PythonCallback>doWolfPacksDone</PythonCallback>
		</EventTriggerInfo>

------------------------------------------------------

		<EventInfo>
			<Type>EVENT_WOLF_PACKS_1</Type>
			<Description>TXT_KEY_EVENT_WOLF_PACKS_1</Description>
			<LocalInfoText/>
			<WorldNewsTexts/>
			<OtherPlayerPopup/>
			<QuestFailText>TXT_KEY_EVENT_FAIL_WOLF_PACKS</QuestFailText>
			<bQuest>1</bQuest>
			<bGlobal>0</bGlobal>
			<bTeam>0</bTeam>
			<bPickCity>0</bPickCity>
			<bPickOtherPlayerCity>0</bPickOtherPlayerCity>
			<bDeclareWar>0</bDeclareWar>
			<iGold>0</iGold>
			<bGoldToPlayer>0</bGoldToPlayer>
			<iRandomGold>0</iRandomGold>
			<iCulture>0</iCulture>
			<iEspionagePoints>0</iEspionagePoints>
			<bGoldenAge>0</bGoldenAge>
			<iFreeUnitSupport>0</iFreeUnitSupport>
			<iInflationMod>0</iInflationMod>
			<iSpaceProductionMod>0</iSpaceProductionMod>
			<Tech>NONE</Tech>
			<TechFlavors/>
			<iTechPercent>0</iTechPercent>
			<iTechCostPercent>0</iTechCostPercent>
			<iTechMinTurnsLeft>0</iTechMinTurnsLeft>
			<PrereqTech>NONE</PrereqTech>
			<UnitClass>NONE</UnitClass>
			<iNumFreeUnits>0</iNumFreeUnits>
			<bDisbandUnit>0</bDisbandUnit>
			<iUnitExperience>0</iUnitExperience>
			<iUnitImmobileTurns>0</iUnitImmobileTurns>
			<UnitPromotion/>
			<UnitName/>
			<UnitCombatPromotions/>
			<UnitClassPromotions/>
			<BuildingClass>NONE</BuildingClass>
			<iBuildingChange>0</iBuildingChange>
			<BuildingExtraYields/>
			<BuildingExtraCommerces/>
			<BuildingExtraHappies/>
			<BuildingExtraHealths/>
			<iHappy>0</iHappy>
			<iHealth>0</iHealth>
			<iHurryAnger>0</iHurryAnger>
			<iHappyTurns>0</iHappyTurns>
			<iRevoltTurns>0</iRevoltTurns>
			<iMinPillage>0</iMinPillage>
			<iMaxPillage>0</iMaxPillage>
			<iFood>0</iFood>
			<iFoodPercent>0</iFoodPercent>
			<FreeSpecialistCounts/>
			<FeatureType>NONE</FeatureType>
			<iFeatureChange>0</iFeatureChange>
			<ImprovementType>NONE</ImprovementType>
			<iImprovementChange>0</iImprovementChange>
			<BonusType>NONE</BonusType>
			<iBonusChange>0</iBonusChange>
			<RouteType>NONE</RouteType>
			<iRouteChange>0</iRouteChange>
			<BonusRevealed>NONE</BonusRevealed>
			<BonusGift>NONE</BonusGift>
			<PlotExtraYields/>
			<iConvertOwnCities>0</iConvertOwnCities>
			<iConvertOtherCities>0</iConvertOtherCities>
			<iMaxNumReligions>-1</iMaxNumReligions>
			<iOurAttitudeModifier>0</iOurAttitudeModifier>
			<iAttitudeModifier>0</iAttitudeModifier>
			<iTheirEnemyAttitudeModifier>0</iTheirEnemyAttitudeModifier>
			<iPopulationChange>0</iPopulationChange>
			<AdditionalEvents/>
			<EventTimes/>
			<ClearEvents/>
			<PythonCallback/>
			<PythonExpireCheck/>
			<PythonCanDo/>
			<PythonHelp/>
			<Button>,Art/Interface/Buttons/Process/Blank.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,8,5</Button>
			<iAIValue>1000</iAIValue>
		</EventInfo>
		<EventInfo>
			<Type>EVENT_WOLF_PACKS_DONE_1</Type>
			<Description>TXT_KEY_EVENT_WOLF_PACKS_DONE_1</Description>
			<LocalInfoText/>
			<WorldNewsTexts/>
			<OtherPlayerPopup/>
			<QuestFailText/>
			<bQuest>0</bQuest>
			<bGlobal>0</bGlobal>
			<bTeam>0</bTeam>
			<bPickCity>0</bPickCity>
			<bPickOtherPlayerCity>0</bPickOtherPlayerCity>
			<bDeclareWar>0</bDeclareWar>
			<iGold>0</iGold>
			<bGoldToPlayer>0</bGoldToPlayer>
			<iRandomGold>0</iRandomGold>
			<iCulture>0</iCulture>
			<iEspionagePoints>0</iEspionagePoints>
			<bGoldenAge>0</bGoldenAge>
			<iFreeUnitSupport>0</iFreeUnitSupport>
			<iInflationMod>0</iInflationMod>
			<iSpaceProductionMod>0</iSpaceProductionMod>
			<Tech>NONE</Tech>
			<TechFlavors/>
			<iTechPercent>0</iTechPercent>
			<iTechCostPercent>0</iTechCostPercent>
			<iTechMinTurnsLeft>0</iTechMinTurnsLeft>
			<PrereqTech>NONE</PrereqTech>
			<UnitClass>NONE</UnitClass>
			<iNumFreeUnits>0</iNumFreeUnits>
			<bDisbandUnit>0</bDisbandUnit>
			<iUnitExperience>0</iUnitExperience>
			<iUnitImmobileTurns>0</iUnitImmobileTurns>
			<UnitPromotion/>
			<UnitName/>
			<UnitCombatPromotions/>
			<UnitClassPromotions/>
			<BuildingClass>NONE</BuildingClass>
			<iBuildingChange>0</iBuildingChange>
			<BuildingExtraYields/>
			<BuildingExtraCommerces/>
			<BuildingExtraHappies/>
			<BuildingExtraHealths/>
			<iHappy>0</iHappy>
			<iHealth>0</iHealth>
			<iHurryAnger>0</iHurryAnger>
			<iHappyTurns>0</iHappyTurns>
			<iRevoltTurns>0</iRevoltTurns>
			<iMinPillage>0</iMinPillage>
			<iMaxPillage>0</iMaxPillage>
			<iFood>0</iFood>
			<iFoodPercent>0</iFoodPercent>
			<FreeSpecialistCounts/>
			<FeatureType>NONE</FeatureType>
			<iFeatureChange>0</iFeatureChange>
			<ImprovementType>NONE</ImprovementType>
			<iImprovementChange>0</iImprovementChange>
			<BonusType>NONE</BonusType>
			<iBonusChange>0</iBonusChange>
			<RouteType>NONE</RouteType>
			<iRouteChange>0</iRouteChange>
			<BonusRevealed>NONE</BonusRevealed>
			<BonusGift>NONE</BonusGift>
			<PlotExtraYields/>
			<iConvertOwnCities>0</iConvertOwnCities>
			<iConvertOtherCities>0</iConvertOtherCities>
			<iMaxNumReligions>-1</iMaxNumReligions>
			<iOurAttitudeModifier>0</iOurAttitudeModifier>
			<iAttitudeModifier>0</iAttitudeModifier>
			<iTheirEnemyAttitudeModifier>0</iTheirEnemyAttitudeModifier>
			<iPopulationChange>0</iPopulationChange>
			<AdditionalEvents/>
			<EventTimes/>
			<ClearEvents>
				<EventChance>
					<Event>EVENT_WOLF_PACKS_1</Event>
					<iEventChance>100</iEventChance>
				</EventChance>
			</ClearEvents>
			<PythonCallback/>
			<PythonExpireCheck/>
			<PythonCanDo/>
			<PythonHelp/>
			<Button>,Art/Interface/Buttons/Process/Blank.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,8,5</Button>
			<iAIValue>1000</iAIValue>
		</EventInfo>

-----------------------------------------------

########  Wolf Packs (1940 German Event Turn == 32 ) #########

def canTriggerWolfPacks(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)

	if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_GERMANY")):
		game = gc.getGame()

		if (game.getGameTurn() == 32):
			return true
		return false

	return false

def doWolfPacks(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)
	pPlayer = gc.getPlayer(1)

	if not player.isHuman():

		iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
		for i in range(1):
			newUnit1 = pPlayer.initUnit(iSubmarine, 1, 21, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
			iFlanking1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING1')
			newUnit1.setHasPromotion(iFlanking1, true)
			iFlanking2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING2')
			newUnit1.setHasPromotion(iFlanking2, true)
			newUnit1.setName("U68 Karl-Friedrich Merten")

		iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
		for i in range(1):
			newUnit1 = pPlayer.initUnit(iSubmarine, 1, 21, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
			iFlanking1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING1')
			newUnit1.setHasPromotion(iFlanking1, true)
			iFlanking2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING2')
			newUnit1.setHasPromotion(iFlanking2, true)
			newUnit1.setName("U-156 Werner Hartenstein")

		iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
		for i in range(1):
			newUnit1 = pPlayer.initUnit(iSubmarine, 1, 21, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
			iFlanking1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING1')
			newUnit1.setHasPromotion(iFlanking1, true)
			iFlanking2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING2')
			newUnit1.setHasPromotion(iFlanking2, true)
			newUnit1.setName("U-172 Carl Emmermann")

		iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
		for i in range(1):
			newUnit1 = pPlayer.initUnit(iSubmarine, 1, 21, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
			iFlanking1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING1')
			newUnit1.setHasPromotion(iFlanking1, true)
			iFlanking2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_FLANKING2')
			newUnit1.setHasPromotion(iFlanking2, true)
			newUnit1.setName("U-504 Hans-Georg Poske")

	return 1

########  Wolf Packs DONE (1941 German Event Turn == 51 ) #########

def canTriggerWolfPacksDone(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)

	if (player.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_GERMANY")):
		game = gc.getGame()

		if (game.getGameTurn() == 51):
			return true
		return false

	return false

def doWolfPacksDone(argsList):
	kTriggeredData = argsList[0]
	pPlayer = gc.getPlayer(1)

	iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
	for i in range(1):
		newUnit1 = pPlayer.initUnit(iSubmarine, 16, 20, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		iDrill1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL1')
		newUnit1.setHasPromotion(iDrill1, true)
		iDrill2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL2')
		newUnit1.setHasPromotion(iDrill2, true)
		newUnit1.setName("U99 Otto Kretschmer")

	iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
	for i in range(1):
		newUnit1 = pPlayer.initUnit(iSubmarine, 16, 20, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		iDrill1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL1')
		newUnit1.setHasPromotion(iDrill1, true)
		iDrill2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL2')
		newUnit1.setHasPromotion(iDrill2, true)
		newUnit1.setName("U100 Joachim Schepke")

	iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
	for i in range(1):
		newUnit1 = pPlayer.initUnit(iSubmarine, 16, 20, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		iDrill1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL1')
		newUnit1.setHasPromotion(iDrill1, true)
		iDrill2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL2')
		newUnit1.setHasPromotion(iDrill2, true)
		newUnit1.setName("U46 Engelbert Endrass")

	iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
	for i in range(1):
		newUnit1 = pPlayer.initUnit(iSubmarine, 16, 20, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		iDrill1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL1')
		newUnit1.setHasPromotion(iDrill1, true)
		iDrill2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL2')
		newUnit1.setHasPromotion(iDrill2, true)
		newUnit1.setName("U96 Heinrich Lehmann-Willenbrock")

	iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
	for i in range(1):
		newUnit1 = pPlayer.initUnit(iSubmarine, 16, 20, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		iDrill1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL1')
		newUnit1.setHasPromotion(iDrill1, true)
		iDrill2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL2')
		newUnit1.setHasPromotion(iDrill2, true)
		newUnit1.setName("U43 Wolfgang Luth")

	iSubmarine = gc.getInfoTypeForString('UNIT_SUBMARINE')
	for i in range(1):
		newUnit1 = pPlayer.initUnit(iSubmarine, 16, 20, UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		iDrill1 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL1')
		newUnit1.setHasPromotion(iDrill1, true)
		iDrill2 = CvUtil.findInfoTypeNum(gc.getPromotionInfo,gc.getNumPromotionInfos(),'PROMOTION_DRILL2')
		newUnit1.setHasPromotion(iDrill2, true)
		newUnit1.setName("U-552 Der Rote Teufel")

	return 1

-----------------------------------------------------------

	<TEXT>
		<Tag>TXT_KEY_EVENTTRIGGER_WOLF_PACKS</Tag>
		<English>News Reel: The Reich has begun massive concrete construction projects in French and German ports.</English>
		<French>News Reel: The Reich has begun massive concrete construction projectss in French and German ports.</French>
		<German>News Reel: The Reich has begun massive concrete construction projectss in French and German ports.</German>
		<Italian>News Reel: The Reich has begun massive concrete construction projectss in French and German ports.</Italian>
		<Spanish>News Reel: The Reich has begun massive concrete construction projectss in French and German ports.</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_EVENT_WOLF_PACKS_1</Tag>
		<English>The Führer has determined a need for at least twelve drydocks to support an effective blockade strategy of the main British ports. 

Additional tactical benefits will come about should you succeed in this massive construction project before February 1941. Heil Hitler!</English>
		<French>The Führer has determined a need for at least twelve drydocks to support an effective blockade strategy of the main British ports. 

Additional tactical benefits will come about should you succeed in this massive construction project before February 1941. Heil Hitler!</French>
		<German>The Führer has determined a need for at least twelve drydocks to support an effective blockade strategy of the main British ports. 

Additional tactical benefits will come about should you succeed in this massive construction project before February 1941. Heil Hitler!</German>
		<Italian>The Führer has determined a need for at least twelve drydocks to support an effective blockade strategy of the main British ports. 

Additional tactical benefits will come about should you succeed in this massive construction project before February 1941. Heil Hitler!</Italian>
		<Spanish>The Führer has determined a need for at least twelve drydocks to support an effective blockade strategy of the main British ports. 

Additional tactical benefits will come about should you succeed in this massive construction project before February 1941. Heil Hitler!</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_EVENT_WOLF_PACKS_DONE_1</Tag>
		<English>You have succeeded in your drydocks construction project. Additional combat resources are now available to maintain the naval stranglehold 

over Britain. Heil Hitler!</English>
		<French>You have succeeded in your drydocks construction project. Additional combat resources are now available to maintain the naval stranglehold 

over Britain. Heil Hitler!</French>
		<German>You have succeeded in your drydocks construction project. Additional combat resources are now available to maintain the naval stranglehold 

over Britain. Heil Hitler!</German>
		<Italian>You have succeeded in your drydocks construction project. Additional combat resources are now available to maintain the naval stranglehold 

over Britain. Heil Hitler!</Italian>
		<Spanish>You have succeeded in your drydocks construction project. Additional combat resources are now available to maintain the naval stranglehold 

over Britain. Heil Hitler!</Spanish>
	</TEXT>
	<TEXT>
		<Tag>TXT_KEY_EVENT_FAIL_WOLF_PACKS</Tag>
		<English>You have failed to build enough drydocks. It is a setback for the Reich.</English>
		<French>You have failed to build enough drydocks. It is a setback for the Reich.</French>
		<German>You have failed to build enough drydocks. It is a setback for the Reich.</German>
		<Italian>You have failed to build enough drydocks. It is a setback for the Reich.</Italian>
		<Spanish>You have failed to build enough drydocks. It is a setback for the Reich.</Spanish>
	</TEXT>

Thanks!
 
Back
Top Bottom