• 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.

Abominus

French Maid
81 Badges
Sep 18, 2003
994
41
www.abominus.de.vu
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Sword of the Stars
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Nemesis
  • Darkest Hour
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Deus Vult
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III Collection
  • Heir to the Throne
Code:
#############################################
# Milizen der CSA umwandeln - Mechanized
#############################################
event = {
	id = 807079
	random = no 
	country = CSA

	persistent = yes

	trigger = {
		ai = yes
		atwar = yes
		militia = { country = CSA value = 1 }
		random = 5
	}

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

	action_a = {
		command = { type = delete_unit which = militia value = -1 }
		command = { type = add_division value = mechanized when = 0 }
	}
}

#############################################
# Milizen der CSA umwandeln - Motorized
#############################################
event = {
	id = 807080
	random = no 
	country = CSA

	persistent = yes

	trigger = {
		ai = yes
		atwar = yes
		militia = { country = CSA value = 1 }
		random = 10
	}

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

	action_a = {
		command = { type = delete_unit which = militia value = 1 }
		command = { type = add_division value = motorized when = 0 }
	}
}

#############################################
# Milizen der CSA umwandeln - Cavalry
#############################################
event = {
	id = 807081
	random = no 
	country = CSA

	persistent = yes

	trigger = {
		ai = yes
		atwar = yes
		militia = { country = CSA value = 1 }
		random = 1
	}

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

	action_a = {
		command = { type = delete_unit which = militia }
		command = { type = add_division value = cavalry when = 0 }
	}
}

Non of the Events delete a militia - unit. What is the right command?

The CSA has to much militia, and I found this event in the ai_spr.txt:

Code:
################
# Clear out militia from Spanish Civil War
#############################################
#event = {
#	id = 32562
#	random = no 
#	country = SPR

#	trigger = {
#		ai = yes
#		event = 32561
#		atwar = no
#		militia = { country = SPR value = 1 }
#	}

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

#	action_a = {
#		command = { type = delete_unit which = militia value = -1 }
#	}
#}

There I got it from.

Can anybody help me please :).
 

unmerged(12544)

General
Dec 9, 2002
1.936
0
Visit site
delete_unit only works this way

... type = delete_unit which = -1 }

deleting a random unit, that was created in game. Units from the starting *.inc files are not touched.

I don't know, what exactly you try to do, but there is also remove_division, that can use a name or id and does not have those restrictions.
 

Abominus

French Maid
81 Badges
Sep 18, 2003
994
41
www.abominus.de.vu
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Sword of the Stars
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Nemesis
  • Darkest Hour
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Deus Vult
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III Collection
  • Heir to the Throne
Panther II said:
delete_unit only works this way

... type = delete_unit which = -1 }

deleting a random unit, that was created in game. Units from the starting *.inc files are not touched.

I don't know, what exactly you try to do, but there is also remove_division, that can use a name or id and does not have those restrictions.

Yes, I know this command.

But my problem is, that I want to delet a random "militia" unit, which name I don't know.

In AEIOU, there is the american civil war in the year 1936. The CSA separates from the USA and the fight begins. When it ends (normally with a CSA-victory), there are too many units left (most of them militia). I would like to kill those units and let some of them convert into more "interesting" units. Who likes to play with militia, except for Russia? :rofl: