• 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.
When givetrade and revoketrade

command = { type = givetrade which = aaa }
Creates a trade agreement with country aaa.

command = { type = revoketrade which = aaa }
Cancels a trade agreement with country aaa.

give and remove trade agreements, then what commands are used - or are there any? - to embargo and lift an embargo vs. another nation?
 
When givetrade and revoketrade

command = { type = givetrade which = aaa }
Creates a trade agreement with country aaa.

command = { type = revoketrade which = aaa }
Cancels a trade agreement with country aaa.

give and remove trade agreements, then what commands are used - or are there any? - to embargo and lift an embargo vs. another nation?
There are no such commands for embargoes.
 
Can -1 for a random province only be used in commands or in a trigger, too?

I tried to make an event for my Granada game based on the Jizya random event 96009093 and 960008093 for muslims owning hindu provinces but wanted not to check specific provinces owned (which might or might have not changed the religion).

However the game reports an error about "province = -1" so I guess - 1 is not for triggers?

Code:
#(1419-1820) Jizya
event = {
    id = 960000128
    trigger = {
        missionaries = 9 #waste prevention 159b5
        OR = {
            AND = { religion = sunni
                NOT = provincereligion = { province = -1 data = sunni }
                control = { province = -3 data = -1 }
                owned = { province = -3 data = -1 }
                }
            AND = { religion = shiite
                NOT = provincereligion = { province = -1 data = shiite }
                control = { province = -3 data = -1 }
                owned = { province = -3 data = -1 }
                  }
            }
        }
     
        random = yes
    name = "EVENTNAME_RANDOM093" #Enforcement of Jizya
    desc = "EVENTHIST_RANDOM093"
    #-#Islamic law emphasized issuing a tax on dhimmis, non-believers who are protected by the state. Muslim jurists required adult, free, sane males among the dhimma community to pay the jizya, while exempting women, children, elders, handicapped, the ill, the insane, monks, hermits, slaves, and musta'mins—non-Muslim foreigners who only temporarily reside in Muslim lands.Dhimmis who chose to join military service were also exempted from payment, as were those who could not afford to pay. Those who chose to convert to islam were obviously exempt, too.

    action = {
        name = "VERY_WELL"
        command = { type = treasury value = 50 }
        command = { type = missionaries value = -2 }
            }
    action = {
        name = "HURRAH"
        command = { type = population which = -3 value = -500 } #population is more like hearths or housholds, not individuals
        command = { type = INF which = -3 value = 2000 }
        command = { type = missionaries value = -2 }
        }

    action = {
        name = "WELCOME"
        command = { type = conversion which = -3 }
        command = { type = missionaries value = -3 } #more valuable, more effort
        }
    action = {
        name = "PEACE"
        command = { type = stability value = 1 }
        command = { type = missionaries value = -2 }
            }
        }

Edit: When I comment out the trigger - except missionaries 9 and being sunni - and manually fire the event then I get the options,
however option 3 does not work with -3 (because no random province has been chosen before) and if I change it to -1 then it takes a random province (e.g. in my game first Gibraltar, then Granada which are already sunni) regardless of province religion. So conversion with -1 seems strange when it tries to convert a province to the state religion that the province already has - instead of taking a random province that does not have the state religion...?
 
Last edited:
Triggers / Conditions based on provinces:

control = { province = x data = aaa }
Is true if province x is controlled by country aaa (if data = -1 then it is for the country receiving the event)
In trigers x must be an exact number of the province it can't be -1.
 
Triggers / Conditions based on provinces:

control = { province = x data = aaa }
Is true if province x is controlled by country aaa (if data = -1 then it is for the country receiving the event)
In trigers x must be an exact number of the province it can't be -1.
So -3 (use the province that was used before) does work only in commands, not in triggers too?

How else could I check if e.g. Granada, as a sunni nation, owns any province that diverts from the state religion?
Only by checking individual province ID´s?
 
Last edited:
IDK about -3 but probably in triggers you are only allowed to put province numbers.
Why do you need checking whether Granada owns any province that diverts from the state religion ?
There is no easy way to do that currently AFAIK (due to limitations in triggers). Fastest way is command to conversion if there is such a provice:

command = { type = conversion which = x }
Religion in province x changes to the state religion.


Special values for provinces in commands:

-1 or random is used to target a random province.
-2 or capital is used to target the capital province of the country receiving the event.
-3 or last_random is used to target again the province that was randomly picked in the last command.
-4 or random_distinct is used to not target again a province that was already randomly picked in the same action.
-5 or random_not_capital is used to not target the capital province of the country receiving the event. -8 or random_distinct_not_capital is used to not target again a province that was already randomly picked in the same action (capital province will also not be targeted).
 
IDK about -3 but probably in triggers you are only allowed to put province numbers.
Why do you need checking whether Granada owns any province that diverts from the state religion ?
There is no easy way to do that currently AFAIK (due to limitations in triggers). Fastest way is command to conversion if there is such a provice:

command = { type = conversion which = x }
Religion in province x changes to the state religion.
I wanted to have an event simulating the Jizya, just like the two events already existing that give a muslim country some money when owning hindu provinces.

My idea was that if a muslim country owns and controls provinces, that are not muslim, then an event could trigger that would offer either a) some money as Jizya tax, b) some soldiers because soldiers are exempt from that tax, c) that the province converts or d) +1 to stability if none of the first are demanded and all actions costing some missionaries in case the missionaries are already at the maximum allowed. But neither the trigger nor the action 3 of conversion of a random province works as I intended the event to work...
 
There's a missing } after sunni.
If you talking about event id 96009093 in AGCEEP_Random_All.eue - in this event trigger checking which provinces are owned by country receiving an event. It doesn't check if province is hindi (it only notices #All provinces in India starting with Hinduism). So, check your event again, but I doubt whether that works.
 
Last edited:
There's a missing } after sunni.
Good spotted. I did correct that, but the result is still the game crashing.

1646570264152.png
 
I rewrote the event with a more generical trigger and some different actions and tried to replace the random = yes with
persistent = yes (so that it can fire whenever I have 9 Missionaries instead of competing with all other random events once per year) but when I start a game it does not fire itself...

A persistent event is possible without being countryspecfic as far as I understood, but what could be the reason that it does not fire immediately when the country has 9 missionaries and more than 2 provinces and is sunni?

Code:
#(1419-1820) Jizya
event = {
    id = 960000128
    trigger = {
        missionaries = 9 #waste prevention 159b5
        countrysize = 2 #assuming that at least the capital of any muslim country is muslim and it has to own more
        OR = {
            AND = { religion = sunni
                #NOT = provincereligion = { province = -1 data = sunni }
                #control = { province = -1 data = -1 }
                #owned = { province = -1 data = -1 }
                }
            AND = { religion = shiite
                #NOT = provincereligion = { province = -1 data = shiite }
                #control = { province = -3 data = -1 }
                #owned = { province = -3 data = -1 }
                  }
            }
        }
     
        persistent = yes
    name = "EVENTNAME_RANDOM093" #Enforcement of Jizya
    desc = "EVENTHIST_RANDOM093"
    #-#Islamic law emphasized issuing a tax on dhimmis, non-believers who are protected by the state. Muslim jurists required adult, free, sane males among the dhimma community to pay the jizya, while exempting women, children, elders, handicapped, the ill, the insane, monks, hermits, slaves, and musta'mins—non-Muslim foreigners who only temporarily reside in Muslim lands.Dhimmis who chose to join military service were also exempted from payment, as were those who could not afford to pay. Those who chose to convert to islam were obviously exempt, too.

    action = {
        name = "VERY_WELL"
        trigger = { NOT = { countrysize = 4 } }
        command = { type = treasury value = 50 } #same as Gift to the State
        command = { type = missionaries value = -1 }
            }
    action = {
        name = "VERY_WELL"
        trigger = { countrysize = 4
                NOT = { countrysize = 9 } }
        command = { type = treasury value = 100 }
        command = { type = missionaries value = -2 }
            }
    action = {
        name = "VERY_WELL"
        trigger = { countrysize = 9
        NOT = { countrysize = 30 } }
        command = { type = treasury value = 200 }
        command = { type = missionaries value = -3 }
            }
    action = {
        name = "VERY_WELL"
        trigger = { countrysize = 30
        NOT = { countrysize = 80 } }
        command = { type = treasury value = 300 }
        command = { type = missionaries value = -4 }
            }
    action = {
        name = "VERY_WELL"
        trigger = { countrysize = 80
        NOT = { countrysize = 200 } }
        command = { type = treasury value = 500 }
        command = { type = missionaries value = -5 }
            }
    action = {
        name = "VERY_WELL"
        trigger = { countrysize = 200 }
        command = { type = treasury value = 1000 }
        command = { type = missionaries value = -6 }
            }
    action = {
        name = "WELCOME"
        command = { type = conversion which = -5 } #random non-capital province
        command = { type = missionaries value = -3 } #more valuable, more effort
        }
    action = {
        name = "HURRAH"
        command = { type = population which = -3 value = -500 } #population is more like hearths or households, not individuals
        command = { type = INF which = -3 value = 2000 }
        command = { type = missionaries value = -2 }
        }
    action = {
        name = "PEACE"
        trigger = { NOT = { stability = 3 } }
        command = { type = stability value = 1 }
        command = { type = missionaries value = -2 }
            }
        }
 
AFAIK all random events are persistent and thy are choosing randomly by tha game.
Try to add the following to the trigger:
ai = no
random = no
date = { day = 0 month = january year = xxxx }
or only date.
 
Last edited:
AFAIK all random events are persistent and thy are choosing randomly by tha game.
Try to add the following to the trigger:
ai = no
random = no
date = { day = 0 month = january year = xxxx }
or only date.
No, random events are not persistent.
A random event fires only once per year, selected from all available random events whose triggers are fulfilled.
A persistent event should be able to fire as often as the trigger is fulfilled, theorectically maximally once a day.

I would like to have my event fire for ai nations too - even if the ai usually takes action a it will be a slightly higher chance for a gift for the state for the ai country.
Mmmh, random = no? I though that persistent = yes would already exclude random, I´ll try that.
 
I rewrote the event with a more generical trigger and some different actions and tried to replace the random = yes with
persistent = yes (so that it can fire whenever I have 9 Missionaries instead of competing with all other random events once per year) but when I start a game it does not fire itself...

A persistent event is possible without being countryspecfic as far as I understood, but what could be the reason that it does not fire immediately when the country has 9 missionaries and more than 2 provinces and is sunni?

(...)
[/code]
You missing date/deathdate statement (you need it with persistent condition when firing 1st time - then during triggering 2nd persistent event by 1st event - you don't need it):

date = { day = 2 month = january year = xxxx }
offset = y
deathdate = { day = 3 month = january year = zzzz }