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

ConjurerDragon

Generalissimus
79 Badges
Apr 19, 2005
5.560
611
  • Rise of Prussia
  • Hearts of Iron IV Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Humble Paradox Bundle
  • Pride of Nations
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: El Dorado
  • Europa Universalis III: Collection
  • 500k Club
  • War of the Roses
  • Warlock: Master of the Arcane
  • Rome: Vae Victis
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Victoria 2
  • Age of Wonders III
  • Crusader Kings Complete
  • Knights of Honor
  • Steel Division: Normandy 44 Deluxe Edition
  • Steel Division: Normandy 44
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • East India Company Collection
  • Deus Vult
  • Darkest Hour
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Hearts of Iron II: Armageddon
  • Arsenal of Democracy
  • Hearts of Iron Anthology
  • Magicka
  • Teleglitch: Die More Edition
  • Sword of the Stars
With the added and expanded commands and triggers list in 1.3: Would it now be possible to create an event that checks if you own a random province

owned = { province = random data = -1 }
Is true if province x is owned by country aaa (if data = -1 then it is for the country receiving the event)

that you do not have a core on and that you own and control for e.g. 30 years and have stab = 0 (0 or higher) and grant you an addcore_claim on the same province (-3)?

control = { province = last_random data = -1 }
Is true if province x is controlled by country aaa (if data = -1 then it is for the country receiving the event)

controlchange = { province = last_random years = 30 }
Is true if province x has been controlled by the current controller for at least y years, m months and d days (not all time fields have to be filled, one is enough).

command = { type = addcore_claim which = last_random }
command = { type = badboy value = 0.5 }
Changes the badboy value with x.


And another event that would check if you have a core on a random province that you do not control for 30 years and remove the core?

In 1.2. the only way possible would have been to create a provincespecific event for each possible province or a random event that would fire only once.

If possible I would like two persistent events that can fire again and again for all countries that have provinces without cores or cores without controlling the province.

persistent = yes
 
Last edited:
  • 1
Reactions:
I tried to use the persistent pirates event to build this coregiving around:

Code:
# Testing: Dynamic Coregranting#
event = {
    id = 25063
    trigger = {
        stability = 1 #1 or higher
        atwar = no
        owned = { province = random data = -1 }
        control = { province = last_random data = -1 }
        controlchange = { province = last_random years = 30 } # country controlled the province since 30 years
        NOT = { core_national = { province = last_random data = -1 }
            core_claim = { province = last_random data = -1 }
            core_casusbelli = { province = last_random data = -1 }
            }
        diplomats = 1
           }
    random = no
    persistent = yes

    name = "EVENTNAME25009"
    desc = "EVENTHIST25009"

    action_a = {    # Concentrate on other matters and take bribes of local nobles for not taken closer control #
        name = "ACTIONNAME25009A"
        command = { type = treasury value = 10 }
        }

    action_b = {    # Make the effort to justify our possession #
        name = "ACTIONNAME25009B"
        command = { type = diplomats value = -1 }
        command = { type = treasury value = -1 }
        command = { type = addcore_claim which = last_random }
        command = { type = badboy value = 0.1 }        
        }
    }

but the game refuses to start with this error due to the event.
---------------------------
Critical error!
---------------------------
Assertion failed: ERROR : (Unknown Trigger Type) 'persistent = yes' Line = 156 file = db\events\new_events.txt
Do you want to continue?
---------------------------
Abbrechen Wiederholen Ignorieren
---------------------------


In the first draft I used 25059 (the next number in the new events file) but that was already used in another file. 25063 did not show up when I searched for an existing event number that already has that number.


I had forgotten a } after diplomats, so the persistent line was in the trigger. Game starts now without error.
 
  • 1
Reactions:
No. Randomized province values do not work in the trigger, so they cannot be generated there and then referred to in the command.

I like the event idea and I'd like to find a way to make it work though.
 
  • 2Like
Reactions:
No. Randomized province values do not work in the trigger, so they cannot be generated there and then referred to in the command.

I like the event idea and I'd like to find a way to make it work though.
So, the only way to do it currently would be as before with 2 provincespecific persistent events for every land province in the game? That is the work I shied away from before.

The game started without problems in the last draft of the event. When currently triggers can't understand random provinces (regardless if ("random" or "-1") should then not the game give out an error if that is used in the trigger? Or would that be the job of e.g. Andrejs validator?
 
It does give out an error if you use -1 and -3. The written forms are parsed as 0 for reasons of the C++ language libraries.