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

Amartus

Captain
34 Badges
Jul 14, 2008
441
12
  • Hearts of Iron Anthology
  • Semper Fi
  • Europa Universalis: Rome
  • Iron Cross
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Deus Vult
  • Darkest Hour
  • Hearts of Iron IV: Together for Victory
  • Knights of Honor
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Ancient Space
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron 4: Arms Against Tyranny
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • 500k Club
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Victoria: Revolutions
  • Arsenal of Democracy
  • Rome Gold
Hi there

I am trying to create an event / events that will go through ai minors deleting ground units when they are at peace:

Code:
event = {
	id = 2233509
	persistent = yes

	trigger = {
		and = {
			ai = yes
			major = no
			atwar = no
				not = {
					country = BUL
					country = FIN
					country = GRE
					country = OTT
					country = U08
					country = U09
					country = ROM
					}
			}
	}

	date = { day = 10 month = january year = 1920 }
	offset = 15
	deathdate = { day = 10 month = january year = 1939 }

	name = "Unit control"
	desc = "Unit control"

	action_a = {
	name = "Unit control"
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
	}
}
event = {
	id = 2233510
	persistent = yes

	trigger = {
		and = {
			ai = yes
			major = no
			atwar = no
				not = {
					country = BUL
					country = FIN
					country = GRE
					country = OTT
					country = U08
					country = U09
					country = ROM
					}
			}
	}

	date = { day = 10 month = january year = 1920 }
	offset = 15
	deathdate = { day = 10 month = january year = 1939 }

	name = "Unit control"
	desc = "Unit control"

	action_a = {
	name = "Unit control"
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
		command = { type = delete_unit which = -1 }
	}
}

Above is what I have done so far. Two events that are supposed to trigger for ALL ai minors in peacetime with the exception of the ones listed and delete their ground units. They are not triggering however, and I was wondering if anyone could tell me why?

Many thanks in advance,
Amartus
 
You probably want to add another trigger not = { army = 0 } since this event will run (with no effect)even when a country's army is 0.
 
Sorry, but in order of not spamming this forum with such threads, may I post my own little event problem here?


Well, you see, Germany got crushed in the war. I, as Russia, have destroyed them in the east and have captured Berlin, whilst the only attack into France that they have attempted was a total disaster. So now Germany, now with a "modern" flag is utterly weak. So i thought why not try and make my first Event, that will annex the Netherlands and Belgium into Germany, thus making it a regional power again.
But when I fire the event it simply crashes my game; I don't exactly see where the mistake is as I know nothing about writing events.

So if you don't mind checking this/correcting any mistakes I would be extremely thankful :) (The event is to be triggered manually.)

event = {
id = 913379
random = no
country = GER

name = "Belgium And Netherlands join the Reich"
desc = "Germany noms the Benelux"
picture = "coastal_fort"
style = 0

action_a = {
name = "Om nom nom."
ai_chance = 99

command = { type = inherit which = BEL value = 1 }
command = { type = inherit which = HOL value = 1 }
command = { type = manpowerpool value = 1000 }
command = { type = dissent value = -25 }
command = { type = domestic which = defense_lobby value = 1 }

command = { type = relation which = ENG value = -40 }
command = { type = relation which = FRA value = -40 }
command = { type = relation which = ITA value = -40 }
command = { type = relation which = CZE value = -40 }
command = { type = relation which = HUN value = -15 }
command = { type = relation which = AUS value = -15 }
command = { type = relation which = RUS value = -10 }
}
action_b = {
name = "Tummy is full"
ai_chance = 1
command = { }
}
}
 
Sorry, but in order of not spamming this forum with such threads, may I post my own little event problem here?


Well, you see, Germany got crushed in the war. I, as Russia, have destroyed them in the east and have captured Berlin, whilst the only attack into France that they have attempted was a total disaster. So now Germany, now with a "modern" flag is utterly weak. So i thought why not try and make my first Event, that will annex the Netherlands and Belgium into Germany, thus making it a regional power again.
But when I fire the event it simply crashes my game; I don't exactly see where the mistake is as I know nothing about writing events.

So if you don't mind checking this/correcting any mistakes I would be extremely thankful :) (The event is to be triggered manually.)
First off:
*If you want a manual trigger event via the console, use decisions (although those are buggy, they don't always show up). It would be good to use trigger = { ai = no }
*You don't have a start-date/end-date for the ai to check if the triggers are valid and "execute" the command/event.

I have no idea about the crash. The event seems to be coded fine. Perhaps remove the linebreaks in between the commands.

PS: You don't need action_a and action_b anymore. Just action is fine in DH. :)
 
First off:
*If you want a manual trigger event via the console, use decisions (although those are buggy, they don't always show up). It would be good to use trigger = { ai = no }
*You don't have a start-date/end-date for the ai to check if the triggers are valid and "execute" the command/event.

I have no idea about the crash. The event seems to be coded fine. Perhaps remove the linebreaks in between the commands.

PS: You don't need action_a and action_b anymore. Just action is fine in DH. :)

I'll try removing the empty spaces later, maybe it'll help :)

I thought the mistake was the TAG for Germany - I don't know if all Germany's have the same one :(
 
Good and bad news in my struggle for events.
Good:
1) The event now fires without crashing the game.
Bad:
1) It happens to me, not U08
2) Nothing happens when i try and run it: event 913379 u08 (I think i'm doing this wrong)
3) When I select option A, it says "Inherit the realms of..." and all the other stuff but I do not get control of the Benelux territories. Neither I get a manpower boost.

:( I really dont know why
 
Try event 913379 U08 (capital U)

Tried that as well. Altough the main problem seems to be that the commands dont work, altough they seem correct. Maybe I'll load the Save as Germany and try the event. I could just annex them manually and reload as Russia, but I really want to write my first own event and get it to work :)