Svaltafar vs. Ljosafar

DarkxL0rd

Warlord
Joined
Mar 26, 2008
Messages
264
Location
Houston
Playing a game tonight and I was absolutely determined to create a perm alliance with Faeryl. I was playing as the wood elves. I literally did everything she asked of me. want money? ok. go to war? no problem. switch to Esus? where do I sign. But to no avail. come turn 320 she declares on me. I know this was put in as coding that the elves fight each other, cuz i usually play dark elves and the wood elves declare around the same time in those games every time. How do I turn this off?!!!!! At one point in the game she was friendly toward me, and we were at war!
 
I read somewhere that when Armageddon counter reach 30 or something they'll declare war on each other (but maybe it's feature from modmod).
 
I don't think that base FfH include specific behaviour code like this (Svart vs Ljos and vice versa). Or does it?

One thing about Faeryl, she is very much backstabber. She will declare wars with anyone at Pleased (and I modmoded her so she will declare wars with anyone at Friendly too :D)
 
It's in vanilla FFH and it's 30 AC, right. If it's in python, it should be pretty easy to change. Let me check.

[EDIT] the code says it's 20 AC, and here it is.

In CustomFunctions.py there is:

Code:
	def warScript(self, iPlayer):
		pPlayer = gc.getPlayer(iPlayer)
		iEnemy = -1
		for iPlayer2 in range(gc.getMAX_PLAYERS()):
			pPlayer2 = gc.getPlayer(iPlayer2)
			if pPlayer2.isAlive():
				iTeam = gc.getPlayer(iPlayer).getTeam()
				iTeam2 = gc.getPlayer(iPlayer2).getTeam()
				eTeam = gc.getTeam(iTeam)
				if eTeam.isAVassal() == False:
					if eTeam.isAtWar(iTeam2):
						if CyGame().getSorenRandNum(100, "War Script") < 5:
							self.dogpile(iPlayer, iPlayer2)
					if self.warScriptAllow(iPlayer, iPlayer2):
						if pPlayer2.getBuildingClassMaking(gc.getInfoTypeForString('BUILDINGCLASS_TOWER_OF_MASTERY')) > 0:
							if eTeam.getAtWarCount(True) == 0:
								self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
						if (pPlayer2.getNumBuilding(gc.getInfoTypeForString('BUILDING_ALTAR_OF_THE_LUONNOTAR_DIVINE')) > 0 or pPlayer2.getNumBuilding(gc.getInfoTypeForString('BUILDING_ALTAR_OF_THE_LUONNOTAR_EXALTED')) > 0):
							if pPlayer.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_EVIL'):
								if eTeam.getAtWarCount(True) == 0:
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
						if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_MERCURIANS'):
							if pPlayer2.getStateReligion() == gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL'):
								self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
						if CyGame().getGlobalCounter() > 20:
							if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SVARTALFAR'):
								if (pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR') and CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iPlayer2)):
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
							if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR'):
								if (pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SVARTALFAR') and CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iPlayer2)):
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
						if (CyGame().getGlobalCounter() > 40 or pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_INFERNAL') or pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_DOVIELLO')):
							if pPlayer.getAlignment() == gc.getInfoTypeForString('ALIGNMENT_EVIL'):
								if (eTeam.getAtWarCount(True) == 0 and CyGame().getPlayerRank(iPlayer2) > CyGame().getPlayerRank(iPlayer)):
									if (iEnemy == -1 or CyGame().getPlayerRank(iPlayer2) > CyGame().getPlayerRank(iEnemy)):
										iEnemy = iPlayer2
		if iEnemy != -1:
			if CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iEnemy):
				self.startWar(iPlayer, iEnemy, WarPlanTypes.WARPLAN_TOTAL)

It makes elves to fight elves at 20 and evil players to declare war at 40. You can comment the whole thing out to prevent unpredictable wars like that but it would be less fun. Or you could just remove the "elves" part if you want. It does not break saves or something, you can actually make it right during the game (but I'd suggest to relaunch FFH2 just in case, python rarely causes weird things when operating during a running game).

P.S. If you don't know what to do, better don't try to do it :). Or if you want it really, open CustomFunctions.py in notepad and look for 1192 string. Then remove or better comment out the following strings:
Code:
						if CyGame().getGlobalCounter() > 20:
							if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SVARTALFAR'):
								if (pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR') and CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iPlayer2)):
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
							if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR'):
								if (pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SVARTALFAR') and CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iPlayer2)):
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)

To comment them out place "#" in front of every string.
 
Oh yeah, found it in CustomFunctions.py under defwarScript.

Here is the code :
Spoiler :

Code:
						if CyGame().getGlobalCounter() > 20:
							if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SVARTALFAR'):
								if (pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR') and CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iPlayer2)):
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)
							if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_LJOSALFAR'):
								if (pPlayer2.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SVARTALFAR') and CyGame().getPlayerRank(iPlayer) > CyGame().getPlayerRank(iPlayer2)):
									self.startWar(iPlayer, iPlayer2, WarPlanTypes.WARPLAN_TOTAL)

Just delete this to disable it? Or, maybe, you can play as Ljos and capitulate Svart. I don't think this warScript works on capitulated civs.
 
Does Van Gossarm have script to conquer religious cities? I was at +16 friendliness with him, same religion, no red attitude markers, no land border, and he moved his troops to attack me just about the turn he sneaked ahead of me on the military chart. This surprised me since almost all the opponents were pleased or friendly with me and he was the smallest and weakest with just 3 cities. He lasted only ten turns more before he became my vassal of course.
 
Does Van Gossarm have script to conquer religious cities?

Nope. I think so, at least.
 
So i kept playing the game thinking, "ok I'll just beat her around a bit and then get peace and try again." So we play nice for 20 turns and she declares again! If it was just at 20 AC that's fine. but she seems determined to stay at war even though she has 5 cities compared to my 12 and is vastly out troop'd and out tech'd. Thanks for the responses however, I don't know how to mess with that stuff too well and I don't want to break anything. Someone said something about taking out the "elves" line? How is that done?
 
To be fair, the Svartalfar who refuse to be redeemed and rejoin civilized elven society are despicable traitors unworthy of living amongst the maggots of their dying forests' rotten logs...

(I actually rather can live with the AI scripted events that bring on set antagonisms/Good vs. Evil etc...and in fact modmoding with a little more prodding to get the AI to more often choose the right religion/civics and so on is/would be very nice, not having RoK and FoL everywhere)
 
So i kept playing the game thinking, "ok I'll just beat her around a bit and then get peace and try again." So we play nice for 20 turns and she declares again! If it was just at 20 AC that's fine. but she seems determined to stay at war even though she has 5 cities compared to my 12 and is vastly out troop'd and out tech'd. Thanks for the responses however, I don't know how to mess with that stuff too well and I don't want to break anything. Someone said something about taking out the "elves" line? How is that done?

There're other scripts which are not in Python but in SDK, something like "50 turns passed? I need to declare war", and I think they are there from BTS, because BTS had many things like these.
 
There're other scripts which are not in Python but in SDK, something like "50 turns passed? I need to declare war", and I think they are there from BTS, because BTS had many things like these.
There's nothing like this in the SDK. If they declare on you again after 50 turns, it's because they still think war against you is a good idea for whatever reason (or they were bribed).
 
Well, whenever I play Ljos or Svart, and the other one also exists, I always attack and capitulated it. Then, I force it to convert into my state religion (FOL or Esus, whichever I play). Then, I demand their mana. Mana is nice IMHO :D

If the diplo modifier is too negative (and the vassal always ask their mana back) then I kill them. As simple as that. No peaceful coexistence between Ljos and Svart :D
 
There's nothing like this in the SDK. If they declare on you again after 50 turns, it's because they still think war against you is a good idea for whatever reason (or they were bribed).

Are you sure? I am almost certain I saw it in CvGameCoreDLL, basically from time to time AI picks a player and declares a war. Maybe it's removed in FFH2 or I saw SDK of another mod, I don't remember, but it was by Firaxis :).
 
Are you sure? I am almost certain I saw it in CvGameCoreDLL, basically from time to time AI picks a player and declares a war. Maybe it's removed in FFH2 or I saw SDK of another mod, I don't remember, but it was by Firaxis :).

Maybe Monteczuma? He seems particularly crazy. I don't know, just speculating here.

Best wishes,

Breunor
 
Are you sure? I am almost certain I saw it in CvGameCoreDLL, basically from time to time AI picks a player and declares a war. Maybe it's removed in FFH2 or I saw SDK of another mod, I don't remember, but it was by Firaxis :).
At the end of CvTeamAI::AI_doWar, it has the code where the AI decides whether to start a war, but it's not completely random by any means. The problem with the scripted Python events is that they force AI civs to declare when they're not ready. It can also lead to war on multiple fronts, which is something the code in the DLL actively tries to avoid, i.e. it'll only start a new war if it's not already fighting one.
 
The problem with the scripted Python events is that they force AI civs to declare when they're not ready.
Would it be "helpful" if the script would gradually build up anger, instead of outright triggering a war?
Like e.g. checking the Armageddon Counter every 10 turns, and adding anger level depending on AC, religion, race etc. ... some of the good/neutral guys might panic if the AC gets too high and they're surrounded by evil neighbours ;)

For the exact values of the thresholds I would look at the Hell Terrain effect, which is what would be most prominently visible to everyone:

Hell Terrain will only spread to Ashen Veil players lands until the counter hits
25, then it will start to spread to unowned tiles. At
50 it will start to spread to other Evil players lands and at
75 it will start to spread to Neutral lands.


So e.g. Svaltafar might getting really nervous and think it would be better to unite all elves at AC 50 if they have the "usual" religion, and Ljosafar even only at AC 75 ... and not at 20 ?!

Sadly, I don't have a clue 'bout Civ scripting, and Python in general, so I don't know if this is feasible.

The current state, though, is highly annoying and needs to be changed!
Guess why I dug up this thread!? ;)
 
Back
Top Bottom