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

PAW

Captain
17 Badges
Feb 9, 2011
403
21
  • Crusader Kings II
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Iron Cross
  • Heir to the Throne
  • Hearts of Iron III
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • East India Company
  • Darkest Hour
  • Hearts of Iron Anthology
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • 500k Club
  • Hearts of Iron IV Sign-up
Okay, I will post my Decision soon with some code that I need help with.
But 1st, what is the diffrence beteen:
decision_trigger
trigger

Thx,
PAW
 
Ok - I have built the decision - not sure if it will work yet, and any advice woud be appreciated.
USS Mississippi & USS Idaho were sold to Greece on 30 Jul 1914.

SO here goes:
event = {
id = 2191673 # USS Mississippi (BB-23) & USS Idaho (BB-24) are sold to Greece - 30 Jul 1914
country = USA

decision = {
division_exists = { type = 10054 id = 543 } #USS Mississippi
division_exists = { type = 10054 id = 544 } #USS Idaho
exists = GRE
NOT = { war = { country = GRE country = USA } }
}
decision_trigger = {
event = 2191674
exists = GRE
division_in_province = { id = { type = 10054 id = 543 } province = 2743 } #Sea of Crete
division_in_province = { id = { type = 10054 id = 544 } province = 2743 }
}
trigger = {
event = 2191674
exists = GRE
division_in_province = { id = { type = 10054 id = 543 } province = 2743 } #Sea of Crete
division_in_province = { id = { type = 10054 id = 544 } province = 2743 }
}

name = "EVT1914_2191673_NAME"
desc = "EVT1914_2191673_DESC"
style = 2
picture = "mittelmeerdivision2" #PAW - look for Pic
decision_picture = "decision_mittelmeerdivision2" #PAW - look for Pic

date = { day = 28 month = june year = 1914 } #PAW - fix date after passing testing - 15 Jul 1914 - allow for sailing to Greece

action = {
name = "ACTION_NAME_GOOD"
ai_chance = 100
command = { type = relation which = GRE value = 10 }
command = { type = money value = 100}
command = { type = remove_division which = 10054 value = 543} #USS Mississippi
command = { type = remove_division which = 10054 value = 544} #USS Idaho
}
}

event = {
id = 2191674 # create Greek Battleships - in Athens
country = GRE
name = "EVT1914_2191674_NAME"
desc = "EVT1914_2191674_DESC"
style = 2
picture = "events_empty"
# date = { year = 1920 month = june day = 7 } # Not Needed as fires from above instantly?
action = {
name = "ACTION_NAME_OK"
ai_chance = 100
command = { type = money value = -100}
command = { type = add_corps value = naval where = 377 } #Athens
command = { type = add_division which = "BEN Kilkis" value = battleship when = 1 } #former USS Mississippi
command = { type = add_division which = "BEN Lemnos" value = battleship when = 1 } #former USS Idaho
}
}

CODE IS WRONG - See attached file further below.
 
Last edited:
Nah. Wont work at all.
You should look into the DH/Modding documentation/event commands.txt.

For the 'decision = { }' line keep in mind that decisions are hidden until all triggers in 'decision = { }' section is true.
So i would try to keep the trigger line as short as possible here. But your structure seems okay to me.

For the trigger line keep in mind that AI has to be able to fulfill the trigger conditions here. So commands like 'division_in_province' will be a problem for the AI because there is always a chance that they wont be able to fulfill the trigger at all. So keep the AI trigger line as generic as possible.

For your general structure:
I cant see any command to fire your greece unit spawn event. Look into the DH event command.txt to find the best way for your decision here.
 
For the trigger line keep in mind that AI has to be able to fulfill the trigger conditions here. So commands like 'division_in_province' will be a problem for the AI because there is always a chance that they wont be able to fulfill the trigger at all. So keep the AI trigger line as generic as possible.

Thx, so If I change the trigger (AI), and make it simple so it will fire, how about this:

trigger = {
event = 2191674
exists = GRE
division_exists = { type = 10054 id = 543 } #USS Mississippi
division_exists = { type = 10054 id = 544 } #USS Idaho
}

So human player has to transfer ships, however, for AI purposes we assume both parties agree and ship sailed to Greece and deal completed.

PAW
 
Ok - Human run 1st. I have tweaked code, thx for help, will share once 100%.

Decision shows correctly in box on left.
Moved ships to correct location. decision_trigger fires up
decision complete - 2 USS BB removed from game.

However, I need that other event to fire so the 2 Greek BB are created.

Where and how do I reference event = 2191674 The Greek one I assume it must be separate as it is for country = GRE

PAW
 
ok - after some testing last night - got it all working - thx for the tips. I can post code if anyone wants to see it now.
Further to this, because it was 1914 - I noticed that Greece already had the 2 BB's to start. So the starting ships is wrong for 1914.
I now have the whole thing working perfectly, have sailed the ships across the Atlantic via Liberia and slightly changed the event so that
the ships are removed on the 30 Jul.

Fixed both Starting Naval ships for USA & GRE - implemented new Decision - tested both USA & Greece and now satisfied that the Decision
does what it is supposed to do.

I will copy code into .txt file and upload for anyone to use if they have a mod start in 1914 before 30 Jul 1914.