• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Pang Bingxun

Field Marshal
2 Badges
Nov 22, 2011
5.596
186
  • Arsenal of Democracy
  • 500k Club
Code:
#########################################################################
#  Huayuankow (Chengchow) flooding
#########################################################################

event = {
	id = 87
	random = no
	country = CHI

	name = EVT_87_NAME
	desc = EVT_87_DESC
	style = 0
	picture = "huayankow6"

	trigger = {
                event = 4109 # industry needs to be saved first
		war = { country = JAP country = CHI }
		control = { province = 1224 data = JAP } # Anyang
	}


        date = { day = 0 month = january year = 1936 }
        offset = 5
	deathdate = { day = 29 month = december year = 1963 }

	action_a = {
		ai_chance = 90
		name = EVT_87_ACTA
		command = { type = construct which = ic where = 1228 value = -3 } # Zhengzhou, higher IC effect
		command = { type = construct which = infrastructure where = 1228 value = -25 }
		command = { type = construct which = ic where = 1229 value = -2 } # Nanyang
		command = { type = construct which = infrastructure where = 1229 value = -15 } # lower infra effect here
		command = { type = construct which = ic where = 1230 value = -2 } # Xinyang
		command = { type = construct which = infrastructure where = 1230 value = -25 }
		command = { type = dissent value = 1 } # the KMT is killing it's own people
	}

	action_b = {
		ai_chance = 10
		name = EVT_87_ACTB
		command = { type = dissent value = 1 } # the KMT does NOT do enough to stop the Japanese
	}
}

# Move Zhengzhou
###############
event = {
	id = 4109
	random = no
	country = CHI

	name = EVT_86_NAME
	desc = EVT_86_DESC
    	picture = "transfer"
	style = 0

	trigger = {
		atwar = yes
		local_flag = CHIIndustry
		control = { province = 1228 data = CHI } #Zhengzhou
		control = { province = 1280 data = CHI } #Chungking
		OR = {
			NOT = { control = { province = 1222 data = CHI } }
			NOT = { control = { province = 1223 data = CHI } }
			NOT = { control = { province = 1224 data = CHI } }
			NOT = { control = { province = 1227 data = CHI } }
			NOT = { control = { province = 1230 data = CHI } }
		}
	}

	date = { day = 0 month = january year = 1936 }
	offset = 10
	deathdate = { day = 29 month = december year = 1999 }

	action_a = {
		name = EVT_86_ACTA
		command = { type = local_setflag which = CHIIndustry }
        	command = { type = construct which = ic where = 1228 value = -2 } # Zhengzhou
        	command = { type = construct which = ic where = 1280 value = 2 }  # Chungking
	}
}

In the current version of those events the industry transfer can happen after the industry was destroyed by the other event. That generates 2 factories out of nothing. Either the transfer should only happen if the flooding did not occur or the flooding should only occur after saving the industry. I suggest the latter by adding the line i added at the top.
 
Upvote 0
Good idea but actually required an OR trigger construction if a human player denied industrial transfer in 4104.

Somehow true, altough not very likely to happen anyway. I think this should do the trick:

Code:
#########################################################################
#  Huayuankow (Chengchow) flooding
#########################################################################

event = {
	id = 87
	random = no
	country = CHI

	name = EVT_87_NAME
	desc = EVT_87_DESC
	style = 0
	picture = "huayankow6"

	trigger = {
                OR = {
                        event = 4109 # industry needs to be saved first
			NOT = { local_flag = CHIIndustry } # only if it is allowed to be saved
		}
		war = { country = JAP country = CHI }
		control = { province = 1224 data = JAP } # Anyang
	}


        date = { day = 0 month = january year = 1936 }
        offset = 5
	deathdate = { day = 29 month = december year = 1963 }

	action_a = {
		ai_chance = 90
		name = EVT_87_ACTA
		command = { type = construct which = ic where = 1228 value = -3 } # Zhengzhou, higher IC effect
		command = { type = construct which = infrastructure where = 1228 value = -25 }
		command = { type = construct which = ic where = 1229 value = -2 } # Nanyang
		command = { type = construct which = infrastructure where = 1229 value = -15 } # lower infra effect here
		command = { type = construct which = ic where = 1230 value = -2 } # Xinyang
		command = { type = construct which = infrastructure where = 1230 value = -25 }
		command = { type = dissent value = 1 } # the KMT is killing it's own people
	}

	action_b = {
		ai_chance = 10
		name = EVT_87_ACTB
		command = { type = dissent value = 1 } # the KMT does NOT do enough to stop the Japanese
	}
}