I think I have spotted some potential CTD bugs here:
Code:
#(1538-1556) Sher Khan's Victory
event = {
id = 230016
trigger = {
event = 128014 #BGL: Sher Khan becomes Sher Shah
OR = {
AND = {
control = { province = 553 data = BGL } #Raipur
owned = { province = 553 data = MOG }
}
AND = {
control = { province = 545 data = BGL } #Bundelkhand
owned = { province = 545 data = MOG }
}
AND = {
control = { province = 553 data = BGL } #Awadh
owned = { province = 553 data = MOG }
}
AND = {
control = { province = 543 data = BGL } #Delhi
owned = { province = 543 data = MOG }
}
AND = {
control = { province = 554 data = BGL } #Tirhut, owned by Delhi in 1520 scenario
owned = { province = 554 data = MOG }
}
}
}
random = no
country = MOG
name = "EVENTNAME230016" #Sher Khan's Victory
desc = "EVENTHIST230016"
#-#
date = { day = 1 month = january year = 1538 }
offset = 1
deathdate = { day = 13 month = february year = 1556 }
action_a = {
name = "ACTIONNAME230016A" #Retreat and live to fight another day
command = { type = stability value = -3 }
command = { type = secedeprovince which = BGL value = 545 } #Bundelkhand
command = { type = secedeprovince which = BGL value = 544 } #Awadh
command = { type = secedeprovince which = BGL value = 553 } #Raipur
command = { type = secedeprovince which = BGL value = 554 } #Tirhut, owned by Delhi in 1520 scenario
command = { type = domestic which = quality value = -2 }
command = { type = domestic which = offensive value = -1 }
command = { type = treasury value = -100 }
command = { type = desertion which = -1 value = 5000 }
command = { type = desertion which = -1 value = 5000 }
command = { type = desertion which = -1 value = 5000 }
command = { type = desertion which = -1 value = 5000 }
}
}
#-#On the way home from Gaur in June 1539, Humayun's forces entered battle against Sher Khan and his Afghan followers. Sher Shah proved victorious and the Mughal forces were massacred, drowned or captured. Humayun himself was saved by a water-carrier who carried him across the Ganges, into which he had recklessly jumped. This stunning victory over the Great Mughal was a tremendous success for Sher Khan and made him the de facto ruler of the Mughal lands from Kanauj in the west to the hills of Assam and Cittagong in the south.
As to be sure I would add this line in yellow:
Code:
#(1538-1556) The Battle of Kanauj
event = {
id = 230017
trigger = {
[COLOR=Yellow]NOT = { exists = DHL }[/COLOR]
event = 230016 #MOG: Sher Khan's Victory
control = { province = 543 data = BGL } #Delhi (Kanauj is just east of Agra, in Delhi province)
}
random = no
country = MOG
name = "EVENTNAME230017" #The Battle of Kanauj
desc = "EVENTHIST230017"
#-#
date = { day = 1 month = january year = 1538 }
offset = 1
deathdate = { day = 13 month = february year = 1556 }
action_a = {
name = "ACTIONNAME230017A" #We have lost Hindustan but kept our life
#command = { type = AI which = peaceful.ai }
command = { type = stability value = -3 }
command = { type = capital which = 1523 } #(Lahore?) #Thar
command = { type = secedeprovince which = BGL value = 543 } #Delhi
command = { type = secedeprovince which = BGL value = 1520 } #Chandigarh
command = { type = secedeprovince which = BGL value = 1521 } #Panjab
command = { type = desertion which = -1 value = 5000 }
command = { type = desertion which = -1 value = 5000 }
command = { type = desertion which = -1 value = 5000 }
command = { type = desertion which = -1 value = 5000 }
command = { type = treasury value = -100 }
command = { type = trigger which = 128015 } #BGL: Hindustan returns to Afghan rule
}
}
#-#The year after his disastrous defeat against Sher Shah, Humayun made another attempt to regain his empire and put down the rebellion. His brothers refused to cooperate with him in this, despite Humayun personally travelling to Lahore to convince them. Nevertheless, he quickly raised an army and faced the Afghans in battle on May 17, 1540 opposite Kanauj. Hopelessly demoralized and badly managed, Humayun's forces were soundly defeated and Humayun only just managed to escape. The great conquests of Babur had been lost and once more Hindustan returned to Afghan rule. Humayun was forced into exile for the next fifteen years.
Code:
#(1538-1556) Hindustan returns to Afghan rule
event = {
id = 128015 #triggered by MOG_230017
random = no
country = BGL
name = "EVENTNAME128015" #Hindustan returns to Afghan rule
desc = "EVENTHIST128015"
#-#
action_a = {
name = "ACTIONNAME128015A" #We have forced the Mughals out of India
command = { type = flagname which = "" }
command = { type = country which = DLH }
command = { type = capital which = 543 } #Delhi
command = { type = stability value = 3 }
command = { type = addcore which = 543 } #Delhi
command = { type = DIP which = 1 value = 120 }
command = { type = treasury value = 200 }
command = { type = vp value = 50 }
}
}
#-#The year after his disastrous defeat against Sher Shah, Humayun made another attempt to regain his empire and put down the rebellion. His brothers refused to cooperate with him in this, despite Humayun personally travelling to Lahore to convince them. Nevertheless, he quickly raised an army and faced the Afghans in battle on May 17, 1540 opposite Kanauj. Hopelessly demoralized and badly managed, Humayun's forces were soundly defeated and Humayun only just managed to escape. The great conquests of Babur had been lost and once more Hindustan returned to Afghan rule. Humayun was forced into exile for the next fifteen years while Sher Shah extended his rule all the way to the Punjab, where he marched to subdue the hill tribes of Gakkar without much success.
Here we have the potential CTD problem too with 543 (Delhi):
Code:
DLH = { #Delhi
date = { day = 1 month = january year = 1419 }
expirydate = { day = 29 month = december year = 1545 }
minimum = { 543 545 }
extra = { 553 }
capital = 543
group = muslim
religion = sunni
ai = "SmallTrade1.ai"
}
MOG = { #Mughal Empire
date = { day = 1 month = january year = 1527 }
expirydate = { year = 1820 }
minimum = { 543 }
extra = { 544 545 553 554 1520 1521 1523 1524 1525 1527 }
capital = 543
group = muslim
religion = sunni
ai = "MOG_PostDelhi.ai"
}
BGL = { #Bengal
date = { day = 1 month = january year = 1419 }
expirydate = { year = 1820 }
minimum = { 559 558 }
extra = { 555 557 }
capital = 559
group = muslim
ai = "SmallTrade1.ai"
}
Another question is: can BGL change into DHL in the time span 1545-1556 even if DHL is releasable until 1545 only?
In event MOG_230017 we have a capital move before ceding Delhi to BGL. Since Delhi shoud (I repeat, should) be current Mughal capital, according to revolt.txt and event MOG_3805, shouldn't we use at least a flag to test where current capital is, if possible?