Scions of Patria?

I tried out the 8.3 HL code and I don't think it's working either. No idea why, but I turned the random # down to 10 and still bupkis. I also tried out the earlier code, and it covered every Scion plot with HL all at once.

Me, I'm going back to my new method with the Creepers. Not only do I like it, but with far less python I can still pretend to understand what's going on with the code. :badcomp:

Anyone want to venture an opinion on the new HL method? (Ghostwalkers randomly spawn Creepers, who can plant a HL tile or destroy another civ's food-improvement.) Or, since I don't expect anyone to have tried it, the old one where HLs just appear? If people seem satisfied with it I'll just maintain the new thing for my own use.


*****

Balance: After looking at the passive training/free xp possibilities more, I think level 4 or even 5 is probably better as min-level for Emperor's Dagger, but given that and as the only "true" Assassin available to the Scions, she deserves a +1 strength and defense.
 
To Whom it May Concern:

Attached is a module that re-vamps Melante's Dark Council spell, and adds another.

Rather than a (second) world spell requiring the 4 minor heroes it requires 1 of each type of Great Person settled in a Scion city. It removes them and adds the Dark Council. Melante is also permanently removed.

The spell added is "Turn." It allows her to spend 20% of your gold in an attempt to steal a GP, ala "Kidnap." Odds of success are your gold/50. Like "Kidnap" it can cause a war, though the odds are lower and it's a "LIMITED" rather than "TOTAL" war.

In addition to the attached XML files there's some python.

CvFFHPLUS: This goes in doTurnScions.

It makes Melante Immortal in the same way Alcinus is. The change is to make it so Melante can't come back after the DC is built.

Spoiler :

Code:
	if pPlayer.isHasTech(gc.getInfoTypeForString('TECH_FEUDALISM')):
		if pPlayer.getNumBuilding(gc.getInfoTypeForString('BUILDING_DARK_COUNCIL')) == 0:
			iMelanteClass = gc.getInfoTypeForString('UNITCLASS_MELANTE')
			if pPlayer.getUnitClassCount(iMelanteClass) == 0:
				iMelanteOdds = 6
				estiEnd = CyGame().getEstimateEndTurn()
				if ( estiEnd >= 1500 ):
					iMelanteOdds = 2
				elif ( estiEnd >= 750 ):
					iMelanteOdds = 3
				elif ( estiEnd >= 500 ):
					iMelanteOdds = 4
				elif ( estiEnd >= 330 ):
					iMelanteOdds = 5
				else:
					iMelanteOdds = iMelanteOdds
				if CyGame().getSorenRandNum(5, "Melante spawn check") < iMelanteOdds:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_MELANTE'), pTomb.getX(), pTomb.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)


Python for "Turn" and "Dark Council" spells. Goes in Scions.py. The "Dark Council" spell req. replaces the previous one.

Spoiler :

Code:
def reqDarkC(caster):
	pCity = caster.plot().getPlotCity()
	if pCity.getTeam() != caster.getTeam():
		return False
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST')) == 0:
		return False
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST')) == 0:
		return False
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT')) == 0:
		return False
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER')) == 0:
		return False
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST')) == 0:
		return False
	return True
	
def spellDarkC(caster):
	pCity = caster.plot().getPlotCity()
	pCity.changeFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST'), -1)
	pCity.changeFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST'), -1)
	pCity.changeFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT'), -1)
	pCity.changeFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER'), -1)
	pCity.changeFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST'), -1)
	
def reqMelanteKidnap(caster):
	pPlayer = gc.getPlayer(caster.getOwner())
	pCity = caster.plot().getPlotCity()
	if pCity.getTeam() == caster.getTeam():
		return False
	i = 0
	i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST'))
	i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST'))
	i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT'))
	i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER'))
	i = i + pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST'))
	if i == 0:
		return False
		
	if pPlayer.isHuman() == False:
		if pPlayer.getGold() < 2500:
			return False
		
	return True

def spellMelanteKidnap(caster):
	pPlayer = gc.getPlayer(caster.getOwner())
	pCity = caster.plot().getPlotCity()
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST')) > 0:
		iUnit = gc.getInfoTypeForString('UNIT_PROPHET')
		iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_PRIEST')
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST')) > 0:
		iUnit = gc.getInfoTypeForString('UNIT_ARTIST')
		iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_ARTIST')
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT')) > 0:
		iUnit = gc.getInfoTypeForString('UNIT_MERCHANT')
		iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_MERCHANT')
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER')) > 0:
		iUnit = gc.getInfoTypeForString('UNIT_ENGINEER')
		iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_ENGINEER')
	if pCity.getFreeSpecialistCount(gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST')) > 0:
		iUnit = gc.getInfoTypeForString('UNIT_SCIENTIST')
		iSpec = gc.getInfoTypeForString('SPECIALIST_GREAT_SCIENTIST')
	iGold = pPlayer.getGold() 
	iChance = iGold * 0.02
	iBribe = iGold / 5
	if iBribe > 2000:
		iBribe = 2000
	pPlayer.changeGold(-iBribe)
	if CyGame().getSorenRandNum(100, "Melante Bribe") <= iChance:
		newUnit = pPlayer.initUnit(iUnit, caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
		pCity.changeFreeSpecialistCount(iSpec, -1)
	else:
		if CyGame().getSorenRandNum(100, "Melante Bribe") <= 30:
			caster.setXY(pPlayer.getCapitalCity().getX(), pPlayer.getCapitalCity().getY(), false, true, true)
		else:
			caster.kill(True, 0)
		cf.startWar(caster.getOwner(), pCity.getOwner(), WarPlanTypes.WARPLAN_LIMITED)
 

Attachments

  • Melante.rar
    2.6 KB · Views: 78
Tarquelne,

You have some code a few posts back and some more in the bugs thread (both related to haunted lands, which apparently don't work in base 8.30). Could you combine these with the post above and put it all together in one place?
 
You have some code a few posts back and some more in the bugs thread (both related to haunted lands, which apparently don't work in base 8.30). Could you combine these with the post above and put it all together in one place?

I tried the posted 8.2 code this morning and couldn't get it working right. I guess there's something before or after what I posted that's needed. If someone posts an 8.2 (or earlier, probably) version of CvFFHPLUS I should be able to figure out it.

Short of that there's just the new system. I did get a 8.3 file, so the attachement should contain everything needed. If it still doesn't work post the error - I should be able to figure out what I missed. And if you send me a PM I'll get an e-mail notice, and may get back to you faster.

Everything but the python file goes into a folder under NormalModules called "ScionSpell". The python file over-writes the 8.3 file of the same name. The folder is Python/Contrib.

EDIT: For the sake of completeness, here's the updated TXT entries to.

The first just clarifies that Arawn's Dust doesn't cause war. The second updates the Ghostwalker entry: The key new items are 1) Life and Nature mana, plus having Korinna the Black, makes Creepers spawn faster. 2) Creepers stop spawning when there's more Creepers than Ghostwalkers.

TEXT Changes.

To TXT_KEY_SPELL_ARAWNS_DUST_HELP
Spoiler :

Code:
    <English>Destroys a camp, farm, pasture, or plantation.  Does not trigger war.</English>


To TXT_KEY_UNIT_GHOSTWALKER_PEDIA

Spoiler :

Code:
 <English>Sometimes a Cetratus or Velite will abandon his unit, and sometimes a Ghostwalker returns.[PARAGRAPH:1]Ghostwalkers have a special relationship with the Gift.  Short of Redactors, no other Scion knows more about it.  Or perhaps they know more than even Redactors... none are more influenced and changed by the Gift than Ghostwalkers.[PARAGRAPH:1]Ghostwalkers may shed their own blood to create Reaching Creepers.  The Creepers in turn may plant Haunted Lands or spread the blight called Arawn's Dust.  The more Life or Nature mana the Scions possess, the more quickly Creepers will be created.  The Black Lady also encourages Creeper creation.  However, Creepers are demanding of both blood and affection - Creeper creation will stop if there are more Creepers than Ghostwalkers.</English>
 

Attachments

  • Creeper2.rar
    56.2 KB · Views: 85
I tried the posted 8.2 code this morning and couldn't get it working right. I guess there's something before or after what I posted that's needed. If someone posts an 8.2 (or earlier, probably) version of CvFFHPLUS I should be able to figure out it.

Short of that there's just the new system. I did get a 8.3 file, so the attachement should contain everything needed. If it still doesn't work post the error - I should be able to figure out what I missed. And if you send me a PM I'll get an e-mail notice, and may get back to you faster.

Everything but the python file goes into a folder under NormalModules called "ScionSpell". The python file over-writes the 8.3 file of the same name. The folder is Python/Contrib.

EDIT: For the sake of completeness, here's the updated TXT entries to.

The first just clarifies that Arawn's Dust doesn't cause war. The second updates the Ghostwalker entry: The key new items are 1) Life and Nature mana, plus having Korinna the Black, makes Creepers spawn faster. 2) Creepers stop spawning when there's more Creepers than Ghostwalkers.

TEXT Changes.

To TXT_KEY_SPELL_ARAWNS_DUST_HELP
Spoiler :

Code:
    <English>Destroys a camp, farm, pasture, or plantation.  Does not trigger war.</English>


To TXT_KEY_UNIT_GHOSTWALKER_PEDIA

Spoiler :

Code:
 <English>Sometimes a Cetratus or Velite will abandon his unit, and sometimes a Ghostwalker returns.[PARAGRAPH:1]Ghostwalkers have a special relationship with the Gift.  Short of Redactors, no other Scion knows more about it.  Or perhaps they know more than even Redactors... none are more influenced and changed by the Gift than Ghostwalkers.[PARAGRAPH:1]Ghostwalkers may shed their own blood to create Reaching Creepers.  The Creepers in turn may plant Haunted Lands or spread the blight called Arawn's Dust.  The more Life or Nature mana the Scions possess, the more quickly Creepers will be created.  The Black Lady also encourages Creeper creation.  However, Creepers are demanding of both blood and affection - Creeper creation will stop if there are more Creepers than Ghostwalkers.</English>

@Sephi, if you havent got these text tags i will add them now
 
I found the passive HL Spread bug. Looking forward to the creepers!

I'm having fun with the Creepers. Mostly trying to make the Grigori miserable enough to accept the Gift. I think they'll work really well with the "Uncreation" Epic Destiny, since the player has more choices and doesn't just build Ghostwalkers. (Though that's a necessary start.)

Otherwise I'm being nice, trying to run up the Pax Patria counter. :)

Do you know how the passive spread code could be modified to keep the spread rate independent of Scion territory size?

I thought of checking against a random number (using the same factors as currently) and only if it succeeds randomly placing a HL feature. But I don't know how to ID a random plot.

*****

In the CvFFHPLUS code I posted for Creeper generation the random "Creeper check" number is 24. That seems too favorable: 50ish is probably a better guess at a "balanced" figure. (But I did have 4 total Life and Nature mana. Maybe what seemed too many Creepers was in-line with the investment.)

Here's the CvFFHPLUS block - starting at if iCreeperSeed >0: using a higher number, and also has a check for being outside Scion territory. Spawning can still happen, but at 1/3 the rate.

Spoiler :

Code:
		if iCreeperSeed > 0:
			if pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_GHOSTWALKER'):
				if pUnit.plot().getOwner()==pUnit.getOwner():
					if CyGame().getSorenRandNum(48, "Creeper check")<=iCreeperSeed:
						spawnUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_CREEPER'), pUnit.getX(), pUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
				else:
					if CyGame().getSorenRandNum(144, "Creeper check")<=iCreeperSeed:
						spawnUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_CREEPER'), pUnit.getX(), pUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)



And here's a revised python req. for the Creeper "Arawn's Dust" spell. The change is disabling casting in Scion borders. (For the AI.)

Spoiler :

Code:
# Req for Arawn's Dust	
def reqSpoil(caster):
	iScions = gc.getInfoTypeForString('CIVILIZATION_SCIONS')
	pPlot = caster.plot()
	iFarm = gc.getInfoTypeForString('IMPROVEMENT_FARM')
	iPasture = gc.getInfoTypeForString('IMPROVEMENT_PASTURE')
	iPlantation = gc.getInfoTypeForString('IMPROVEMENT_PLANTATION')
	iCamp = gc.getInfoTypeForString('IMPROVEMENT_CAMP')
	if pPlot.isOwned():
		if gc.getPlayer(pPlot.getOwner()).getCivilizationType() == iScions:	
			return False
	if pPlot.getImprovementType() == iFarm:
		return True
	if pPlot.getImprovementType() == iCamp:
		return True
	if pPlot.getImprovementType() == iPasture:
		return True
	if pPlot.getImprovementType() == iPlantation:
		return True
	return False


*****

Also: Here's a slightly souped-up version of the Dark Council building. Increased the WW by 5, added +2 points toward Great Merchant. (It didn't quite seem worth "burning" Melante and 4 GP.)

Spoiler :

Code:
		<BuildingInfo>		<!-- Dark Council -->
			<BuildingClass>BUILDINGCLASS_DARK_COUNCIL</BuildingClass>
			<Type>BUILDING_DARK_COUNCIL</Type>
			<Description>TXT_KEY_BUILDING_DARK_COUNCIL</Description>
			<Civilopedia>TXT_KEY_BUILDING_DARK_COUNCIL_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_DARK_COUNCIL_STRATEGY</Strategy>
			<Advisor>ADVISOR_ECONOMY</Advisor>
			<ArtDefineTag>ART_DEF_BUILDING_DARK_COUNCIL</ArtDefineTag>
			<PrereqTech>TECH_NEVER</PrereqTech>
            <GreatPeopleUnitClass>UNITCLASS_MERCHANT</GreatPeopleUnitClass>
            <iGreatPeopleRateChange>2</iGreatPeopleRateChange>
			<bNeverCapture>1</bNeverCapture>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iConquestProb>0</iConquestProb>
			<iCost>-1</iCost>									
			<iMaintenanceModifier>-20</iMaintenanceModifier>
			<iGlobalWarWearinessModifier>-10</iGlobalWarWearinessModifier>
			<iEnemyWarWearinessModifier>20</iEnemyWarWearinessModifier>
			<iGlobalTradeRoutes>1</iGlobalTradeRoutes>
			<iAsset>4</iAsset>
			<fVisibilityPriority>10</fVisibilityPriority>
			<CommerceChanges>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
			</CommerceChanges>
			<CommerceModifiers>
				<iCommerce>0</iCommerce>
				<iCommerce>0</iCommerce>
				<iCommerce>10</iCommerce>
			</CommerceModifiers>
            <SpecialistCounts>
                <SpecialistCount>
                    <SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
                    <iSpecialistCount>2</iSpecialistCount>
                </SpecialistCount>
            </SpecialistCounts>
			<FreeSpecialistCounts>
				<SpecialistCount>
					<SpecialistType>SPECIALIST_MERCHANT</SpecialistType>
					<iSpecialistCount>1</iSpecialistCount>
				</SpecialistCount>
			</FreeSpecialistCounts>
			<ConstructSound>AS2D_BUILD_MARKETPLACE</ConstructSound>
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_GOLD</FlavorType>
					<iFlavor>10</iFlavor>
				</Flavor>
			</Flavors>
			<iCrime>5</iCrime>
			<PrereqCiv>CIVILIZATION_SCIONS</PrereqCiv>			
		</BuildingInfo>
 
A refinement to the Redactor's HL spell. (See, with WM's AI the games are lasting long enough to get some good late-game playtests.)

It moves the declaration of war from use on foreign soil to *after* the spell's effect, and allows the spell to hit Floodplains within Scion territory and turn them to nice, pristine deserts. Who needs all that mud?

Spoiler :

Code:
# Redactor's Haunted Land creating spell.   - Doesn't change mountains, floodplains outside Scion territory.  Doesn't always work on forests, jungles.
def spellHL(caster):
	iScions = gc.getInfoTypeForString('CIVILIZATION_SCIONS')
	pPlot = caster.plot()
		
	iX = caster.getX()
	iY = caster.getY()
#	pPlot = CyMap().plot(iX,iY)
	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.isWater() == False:
				if pPlot.isCity() == False:
					if pPlot.isPeak() == False:
						if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_VOLCANO')) == False:
							if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_FLOOD_PLAINS') and gc.getPlayer(pPlot.getOwner()).getCivilizationType() != iScions) == False:
								if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_FOREST_ANCIENT') and (CyGame().getSorenRandNum(3, "HL destroy A_Forest Chance") > 0)) == False:
									if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_FOREST') and (CyGame().getSorenRandNum(3, "HL destroy Forest Chance") == 0)) == False:
										if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_JUNGLE') and (CyGame().getSorenRandNum(3, "HL destroy jungle Chance") == 0)) == False:
											pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_HAUNTED_LANDS'),0)
	if pPlot.isOwned():
		cf.startWar(caster.getOwner(), pPlot.getOwner(), WarPlanTypes.WARPLAN_LIMITED)
 
What should I do with Alcinus (WM 8.30)? For the last dozens of turns he was Enraged, then dying, resurrected, dying, resurrected... he can never ever win a battle so that this §$%& promotion wears off. Is he simply crap?
 
What should I do with Alcinus (WM 8.30)? For the last dozens of turns he was Enraged, then dying, resurrected, dying, resurrected... he can never ever win a battle so that this §$%& promotion wears off. Is he simply crap?

There may be something odd with your install: When I unpack the 8.3 patch files I see the updated Alcinus immortality system, which doesn't have that Enraged loop.

(Rather than the "Immortal" promotion there's some python running each turn that may bring him back without his acquired xps.)
 
Just four days ago I did a fresh install of Wildmana 8.00 and patch 8.30. I am also playing a multiplayer game (but not with the Scions) and there are no problems, so I assume there isn't really a problem with my installation.

But coincidentally Alcinus has really won a fight against a goblin some minutes ago, so he is fine right now. If he is mad again, I can post a savegame, if you want.
 
Hmm... a savegame wouldn't help me, but I've got an idea: 8.0 had SCION files duplicated in the Jotnar civ's directory. The files aren't removed by patches, and an old Scion file there can over-ride the new 8.3 file and make the new python moot.

If you've got a bunch of files with "SCION" names in Assets/Modules/NormalModules/FFHPLUS/Civs/Jotnar, I think that's the problem.

Just deleting the files during a game is likely to cause a surreal game, if not outright crashes, but I think you'd be OK if you copied over the SCION files in the Jotnar folder with the Scion files from the Scions of Patria directory.

That, or, if you're up to a little XML editing, remove the "Immortal" free promo from the three Alcinus entries in the UnitInfos file of the Scions of Patria module.
 
Yes, there are 30 files (SCIONS_*) in my Jotnar folder. So simply overwriting them with their counterparts in the 'Scions of Patria' folder will solve the problem?
And how does this affect my multiplayer game, does the other player also have to do this?

Edit:
Now I have overwritten the files. When I want to load my savegame, an error message appears for a very short time (I can't read the text) and the game crashes instantly. :(
 
editing the XML often breaks saves. you can make a clean install of 8.30 to load your savegame. For the next game just delete all SCIONS_ files from the Jotnar folder.
 
I made a backup before I changed the files, so there is not a problem. :)
Ok, I will delete them when I start my next game.
 
I made a backup before I changed the files

Glad you had a backup. Sorry! I hadn't realized the XML changes from .0 to .3 had been extensive enough to cause problems, but I should have said something about backing-up anyway.
 
Ok, now I deleted the SCIONS_* files in my Jotnar directory, my brother did this too. Then he created a new multiplayer game, he chose the Scions, I took the Balseraph. The game went OOS in the first turn. He then saved the game and created a new one with this savegame. I joined and we launched the game. After the progress bar was at 100%, my Civ4 said something like 'Failed to decompress ... invalid game data' and 'Load failed' and crashed (Civ4 failed to respond). This behaviour was repeatable.

Once we have copied back our original SCIONS_* files in our Jotnar directory, we could start a new game without problems. So this problem seems to be in the missing SCIONS_* files.
 
Once we have copied back our original SCIONS_* files in our Jotnar directory, we could start a new game without problems. So this problem seems to be in the missing SCIONS_* files.

All I can do is recommend the bug thread. The error you describe is one generated when the files from a saved game don't match the current files. But if you both deleted the SCION files from the Jotnar folder that shouldn't have been the case.
 
Do you know how the passive spread code could be modified to keep the spread rate independent of Scion territory size?

You could devide by pPlayer.getNumCities() It should scale fairly well with territory size
 
Top Bottom