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

Timotheus1

Captain
9 Badges
Jan 14, 2013
393
541
  • Crusader Kings II
  • Europa Universalis III: Chronicles
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Victoria 2
  • 500k Club
  • Hearts of Iron IV Sign-up
Why does the AI do this event when I play nation other than GER?
ai_will_do is set to 0 WTHeck? :)



This is in Specials file in TFH Decisions:

#TIMO new diplomatic decision for germany
#Trade with Sweden for metal
########################
# Trade with Sweden #
########################
# you can do this as many times as you want
diplomatic_decisions = {

trade_with_sweden = {
major = yes
potential = {
tag = GER
exists = SWE
}
allow = {
supplies = 50
money = 50
}
effect = {

supplies = -50
money = -50
metal = 500

set_country_flag = trade_with_sweden
}
ai_will_do = { factor = 0 }
}





OK, now this is in triggered_modifiers file in TFH common:

# timo trade with sweden for germany begin
# you can do this as many times as you want
trade_with_sweden = {
potential = {
TAG = GER }

trigger = {
has_country_flag = trade_with_sweden
}

metal = 99999
}
# timo trade with sweden for germany end




Event works fine btw. I might add neutrality and somesuch maybe later.

Also amount of steel is for testing purposes only :D
 

Timotheus1

Captain
9 Badges
Jan 14, 2013
393
541
  • Crusader Kings II
  • Europa Universalis III: Chronicles
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Victoria 2
  • 500k Club
  • Hearts of Iron IV Sign-up
Woops wrong forum.
 

thexmassteam

Lt. General
26 Badges
Nov 14, 2011
1.457
566
  • Europa Universalis IV: Conquest of Paradise
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV
  • Semper Fi
  • Victoria: Revolutions
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • BATTLETECH
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Age of Wonders III
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • 500k Club
  • Victoria 2
  • Cities: Skylines
Ok, you've got a syntax error, you miss one "}" in the decision file, but it's maybe a copy/past issue.

Try for the event :
Code:
# timo trade with sweden for germany begin
# you can do this as many times as you want
trade_with_sweden = {
   potential = {
     has_country_flag = trade_with_sweden
   }
   metal = 99999
}
# timo trade with sweden for germany end

Edit : also notice the migthy "code" tag ;)
 
Last edited:

Timotheus1

Captain
9 Badges
Jan 14, 2013
393
541
  • Crusader Kings II
  • Europa Universalis III: Chronicles
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Victoria 2
  • 500k Club
  • Hearts of Iron IV Sign-up
Hi thexmassteam.

But you didn't put in any ai_will_do statement in there, so by default AI will do this event, correct?

So your code does not change anything?


Edit: IT WAS THE MISSING "}".
I feel sheepish, thanks.
 
Last edited:

thexmassteam

Lt. General
26 Badges
Nov 14, 2011
1.457
566
  • Europa Universalis IV: Conquest of Paradise
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV
  • Semper Fi
  • Victoria: Revolutions
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • BATTLETECH
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Age of Wonders III
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • 500k Club
  • Victoria 2
  • Cities: Skylines
But you didn't put in any ai_will_do statement in there, so by default AI will do this event, correct?
So your code does not change anything?
Yes, but the "trade_with_sweden" flag can't be set if you are not Germany, so it's ok, AI will never fire this (afaik, I didn't try it) :) Remember that the less code you have, the fastest the game will be.

Edit: IT WAS THE MISSING "}".
I feel sheepish, thanks.
You're welcome.
If you use a basic text editor, try notepad++ instead, it'll help you for indentation and syntax. There is also tools to check file syntax, I never try but you can find them on the HOI3 wiki.
 

Timotheus1

Captain
9 Badges
Jan 14, 2013
393
541
  • Crusader Kings II
  • Europa Universalis III: Chronicles
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Victoria 2
  • 500k Club
  • Hearts of Iron IV Sign-up
I used to code for a living, I should have checked such simple syntax myself twice ot thrice :D

No need for notepad++ or a checking tool with this simple code, really.