• 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:
event = { 
	id = 27552
	random = no 
	country = CHI
	persistent = yes
	
	trigger = {
		ai = yes
		technology = 5080
		money = 970 # 250 left
		control = { province = 1280 data = CHI } # Chongqing
		NOT = { province_building = { province = 1280 building = 5 size = 0.6 } }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1996 }

	action_a = {
		command = { type = construct which = infrastructure where = 1280 value = 10 }
		command = { type = money value = -720 } # 240x2x0.95x0.68 ICD
		command = { type = manpowerpool value = -1 }
	}
}

According to event_commands.txt this event should only fire if the infrastructure in Chongqing is below 60%. Instead it fires if it is below 100%. It appear that only integer value are handled properly.
 
Upvote 0
The trigger works now properly. But as they are no longer integer values triggers in events may have to to be adapted to this lack of precision. For example the following event should only trigger if the infrastructure is below 60%. But it does even trigger if the infra is exact 60%.

Code:
event = { 
	id = 27553
	random = no 
	country = CHI
	persistent = yes
	
	trigger = {
		ai = yes
		technology = 5080
		money = 1690 # 250 left
		control = { province = 1228 data = CHI } # Zhengzhou
		NOT = { province_building = { province = 1228 building = 5 size = 0.6 } }
		OR = {
			province_building = { province = 1305 building = 5 size = 0.6 } # Check Jinghong first
			NOT = { control = { province = 1305 data = CHI } }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1996 }

	action_a = {
		command = { type = construct which = infrastructure where = 1228 value = 10 }
		command = { type = money value = -1440 } # 2.0x240x2x0.95x0.68 ICD
		command = { type = manpowerpool value = -1 }
	}
}