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

unmerged(71191)

Private
Mar 9, 2007
16
0
[edit]somehow the indentation did not show... , sorry if it is hard to read the event code[/edit]
I apologize for asking so many noob questions :eek:o
but since I failed first year computer science because of the logics... oh well

Anyway, I am trying to write 2 separate events, the first one forces JAP into an alliance with CHI:
###########################################
####Sino-Japanese Alliance###########
###########################################

event = {
id = 9505
random = no
country = CHI

trigger = {
war = { country = CHI country = JAP }
control = { province = 1190 data = CHI } #Fukuoka?
control = { province = 1184 data = CHI } #Hiroshima?
control = { province = 1185 data = CHI } #Osaka?
control = { province = 1186 data = CHI } #Nagoya
control = { province = 1187 data = CHI } #Kana... something
control = { province = 1188 data = CHI } #Tokyo
random = 80
}

name = "Sino-Japanese Alliance?"
desc = "CHI offers JAP alliance (I will modify later)"
picture = "I_have_not_decided_yet"
style = 0

date = { day = 9 month = january year = 1936 }
offset = 5
deathdate = { day = 29 month = december year = 1953 }

action_a = {
name = "Form an alliance!"
command = { type = peace which = JAP value =
1 }
command = { type = alliance which = JAP }
}
}
The event seemed to fire fine, but the problem being that as I move the cursor to the button for action A, only peace showed up in the blue pop-up box. And indeed, as I pressed it, only peace was concluded, not an alliance.

The second event is an event that portraits an ambitious industrialization project launched by Kuomingtang AFTER CHINA IS UNITED
So is this how I would write it ? :
###########################################
###Kuomingtang's ambitious project###########
###########################################

event = {
id = 9504
random = no
country = CHI

trigger = {
NOT = {
war = { country = JAP country = CHI }
exists = CGX
exists = CSX
exists = CHC
exists = CXB
exists = CYN
exists = SIK
exists = TIB
exists = MAN
exists = MEN
}
random = 50
}

name = "Ambitious Project"
desc = "What else needs to be said?"
picture = "transfer"
style = 0

date = { day = 0 month = may year = 1939 }
offset = 10
deathdate = { day = 29 month = december year = 1953 }

action_a = {
name = "China is finally on par with the West."

command = { type = add_prov_resource which =
1360 value = 200 where = metal }
command = { type = add_prov_resource which =
1360 value = 800 where = energy }
command = { type = add_prov_resource which =
1360 value = 400 where = rare_materials }
command = { type = add_prov_resource which =
1360 value = 105 where = oil }
command = { type = construct which = ic where
= 1360 value = 80 }
command = { type = add_prov_resource which =
}
}
(The above cheating value inputs are for tests only :p )
I hope I didn't forget any other countries that CHI has claims of territory for...
and besides, is there a limit on how many "commands" an event can have?


And one last question about the
command = { type = trigger which = XXXX }
command. Can this be used as part of a trigger of an other event? (I don't mean like sticking it into the trigger = {} )

Say, Event B would only fire, given that Event A (with command = { type = trigger which = event_B_ID }defined) had fired, AND that it must also match the trigger = { whatever situation that triggers event B } for B, so that event B does not accidently fire by itself just because the situation matches the trigger of B.

Sorry for a rather chaotic post, but I really could not find other ways to organize them :eek:o
 
Last edited:

Miihkali

Old Guard
6 Badges
Apr 11, 2007
2.970
11
  • Crusader Kings II
  • Darkest Hour
  • For The Glory
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
Trigger command is used only to trigger another event. You know what's event ID? Good. Then replace xxxx with event ID. When event launches and it has event command trigger xxxx, event which has ID xxxx launchs.

You can make alliance via event using event command:

Code:
command = { type = alliance which = TAG }

Replace TAG with nations TAG, for example GER for Germany.

AND, OR and NOT are for event triggers. Triggers are values which cause if event launches and when not.

For example, if you want to make event which makes alliance between Bhutan and Nepal, you maybe want to set trigger, that event doesn't launch if there's already alliance between Bhutan and Nepal or if they are at war against together. Then you can use NOT like this:

Code:
NOT = {
war = { country = BHU country = NEP }
alliance = { country = BHU country = NEP }
}

But this kind of trigger is useless, because it's true only if Bhutan and Nepal are same time war AND alliance. So you need to put there OR-tags.

Code:
NOT = {
OR = {
war = { country = BHU country = NEP }
alliance = { country = BHU country = NEP }
}
}

Now trigger is true only if Bhutan isn't at war with Nepal OR Bhutan hasn't alliance with Nepal. You see the difference? AND is almost useless, but it can be used with or Commands, for example event trigger can be true if:

Code:
OR = {
AND = {
alliance = { country = BHU country = NEP }
exists = MAN
}
AND = {
war = { country = BHU country = NEP }
exists = MEN
}
}

Now the trigger is true if there's alliance between Nepal and Bhutan AND Mancukuo is independent OR trigger is true if there's war between Nepal and Bhutan AND Mengkukuo is independent.

I hope my examples helped you.
 

ADukes

Major
Apr 16, 2007
782
0
www.madminutegames.com
Miihkali said:
Code:
NOT = {
 OR = {
  war = { country = BHU country = NEP }
  alliance = { country = BHU country = NEP }
 }
}

Now trigger is true only if Bhutan isn't at war with Nepal OR Bhutan hasn't alliance with Nepal.
Wrong, trigger is true only if Bhutan isn't at war with Nepal AND Bhutan hasn't alliance with Nepal. ;)
 

xtfoster

Field Marshal
57 Badges
Feb 8, 2006
5.874
2.209
  • Shadowrun Returns
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • BATTLETECH
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: No Step Back
  • Stellaris: Galaxy Edition
  • Deus Vult
  • Europa Universalis III
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Majesty 2
  • Europa Universalis III Complete
  • Semper Fi
  • Supreme Ruler 2020
  • 500k Club
  • Hearts of Iron II: Beta
  • Stellaris
  • Hearts of Iron II: Armageddon
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Expansion Pass
UNSF said:
[edit]somehow the indentation did not show... , sorry if it is hard to read the event code[/edit]
I apologize for asking so many noob questions :eek:o
but since I failed first year computer science because of the logics... oh well

Anyway, I am trying to write 2 separate events, the first one forces JAP into an alliance with CHI:

The event seemed to fire fine, but the problem being that as I move the cursor to the button for action A, only peace showed up in the blue pop-up box. And indeed, as I pressed it, only peace was concluded, not an alliance.
Because Japan & China are at war, you need to have 2 events. The first will force peace and trigger the second, which will force the alliance. Some notes...you will need to create (and trigger) an ai that allows Japan and China to cooperate (i.e., remove the Trade and Tech embargos).
 

unmerged(71191)

Private
Mar 9, 2007
16
0
To Miihkali and ADukes
Thanks for the tips... only hope that my handicapped brain could absorb them :p
I will try to put them into good use.

To:xtfoster
xtfoster said:
Because Japan & China are at war, you need to have 2 events. The first will force peace and trigger the second, which will force the alliance. Some notes...you will need to create (and trigger) an ai that allows Japan and China to cooperate (i.e., remove the Trade and Tech embargos).
So this means an event action cannot have peace and alliance in the same time?

[edit] As for the last part about AI... yes I am aware of that. But the reason I am writing a force alliance between the 2 is because I could never get JAP to join an alliance (0 chance) despite being at peace, and with a +200 relation...
if I know how to modify this AI behaviour I probably would not even want to write a event... because of the huge hurdle of an amphibious assault on Honshu island. (Of course I could make it easier, but than the event becomes awkward...)[/edit]
 
Last edited:

xtfoster

Field Marshal
57 Badges
Feb 8, 2006
5.874
2.209
  • Shadowrun Returns
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • BATTLETECH
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: No Step Back
  • Stellaris: Galaxy Edition
  • Deus Vult
  • Europa Universalis III
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Majesty 2
  • Europa Universalis III Complete
  • Semper Fi
  • Supreme Ruler 2020
  • 500k Club
  • Hearts of Iron II: Beta
  • Stellaris
  • Hearts of Iron II: Armageddon
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Expansion Pass
UNSF said:
So this means an event action cannot have peace and alliance in the same time?
Correct, or at least I have never seen it.
UNSF said:
[edit] As for the last part about AI... yes I am aware of that. But the reason I am writing a force alliance between the 2 is because I could never get JAP to join an alliance (0 chance) despite being at peace, and with a +200 relation...if I know how to modify this AI behaviour I probably would not even want to write a event... because of the huge hurdle of an amphibious assault on Honshu island. (Of course I could make it easier, but than the event becomes awkward...)[/edit]
OK, some (ai) ways to do that...
1) An ai Change to lower Japan's neutrality, would make it easier to Ally.
2) An ai Change to the befriend China (would make them want to improve relations and join your alliance.)
 

Miihkali

Old Guard
6 Badges
Apr 11, 2007
2.970
11
  • Crusader Kings II
  • Darkest Hour
  • For The Glory
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
ADukes said:
Wrong, trigger is true only if Bhutan isn't at war with Nepal AND Bhutan hasn't alliance with Nepal. ;)

Should it then be?

Code:
NOT = {
OR = {
AND = {
war = { country = BHU country = NEP }
}
AND = {
alliance = { country = BHU country = NEP }
}
}
}

:wacko:

EDIT: Or should it be:

Code:
NOT = {
OR = {
war = { country = BHU country = NEP }
}
OR = {
alliance = { country = BHU country = NEP }
}
}

:wacko: :wacko: :wacko:
 

ADukes

Major
Apr 16, 2007
782
0
www.madminutegames.com
Code:
NOT = {
 AND = {
  war = { country = BHU country = NEP }
  alliance = { country = BHU country = NEP }
 }
}
or

Code:
OR = {
 NOT = { war = { country = BHU country = NEP } }
 NOT = { alliance = { country = BHU country = NEP } }
}
 
Last edited:

xtfoster

Field Marshal
57 Badges
Feb 8, 2006
5.874
2.209
  • Shadowrun Returns
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • BATTLETECH
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: No Step Back
  • Stellaris: Galaxy Edition
  • Deus Vult
  • Europa Universalis III
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Majesty 2
  • Europa Universalis III Complete
  • Semper Fi
  • Supreme Ruler 2020
  • 500k Club
  • Hearts of Iron II: Beta
  • Stellaris
  • Hearts of Iron II: Armageddon
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Expansion Pass
ADukes said:
Code:
NOT = {
 AND = {
  war = { country = BHU country = NEP }
  alliance = { country = BHU country = NEP }
 }
}
or

Code:
OR = {
 NOT = { war = { country = BHU country = NEP } }
 NOT = { alliance = { country = BHU country = NEP } }
}
Or just
Code:
NOT = {
  war = { country = BHU country = NEP }
  alliance = { country = BHU country = NEP }
}
Because the AND is the default operator.
 

ADukes

Major
Apr 16, 2007
782
0
www.madminutegames.com
xtfoster said:
Or just
Code:
NOT = {
  war = { country = BHU country = NEP }
  alliance = { country = BHU country = NEP }
}
Because the AND is the default operator.
Nope, that's the same as
Code:
NOT = {
 OR = {
  war = { country = BHU country = NEP }
  alliance = { country = BHU country = NEP }
 }
}
or
Code:
AND = {
 NOT = { war = { country = BHU country = NEP } }
 NOT = { alliance = { country = BHU country = NEP } }
}