Создание и редактирование "Событий" (ивентов) - Учебники по моддингу - Strategium.ru Перейти к содержимому

Создание и редактирование "Событий" (ивентов)

Рекомендованные сообщения

.

Спойлер

Начать следует с того, для чего же все таки нужны "События" (Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое. ) в игре. "Гугл-переводчик" гласит:

"В игре есть целый ряд событий (происшествий), которые могут привести к положительным, отрицательным и смешанным результатам для страны игрока. Они принимают форму всплывающих уведомлений на экране игрока, которые могут представлять игроку выбор действия, или могут просто информировать игрока о последствиях и требовать, чтобы он обратил внимание на это событие (происшествие)"

На самом деле, если вдуматься, то система "Событий" (ивентов), является, пожалуй, главной механикой игры. Потому как именно она вносит в игру "разнообразие" и "эффект присутствия". Только она "реагирует" на действия игрока, заставляя его периодически "принимать решения", влияющие на игровой план. Для ИИ, это не менее важна часть.

  "Решения", "Формы правления", "Страны и нации", "Сословия", "Проекты", "Религии", "Политики", "Идеи"... и т.д.  - все эти элементы геймплея мы можем редактировать. Разработчики предусмотрели также возможность добавить новые элементы. Делается это с помощью создания/редактирования отдельных "сценариев" (скриптов).
 
  Скриптовый язык служит для разработчика (и для нас, как "редакторов, "моддеров", "сценаристов", "режиссеров" - нужное подчеркнуть) для "создания  удобной и понятной системы классов и объектов, основывающихся на том, что происходит в игре. Манипулируя ими (классами и объектами) в скрипте, мы манипулируем явлениями в самой игре. В этом и состоит концепция скриптового управления".

 

  Является ли система, применяемая в данной игре "уникальной" или "универсальной", создана она разработчиками с нуля, или это часть какой-то "чужой" системы, подходит ли она для "манипуляций" в других играх разработчика - мне неведомо. Я себе этим голову забивать не стал.

 

  Конкретно эта тема будет посвящена "Созданию и редактированию" происходящих в игре "Событий" (Events). Их еще называют ивентами (или иногда "эвентами"), кто во что горазд. Я буду называть: СКРИПТ-ИВЕНТ, подразумевая именно "кусочек кода", который будет отображаться в игре, как "Событие".

 

  Сразу хочу дать основные ссылки на "Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое. " (английский язык), которые относятся непосредственно к теме и будут использоваться вами в будущем постоянно:

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

И упомяну консольные команды, поскольку при написании (и проверке работы) скриптов-ивентов, будет использоваться консоль:

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

 

Спойлер

  Хочу также сразу уточнить! 
  Я не программист. Никогда не увлекался программированием. Не знаком ни со сценарными (скриптовыми) языками, ни с их классификацией. Мне плохо знакомы термины, которые используются в языках программирования и скриптах.  Если я тут начну про переменные талдычить, обзывать их исходя из области видимости (локальные или глобальные), или из адресов (статические и динамические), или из структуры (простые и сложные), а потом обзываться аргументами... а потом говорить, что этот параметр "передается по значению", а этот - "по ссылке" и тут происходят изменения "с ней самой", а тут "с ее локальной копией", а потом еще и перейду на Функции-Методы-Процедуры... К характерам их объявления и определения...

  То тему придется переименовать: "САМЫЙ УНЫЛЫЙ СБОРНИК ЕРЕСИ"

  Я действительно не знаю, "как это работает ТОЧНО". Применительно к EU4. Я имею лишь "общее и расплывчатое представление о том, как это работает". Мне хватает.

  Я постараюсь дать ОБРАЗНОЕ ОПИСАНИЕ происходящих процессов. Однако, мне кажется, такое описание "расставит некоторые точки над i". Которые для меня лично, например, были не очевидны и здорово "портили" процесс освоения азов создания ивентов.

  Я буду стараться интерпретировать (истолковать с целью понимания его смысла) на понятный нам язык то, что является неотъемлемой частью скриптов-ивентов. А также постараюсь объяснить "как это работает" вообще в целом.

  Когда я сам читаю то, что пишу - понимаю, что текст получается "рваным", создается ощущение, что я взял готовый "текст", перевел "Гуглом" и стал копировать/вставлять, слегка редактируя его. При этом, удаляя особо непонятные предложения и абзацы от греха подальше.

  Однако, даже оставляя все написанное в таком виде, мучает вопрос: "А какое ограничение на кол-во символов в сообщении на форуме?"

 

  САМОЕ ВАЖНОЕ СРАЗУ: Любое "Событие" оказывает какое-то влияние на игровой процесс. Некоторые, например,  роняют нам периодически стабильность, некоторые устанавливают модификаторы производства", некоторые отнимают дукаты... Перечислять можно долго.

  ВАЖНО: все они - оказывают влияние на текущую игру. Влияние, которое оказывает "Событие" (ивент), я буду называть ЭФФЕКТОМ. Ивент должен обязательно оказывать ЭФФЕКТ (пусть даже и скрытый от глаз игрока). Но чаще, он предоставляет нам "ВЫБОР из нескольких ЭФФЕКТОВ":

 

Спойлер

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.  - не знаю, как правильно сунуть картинку на форум с imgur.com

Прим. вставлена модератом:

kJorUBF.png

 

  Начну со структуры файлов, в которых содержатся скрипты-ивенты:

 

  Все ивенты, которые подготовили для нас разработчики, лежат в папке:
...\Europa Universalis 4\events

  Это набор .txt файлов. Каждый файл - опеределенная категория ивентов.


  Сделано это для удобства внесения изменений и добавления новых скриптов-ивентов. Дальше все будет гораздо запутанней, для неподготовленного читателя (сам такой - знаю)
Но именно самое важное, что нужно понимать, я постараюсь для начала "сократить", а потом уже интерпретировать. ("Понять - значит упростить" © Ктотоумныйтаксказал)

Спойлер
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

Нужно стразу сказать, что все написанное после символа # в строке игнорируется и не воспринимается, как часть скрипта. Т.е. вы можете использовать его для комментариев, как это делают разработчики.


  Под спойлером спрятан скрипт-ивент. Набор строк и символов. В действительности - это набор ФУНКЦИЙ.

 

  Теперь немного изменю цитату, которую уже приводил (и коверкал, как хотел):

 

  "Скриптовый язык служит нам, для создания  удобной и понятной системы ФУНКЦИЙ, основывающихся на происходящем в игре. Манипулируя ФУНКЦИЯМИ в скрипте, мы манипулируем явлениями в самой игре."

 

  Что я имею в виду, говоря Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое. :  ФУНКЦИЯ - отдельная часть скрипта,  или часть "Системы_управления_явлениями_в_игре". В ФУНКЦИЮ мы вносим "исходные_данные" и определяем ее "область_действия". Обработав "данные", в заданной области функция дает РЕЗУЛЬТАТ.


  Мы будем "Манипулировать" различными ФУНКЦИЯМИ. Мы будем внутрь одних ФУНКЦИЙ засовывать другие ФУНКЦИИ, внутрь которых снова будем засовывать ФУНКЦИИ, внутрь которых снова.............. Мы будем создавать "сценарий" нашего "События", используя сложный набор ФУНКЦИЙ.

 

  Совокупность РЕЗУЛЬТАТОВ этих ФУНКЦИЙ, будет в игре отображаться как "Событие". А, в зависимости от выбора, который это "Событие" нам предоставляет, будет накладываться какой-то ЭФФЕКТ.

 

САМОЕ ВАЖНОЕ: каждая ФУНКЦИЯ должна иметь четко определенные:

1. "исходные_данные"
2. "область_действия"

 

  Сложность "скриптописания" кроется именно здесь. Ведь мы имеем дело с "языком программирования". Который в отличии от человека "додумать" или "догадаться" сам не
может.

 

Спойлер

  Жена говорит мне: "Достань, коврики", подразумевая при этом, что я должен достать из под дивана детские коврики и разложить их на полу так, чтобы дети могли по ним поползать в свое удовльствие. Я человек и понимаю её с полуслова.

  С точки зрения "скриптового языка" для меня должен быть написан "сценарий" "ЗАДАНИЕ" с названием "Достать коврики", в котором указан ряд функций (если все ОЧЕНЬ упростить): 

"Исходные_данные" у нас передаются напрямую из "ЗАДАНИЯ" - это КОВРИКИ.
"Область_действия" у нас также определена - КВАРТИРА

1. ПОИСК - эта функция для начала установит, где в КВАРТИРЕ находятся КОВРИКИ.
    Она проверит все известные места в КВАРТИРЕ, и установит, находятся ли в каждом из них КОВРИКИ.
        Если бы жена сказала: "Достань коврики, из-под дивана", то было бы проще:
    Функция бы проверила только ПОД_ДИВАНОМ, и установила, что КОВРИКИ там есть.
        В итоге функция даст РЕЗУЛЬТАТ: ПОД_ДИВАНОМ

2. ДОСТАТЬ - эта функция получит "область_действия" из функции ПОИСК - ПОД_ДИВАНОМ и достанет оттуда наш объект - КОВРИКИ.
        В итоге функция даст РЕЗУЛЬТАТ: ГОТОВ_РАЗЛОЖИТЬ, что запустит следующую функцию:
    
3. РАЗЛОЖИТЬ - эта функция будут содержать в себе массу других функций, я не буду описывать это подробно
    (я полагаю и так уже понятно, что это надолго и требует много "печатных символов")
    Но вкратце это выглядит как-то так:
    
    "РАЗЛОЖИТЬ" "КОВРИКИ" следует "РЯДОМ" "ДРУГ С ДРУГОМ", на "УЧАСТКЕ ПОЛА", подальше "ОТ ОПАСНЫХ ПРЕДМЕТОВ" так, чтобы "ДЕТИ" могли "ПОЛЗАТЬ" в области, не выходящей за пределы "КОВРИКОВ", но при этом могли дотянуться до "ИГРУШЕК".
    
    Эти функции все будут иметь ряд определяющий УСЛОВИЙ, которые будут складываться из совокупности понятий
    УДОБСТВО, БЕЗОПАСНОТЬ, ДАЛЕКО, БЛИЗКО и учитывать возможности ДЕТЕЙ ПОЛЗАТЬ... 

  В таких сложных сценариях "исходными_данными" для одной ФУНКЦИИ, служат РЕЗУЛЬТАТЫ, которые мы получили от другой ФУНКЦИИ. С помощью одних ФУНКЦИЙ мы определяем "область_действия", а с помощью других - сужаем ее, чтобы сделать нужную нам ВЫБОРКУ.

  Когда я говорю "сценарий", я подразумеваю, что он должен содержать в себе ПРОСТЫЕ и четко ОПРЕДЕЛЕННЫЕ элементы, которые будут иметь сложную многоуровневую структуру, и все они должны быть однозначны, т.е. не иметь "двоякого толкования".

 

  Для создания скриптов-ивентов применяется две основные ФУНКЦИИ:

province_event = { } 
country_event = { }

  Отличаются они тем, что их "область_действия" (Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое. - так "говорят" разработчики) распространяется на "страны", либо "провинции", и ЭФФЕКТ_ОТ_ИВЕНТА применяется к странам, либо провинциям. Каждая из этих ФУНКЦИИ дает следующий РЕЗУЛЬТАТ: Появляется всплывающее окно "События", в этом окне мы увидим: 

 

1. Название "События", как это задумано "сценаристом" - Например, "Наблюдение метеора"
2. Описание этого "События", как это задумано "сценаристом"
3. Изображение, которое, по мнению "сценариста", этому "Событию" соответствует.

 

  Именно отображение окна с "Событием" и есть РЕЗУЛЬТАТ ФУНКЦИИ. Ничего более. Никаких ЭФФЕКТОВ, изменяющих состояние игры происходить не будет. Даже обычного "Выбора_между_несколькими_кнопками" мы не увидим.

 

  Вся оставшаяся часть нашего "сценария" будет находится ВНУТРИ одной из этих двух ФУНКЦИЙ. И именно эта "оставшаяся часть "сценария"" по сути и будет определять какой именно ЭФФЕКТ будет оказывать на игру наше событие, и на кого (что) конкретно этот ЭФФЕКТ будет действовать, а на кого (что) не будет.

 

 Вообще говоря, окно с "Событием" без "Выбора_между_несколькими_кнопками" - это "сломанный", "не работающий" - скрипт. Мы даже не сможем это окно закрыть - оно так и провисит, до перезапуска. Ведь, чтобы закрыть окно, мы должны нажать какую-то одну "кнопочку_с_выбором", которая окажет ЭФФЕКТ, исключающий другие.

 

  Поэтому структура ФУНКЦИЙ country_event = { } и province_event = { } ОБЯЗАТЕЛЬНО должна содержать в себе несколько ФУНКЦИЙ (а остальные ФУНКЦИИ - зависят от обстоятельств)

 

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

Спойлер

  id = ФУНКЦИЯ, создающая "Уникальный_идентификатор" ивента. Чтобы отличать одно "Событие" от другого.

  "Уникальный_идентификатор" может быть любым. Называйте свои скрипты-ивенты так, как вам вздумается, как вам захочется. Но обязательно используйте УНИКАЛЬНЫЕ имена.

  РЕЗУЛЬТАТ этой ФУНКЦИИ формируется из "области_имен" и номера ивента.

  В примере с "метеоритом", "область_имен" не задана. И ивент идентифицируется только по номеру. id = 5060

  Чтобы запустить "Событие" с консоли, необходимо использовать консольную_команду event <id>, как в примере:

event 5060    

Задается "область_имен" в начале файла <...>.txt, который и содержит скрипты-ивенты. Например так:

namespace = my_first_event

Теперь я могу легко идентифицировать один из своих ивентов: my_first_event.5060 Введя в консоли:
 event my_first_event.5060 
Я запущу именно этот, созданный мной, ивент.

Если в начале файла "область_имен" я НЕ задам, то использование консольной_команды:
 event my_first_event.5060
приведет к вызову не моего ивента, а "Наблюдение метеора". Потому что, без указания "области_имен", ивент идентифицируется по номеру, а текст игнорируется.

  Вообще говоря, если вы решили создать пару-тройку уникальных ивентов, то дам совет:
1. Воздержитесь от редактирования, имеющихся файлов .txt в папке events. Вы можете серьезно навредить игровому процессу.
2. Создайте для своих ивентов новый файл, например, my_Events.txt. Или несколько файлов, если нужно.
3. Всегда задавайте каждому файлу "область_имен" (namespace =), и используйте его при идентификации.
4. Не стесняйтесь использовать как можно больше комментариев в скриптах-ивентах.

.

Спойлер

title = ФУНКЦИЯ, которая в окне "Событие" определяет, как именно это "Событие" называется. Т.е. "исходными_данными" этой функции является, внесенное нами, название" "События". РЕЗУЛЬТАТОМ ФУНКЦИИ - название "События" на соответствующем языке.

Я ничего ни разу не пытался локализовать, и не знаю, как это работает точно, но попытаюсь объяснить на примере ивента "Наблюдение метеора":

В скрипте мы имеем:
title = "EVTNAME5060"
desc = "EVTDESC5060"

В файле ...\Europa Universalis 4\localisation\generic_events_l_english Содержится строка:

 EVTNAME5060:0 "Comet Sighted" - откуда и берется "название", если язык игры - английский. Ну, а для русского языка - это будет соответственно: "Наблюдение метеора".

То же самое касается и ФУНКЦИИ desc =, и ФУНКЦИИ name =, которая находится внутри ФУНКЦИИ option =

Не могу точно ответить на вопрос, какая "область_действий" у ФУНКЦИЙ title =, desc = , name = Знаю, что эта область связана с локализацией игры. И не связана ни с country_scope, ни с province_scope - областями, которыми нам так или иначе придется манипулировать в других ФУНКЦИЯХ, при написании наших "сценариев" (скрипт-ивентов).

.

Спойлер

desc = ФУНКЦИЯ, которая в окне "Событие" определяет его "описание". Т.е. "исходными_данными" этой функции является, внесенное нами, "описание" "События". РЕЗУЛЬТАТОМ ФУНКЦИИ - описание "События" на соответствующем языке.    
    
picture = ФУНКЦИЯ, которая в окне "Событие" определяет, какое именно изображение это "Событие" будет иметь. Т.е. "исходными_данными" этой функции является, внесенное нами, имя_файла изображения, которое хранится в папке ...\Europa Universalis 4\gfx\event_pictures\event_pictures_EUROPEAN\

.

Спойлер

option = ФУНКЦИЯ, которая, вообще говоря, в окне "Событие" отображает соответствующую "кнопку". Это кнопка, во-первых, закрывает окно "События", во-вторых, приводит в действие ЭФФЕКТ, изменяющий игру. Я буду использовать слово ОПЦИЯ, чтобы не писать каждый раз ФУНКЦИЯ option =

 

ОПЦИЯ - это просто КНОПКА. Ничего больше. Кнопка без названия. При ее нажатии ничего не происходит. То, каким образом эта кнопка будет "называться", то какой ЭФФЕКТ будет от ее нажатия и то, на кого действие этого эффекта будет распространено - зависит от ФУНКЦИЙ, которые будут использоваться внутри ОПЦИИ.

 

Аналогию можно провести с функциями country_event = { } и province_event = { } - эти функции по сути тоже просто ОКНА. И ничего больше. Все остальное
определяется набором ФУНКЦИЙ, находящихся внутри.

 

ФУНКЦИЯ name =, внутри ОПЦИИ, по своей сути очень похожа на ФУНКЦИЮ title =, внутри ФУНКЦИИ country_event = { }. name = ФУНКЦИЯ, которая определяет, как именно будет "называться" соответствующая КНОПКА. Т.е. "исходными_данными" этой функции является, внесенное нами, "название" КНОПКИ. РЕЗУЛЬТАТОМ

 

ФУНКЦИИ - название КНОПКИ на соответствующем языке.

Спойлер

Они используются достаточно часто, для обеспечения локализации нашего скрипта-ивента.

 

Например, в ФУНКЦИИ add_country_modifier = { } - которая, устанавливает для страны соответствующий модификатор на определенный срок. Я думаю, вы не раз такие модификаторы в игре наблюдали.

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

В ОПЦИЮ, мы добавляем также ФУНКЦИИ, которые будут определять, во-первых, какой ЭФФЕКТ будет происходить, при ее выборе, во-вторых, на кого именно действие этого ЭФФЕТКА будет распространяться.

.

  Теперь следует немного отвлечься от ФУНКЦИЙ country_event = { } и province_event = { }, поскольку с ОБЯЗАТЕЛЬНОЙ частью я закончил. Применение всех остальных функций внутри country_event = { } и province_event = { } - дело исключительно добровольное, зависит от задумки "сценариста".

 

Спойлер

  Я опять вернусь к теме "общего понимая того, что мы будем делать" создавая скрипт-ивент. И чуть подробнее расскажу о некоторых инструментах, которые мы точно будем использовать.

  События (в широком смысле) в нашей повседневной жизни случаются независимо от нас самих, и часто мы к ним вообще никакого отношения не имеем. Не реже они и эффекта нас нас никакого не оказывают. Огромное количество событий происходят случайно. Часть значимых и важных событий - так или иначе периодичны. Это "зарплата", это "день рождения"... Тут вообще много можно говорить и примеров привести бесконечное количество.

  В игре "События" не ГЕНЕРИРУЮТСЯ. Они не возникают "просто так". Абсолютно все "События" - скрипты. Строгий набор условий, строгий набор эффектов, строгий набор ФУНКЦИЙ в конце концов.

  В общем смысле "События" определены. Причины и следствия не вариативны. Например, смена Религии в стране может привести к "запуску" скриптов. Но никаким другим способом эта смена не способна повлиять на игровой "процесс" в целом. Недовольство граждан, религиозные трения, изменение общей "напряженности", изменение веротерпимости... Все это и много другое - не происходит "динамично", не развивается "само собой", а есть результат "запуска" скриптов. Набор которых, во-первых, определен. И изменение игрового процесса - также определено.

 

"Запуск" скрипта, это и есть "возникновение" "События". Запустить ивент может:

1. Другой, уже "произошедший" ивент.
2. Специальный "стартер", предусмотренный разработчиками, как часть игрового процесса.
3. Выполнение определенных условий, предусмотренных "сценаристом" внутри скрипта.

 

Спойлер

Для первого и второго случая предусмотрена специальная ФУНКЦИЯ:

is_triggered_only = yes

Наличие ее в в ФУНКЦИИ country_event = { } говорит нам лишь о том, что без "вызова извне" не запустится.

В скрипте ее располагают обычно в "идентификационном блока". Такого понятия нет, я условно разделил скрипт-ивент на блоки. "Идентификационный" блок по сути служит для "описания общего смысла и характера" ивента.

Спойлер
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

 

К этому условному блоку я отношу и ФУНКЦИЮ, используя которую, мы указываем что ивент будет срабатывать только один раз.

fire_only_once = yes

"Блок Эффектов" - условный блок, который служит для "описания" ЭФФЕКТОВ, которые будет оказывать ивент.

  К этому блоку я отношу и ФУНКЦИЮ immediate =, которая служит для того, чтобы задействовать какой-либо ЭФФЕКТ сразу после "запуска"
ивента, не дожидаясь пока игрок выберет одну из ОПЦИЙ. При этом этот эффект будет, например, скрыт от глаз игрока:

 

Спойлер

Например, для страны можно сразу установить флаг counter_reformation

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

Спойлер

Или, например, на провинцию сразу можно установить модификатор roman_fever_timer. Этот ЭФФЕКТ будет скрыт от игрока.

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

.

 

 

Спойлер

  Если мы хотим, чтобы ивент запускался, "извне" другим ивентом то: Во-первых, запускаемому ивенту сразу даем соответствующую "характеристику":
is_triggered_only = yes    

  И в "Блоке эффетков" в ивенте, который будет запускать, используем ФУНКЦИЮ country_event = { }, которая указывает, что "произойдет "Событие"" такое-то". Т.е. внутри одной функции country_event = { }, мы можем использовать другую ФУНКЦИЮ country_event = { }. При этом мы лишь "ссылаемся" на другую ФУНКЦИЮ с определенным id =

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

  Подобную конструкции мы можем использовать, как вы поняли, и внутри ОПЦИИ (ФУНКЦИИ option =), и внутри ФУНКЦИИ immediate = { }. Поскольку обе эти функции - служат для определения "на кого и какой ЭФФЕКТ" будет действовать.

 

Спойлер

Перечень таких стартеров, и ивентов, которые к ним относятся находятся в файле:
...\Europa Universalis 4\common\on_actions\00_on_actions.txt

  Что особенно интересно, что в файле имеются среди прочих еще и "стартеры", которые не требуют условий, а просто случайно из своего списка "запускают" ивенты с определенной периодичностью. Например, "раз в три года" или "раз в пять лет". Какие ивенты имеют подобные "стартеры" можно посмотреть, как в самом файле 00_on_actions.txt, так и на Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

  Это уже часть механики игры. Поддается ли "эта часть" модификации я не знаю, хотя это и имеет прямое отношение. Судя по скрипту этого документа - эти стартеры можно изменять. Добавлять в них условия, добавлять ивенты, которые и будут запускаться при соблюдении условий. Можно ли добавить свои стартеры? Не знаю. Как "это работает ТОЧНО"? Не знаю.

Для того, кто собирается заняться серьезной модификацией ивентов, создать свою сложную систему ивентов, этот "инструмент" точно понадобится. Я сам только только осваиваю "азы" создания скриптов-ивентов. И до подобных "манипуляций" еще не дорос.

Hide

 

Спойлер

  Как только условия, указанные в ТРИГГЕРЕ ФУНКЦИИ country_event = { } (об этом - позже) будут выполнены, то произойдет его запуск.

 

  И основное условие - ФУНКЦИЯ mean_time_to_happen = { }, (сокращенно, вместо ФУНКЦИЯ mean_time_to_happen = { }, я буду говорить MTTH)

 

  MTTH - ФУНКЦИЯ, которая определяет "как часто ивент должен "запускаться"". И, честно сказать, я так и не понял "как это работает ТОЧНО". После перевода Гуглом Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое. , прочитав фразу: "Для повторяющегося события число вхождений в пределах заданного количества проверок задается биномиальным распределением, которое может быть аппроксимировано распределением Пуассона для длинного MTTH" я вообще перехотел в этом разбираться.

 

  В общем: MTTH определяет "период", который необходим для запуска события. В течении это "преиода" есть вероятность, что "Событие" будет запущено. Причем может быть сразу, в начале "периода"... может быть вообще никогда. Все зависит от "исходных_данных".

 

"Как это работает ТОЧНО" я не знаю. Рассматривая картинку, мне, вдруг, стал мерещиться кукиш... ХотеЛОСЬ бы, чтоб кно-нибудь объяснил популярно, какие "исходные_данные" (месяцы, модификаторы), как влияют на "период" и вероятность скорейшего запуска.

 

Спойлер

  Во второй части своего поста, как только я отвлекся от ФУНКЦИЙ country_event = { } и province_event = { }, я перестал следовать главной идее этого самого поста.

  Я перестал каждый раз напоминать, что любая ФУНКЦИЯ имеет "область_действия" и "исходные_данные". Хотя мне следовало напоминать об этом в каждом новом абзаце. Все ФУНКЦИИ, указанные мной, их имеют. Просто я не могу сказать ТОЧНО какие они. Это и не важно  в принципе. Ибо почти все функции, о которых шла речь - "пустышки". Без ФУНКЦИЙ внутри них никакого эффекта на игру оказать не получится. Гораздо важнее понимать, что такое "область_действия" (область видимости, область значений - названий уйма) и какие "исходные_данные" использовать именно в подФУНКЦИЯХ. А этих подФУНКЦИЙ... их много. И даже перечисление всех - уже ТРУД, неподъемный для меня.

  Еще раз вернусь к ссылкам:

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

  Вот это все нам очень понадобится.

  Наша задача - "сценарий", который так или иначе, изменяет игровой процесс.

  Самое главное для нас из всего множества стран (провинций) сделать "выборку" нужных нам, чтобы ТОЧНО указать на кого мы будем оказывать эффект. И из всего множества параметров (таких как стабильность, толерантность, торговое влияние... и др, которых в игре огромное количество) осуществить ТОЧНУЮ "выборку" тех, которыми мы и будем оказывать ЭФФЕКТ. Ко всему прочему, для того чтобы "сценарий" не был абсурдным и вписывался в игровой процесс, нам надо сделать "выборку" из 
огромного количества игровых ситуаций, чтобы задать условия его "работы". Было бы глупо, если бы ивенты "про республиканские традиции", вдруг, срабатывали для страны с.. Теокартией, например... Ну вы поняли, я думаю.

  "Выборку" мы будем осуществлять следующим образом: Брать готовые ФУНКЦИИ, определяющие (или меняющие) "область_действия" (Scopes), задавать условия (Conditions), которые "сужают" scope или точно указывают ОБЪЕКТ, и применять к ним ЭФФЕКТ, используя команды (Commands).

  Все просто. И в то же время - порой можно сломать мозг.

  Кстати, я не обратил ваше внимание еще и некоторые ФУНКЦИИ, которые используются внутри country_event = { } разработчиками.

is_mtth_scaled_to_size = 1
major = no

  Потому как по ним информации не нашел вообще. Как работают не в курсе. Могу лишь предполагать из их "названия". Думаю, например, что major = - обозначает ВЕЛИКИЕ ДЕРЖАВЫ в игре. Увидел эту случайно в одном из ивентов, при поиске примеров для этого поста... И не стал разбираться, а интуиция подсказывает...

  Остальные ФУНКЦИИ, или правильнее сказать подФУНКЦИИ - имеют очень хорошее описание и в Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

  Там даже, если ты - ЛОСЬ, не знаешь английского - можно Гуглом перевести. Все более или менее понятно. Хотя есть и то, что "с разбега" не осилить.

  И все это вам придется делать самостоятельно, я лишь расскажу о еще одной ФУНКЦИИ, чтоб напомнить о важности "областей_действия" и 
"исходных_данных".

 

Спойлер

  Я буду называть ФУНКЦИЮ trigger = { } - ТРИГГЕРом. Работает она, как "выключатель" ФУНКЦИИ, внутри которой он находится. Внутри ТРИГГГЕРА - условия. Если они соблюдаются, то ТРИГГЕР, как РЕЗУЛЬТАТ отпарвляет "наверх" в основную ФУНКЦИЮ значение "ИСТИНА" и она "работает", если не соблюдается - не работает.

  Чтобы описать это наиболее наглядно возьму пример с простой электрической цепью (причем все очень просто и условно, не усложняя зазря):

Источник_питания --> Проводник --> Лампочка

  Это три разных ФУНКЦИИ, которые по сути отвечают за ОСВЕЩЕНИЕ.

ФУНКЦИЯ Источник_питания имеет "область_действия" - ЭЛЕКТРИЧЕСТВО, а "исходные_данные", например, - силу_тока.

ФУНКЦИЯ Проводник имеет "область_действия" - ЭЛЕКТРИЧЕСТВО, а "исходные_данные", например, - сопротивление.

ФУНКЦИЯ Лампочка имеет "область_действия" - ЭЛЕКТРИЧЕСТВО, а "исходные_данные", например, - мощность.

  Чтобы управлять ОСВЕЩЕНИЕМ, нам надо в "Проводник" "врезать" ТРИГГЕР (ВЫКЛЮЧАТЕЛЬ).

  Теперь, когда "Выключатель" в положении ВКЛ (Истина) - свет горит. В положении ВЫКЛ (ЛОЖЬ) - не горит.

  Сам "выключатель" не имеет никакого отношения к "области_действия" ЭЛЕКТРИЧЕСТВО. Ни сила тока, ни сопротивление, ни мощность ему
так же не важны.

  Он физически делит "Проводник" на два куска (не меняя его длинну), и смыкает и размыкает цепь. Ему не важно какой "Источник_питания", ему не важно какая "Лампочка", ему не важно какой "Проводник". Он куску провода либо разрешает выполнять свою функцию (проводить ЭЛЕКТРИЧЕСТВО), либо не разрешает.

  При том, что он не относится к "области_действия" всех трех ФУНКЦИЙ, и никаким образом не зависит от "исходных_данных" этих ФУНКЦИЙ, он делает невозможным (или возможным) работу всего ОСВЕЩЕНИЯ.

  ТРИГГЕР, используемый внутри ФУНКЦИЙ country_event = { } и province_event = { } содержит какие-либо условия. Эти условия и определяют, будет ли "вообще срабатывать" "Событие" или нет. Причем тут одна тонкость. Она касается не ТРИГГЕРА, а MTTH.  Даже если условия ТРИГГЕРА соблюдены - "вообще срабатывать" может
означать - "никогда". Потому, что есть ФУНКЦИЯ MTTH, которая та еще капризная зараза...  Т.е. срабатывание ТРИГГЕРА означает, что "Событие" БУДЕТ РАБОТАТЬ. А "когда" оно таки сработает - забота MTTH.

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

  Внутри других функций - он делает все то же самое, приментильно к этим функциям:

Спойлер
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

 

Спойлер
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

Обратите внимание. 

  Мы имеем две опции "Эта кнопка для МОСКВИИ" и "Эта кнопка не для МОСКОВИИ", которые НИКОГДА не будут отображаться вместе. Мы будем видеть либо одну (играя за Московию), либо другую (играя, например, за Новгород). И эффекты будут разные! (Взаимоисключение не обязательно)

  Третья опция будет доступна всегда! Она будет одинакова (название) и для игроков за МОСКОВИЮ и для игроков за Новгород. А эффекты будут разными.

  ПРИНЦИПИАЛЬНАЯ разница здесь в том, что, используя ФУНКЦИЮ If = { } - мы меняем "область_действия". Мы делаем нашу Scope - определенной (МОСКОВИЯ или НЕ МОСКОВИЯ), а значит можно применить ЭФФЕКТ непосредственно к ней. ТРИГГЕР так не умеет! Внутри ФУНКЦИИ trigger = { ), применять ЭФФЕКТЫ нельзя!

  Кстати, именно поэтому в примерах ТРИГГЕРА №№ 1 и 2: мы используем на самом деле ДВЕ ФУНКЦИИ, внутри каждой засовывая ТРИГГЕР. И всегда получается, что работает ТОЛЬКО ОДНА из двух! Ивент не может иметь несколько картинок, или несколько описаний. Поэтому условия ВЗАИМОИСКЛЮЧАЮЩИЕ!

  Мы не можем там использовать конструкцию с ФУНКЦИЕЙ If = { }, даже если соблюдаем ВЗАИМОИСКЛЮЧАЮЩИЕ условия  - потому как это будет конфликт "областей_действия":

ФУНКЦИЯ If = { } - имеет country scope
A ФУНКЦИИ picture = и desc = - имеет "область_действия", связанную с локализацией или расположением файлов... или еще там с чем. Я не знаю...

  Чтоб добиться взаимоисключения, нам приходится в первом ТРИГГЕРЕ проверять, что игрок - МОСКОВИЯ. Во втором, что игрок - любая страна, кроме МОСКОВИЯ.

 

.

Спойлер

Иногда, кажется, что не во всех ивентах "область_действия" четко определена.

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

  Не очень понятно, к какому ОБЪЕКТУ (стране) применяется эффект. Понятно, что у "какой-то" страны, если у монарха есть соответствующая черта характера - будет прибавка в 20 административных очков.

  На самом деле эффект применяется к стране, которой выпал ивент (ROOT). Это подразумевается по умолчанию в любом скрипте, если вы не измените scope, используя ФУНКЦИИ.

Т.е. теоретически скрипт должен выглядеть так:

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

В данном случае, конечно, все это "очевидно" - но в сложных конструкциях и перекрестных ивентах - ломает напрочь мозг.

.

Спойлер
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

Оператор AND используется в "сложных условиях": ИЛИ (это И это, И это), ИЛИ (это И это, И это,)

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

Кстати, тут еще используется "модификатор_отношений" modifier = opinion_went_on_grand_tour 

Эти модификаторы ищите в файле: ...\Europa Universalis 4\common\opinion_modifiers\00_opinion_modifiers.txt

 

На этом у меня пока все. Текста много - читать не удобно, но и форматировать конструкции из спойлеров...  "вообще забей".. 

Изменено пользователем Kassatka
Поправлены слетевшие спойлеры
Ссылка на комментарий

Еще, я думаю, будет полезно ознакомиться с информацией по этому вопросу на Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

В этой теме автор сгруппировал scopes, conditions и commands, по своему усмотрению и многим из них дал комментарии.

Выложу их тут:

 

Спойлер

Here is a link to a post by Captain Gars that explains how scopes are used in EU IV (good for all of us EU III modders :).
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.
A note on ROOT- Several vanilla province events use ROOT where it refers to the owner rather than the province.
I have tested and confirmed that ROOT within a province event can refer to either the province or the owner. I believe it is dependent on the particular trigger/effect.
Code:
#############################
# List of EU IV Scopes
#############################
regions, continents, and province ids can be used as scopes as well
Also can use PREV, ROOT, FROM, tags, THIS

#Can use your event targets as a scope
event_target:name_of_custom_event_target

#############################
# Country Trigger Scopes
#############################
all_ally = {  }
all_coalition_member = {  } #never found in code
all_country = {  }
all_elector = {  }
all_enemy_country = {  }
all_known_country = {  }
all_local_enemy = {  }
all_neighbor_country = {  }
all_rival_country = {  }
all_subject_country = {  }
any_ally = {  }
any_coalition_member = {  } #never found in code
any_country = {  }
any_elector = {  } #never found in code
any_enemy_country = {  }
any_known_country = {  }
any_local_enemy = {  } #never found in code
any_neighbor_country = {  }
any_rival_country = {  }
any_subject_country = {  }
colonial_parent = {  }
crusade_target = {  }
emperor = {  }
overlord = {  }
revolution_target = {  }

#############################
# Country Effect Scopes
#############################
colonial_parent = {  }

emperor = {  }  #I don't think that it uses limit because I always see it in an IF scope

every_ally = {
    limit = {
    }

}

every_coalition_member = {
    limit = {
    }

}

every_country = {
    limit = {
    }

}

every_elector = {
    limit = {
    }

}

every_enemy_country = {
    limit = {
    }

}

every_known_country = {
    limit = {
    }

}

every_local_enemy = {
    limit = {
    }

}

every_neighbor_country = {
    limit = {
    }

}

every_rival_country = {
    limit = {
    }

}

#In 1.4 patch notes, but not found in code
every_subject_country = {
    limit = {
    }

}

#can use if inside of an if = scope as well
if = {
    limit = {
    }

}

overlord = {  }

random_ally = {
    limit = {
    }

}

random_coalition_member = {
    limit = {
    }

}

random_country = {
    limit = {
    }

}

random_elector = {
    limit = {
    }

}

random_enemy_country = {
    limit = {
    }

}

random_known_country = {
    limit = {
    }

}

random_local_enemy = {
    limit = {
    }

}

random_neighbor_country = {
    limit = {
    }

}

random_rival_country = {
    limit = {
    }

}

#In 1.4 patch notes, but not found in code
random_subject_country = {
    limit = {
    }

}

#place whatever within the hidden effect and player can't see it
#Can place country scopes or province scopes in hidden effect
hidden_effect = {
}

#hidden_effect could also be inside or outside if = scope
hidden_effect = {
    if = {
        limit = {
        }

    }
}

#############################
# Province Trigger Scopes
#############################
##
#In a Country Scope
##
all_active_trade_node = {  }
all_core_province = {  }
all_heretic_province = {  }
all_owned_province = {  }  #Triggers must return true for all of the country's owned provinces
all_province = {  }
all_trade_node = {  }
any_active_trade_node = {  }  #Empty trigger means its true if we got any placed trader.  Many uses, can specify region/continent, who ownes provinces in it
any_core_province = {  }
any_heretic_province = {  }
any_owned_province = {  }
any_province = {  }
any_trade_node = {  }
area_name = {  }
capital_scope = {  }
home_trade_node = {  }
province_group_name = {  }
region_name = { } #Can also include type = all to check that all provinces in the region return true for the trigger
superregion_name = {  }
trade_company_region_name = { } #can use a specific trade company region name as a scope

##
#In a Province Scope
##
all_empty_neighbor_province = {  }
all_neighbor_province = {  } #does not target empty provinces
all_trade_node_member_province = {  }
any_empty_neighbor_province = {  }
any_friendly_coast_border_province = {  }
any_neighbor_province = {  } #does not target empty provinces
any_province = {  }
any_trade_node_member_province = {  } #Inside of the any_active_trade_node = {  }
area_name = {  }
region_name = {  }
sea_zone = { } #The sea province where the province's port accesses, check if two countries share a sea zone allowing island nations to have "neighbors" in a trigger.

#############################
# Province Effect Scopes
#############################
##
#In a Country Scope
##
capital_scope = {  }

every_core_province = {
    limit = {
    }

}

every_heretic_province = {
    limit = {
    }

}

every_owned_province = {
    limit = {
    }

}

every_province = {
    limit = {
    }

}

random_core_province = {
    limit = {
    }

}

random_heretic_province = {
    limit = {
    }

}

random_owned_area = {
    limit = {
    }
}

random_owned_province = {
    limit = {
    }

}

##
#In a Province Scope
##
area_name = {  }
region_name = {  }

every_empty_neighbor_province = {
    limit = {
    }

}

every_neighbor_province = {
    limit = {
    }

}

random_empty_neighbor_province = {
    limit = {
    }

}

random_neighbor_province = {
    limit = {
    }

}

random_province = {
    limit = {
    }

}

sea_zone = { } #The sea province where the province's port accesses, check if two countries share a sea zone allowing island nations to have "neighbors" in a trigger.

####################################################
# Country Scopes That Must Be In a Province Scope
####################################################
##
#Triggers
##
all_core_country = {  }
any_core_country = {  }

##
#Effects
##
every_core_country = {
    limit = {
    }

}

random_core_country = {
    limit = {
    }

}
##
#Both
##
controller = {  }
owner = {  }

####################################################
# Trade Scopes (Inside a country Scope)
# All of these are province scopes
####################################################
##
#Triggers
##
all_active_trade_node = {  }
all_trade_node = {  }
any_active_trade_node = {  }  #Empty trigger means its true if we got any placed trader.  Many uses, can specify region/continent, who ownes provinces in it
any_trade_node = {  }
home_trade_node = {  }

##
#Effects
##
every_active_trade_node = {
    limit = {
    }

}

#not sure if this one works
every_trade_node = {
    limit = {
    }

}

random_active_trade_node = {
    limit = {
    }

}

random_trade_node = {
    limit = {
    }

}

####################################################
# Inside Trade Scopes
# Must be inside trade node scope (province scope)
####################################################
##
#Country
##

#Triggers
all_privateering_country = {  }
all_trade_node_member_country = {  }
any_privateering_country = {  }
any_trade_node_member_country = {  }
most_province_trade_power = {  } #probably refers to the country with the most trade power from provinces in a node
strongest_trade_power = {  }

#Effects
every_trade_node_member_country = {  }
most_province_trade_power = {  } #probably refers to the country with the most trade power from provinces in a node
random_trade_node_member_country = {  }

every_privateering_country = {
    limit = {
    }

}

random_privateering_country = {
    limit = {
    }

}

##
#Province
##

#Triggers
all_trade_node_member_province = {  }
any_trade_node_member_province = {  }

#Effects
every_trade_node_member_province = {
    limit = {
    }

}

random_trade_node_member_province = {
    limit = {
    }

}

########################################################
# Mission Scopes (province and country not separated, noted to side)
########################################################
##
#Triggers
##
all_target_province = {  } #province scope
any_target_province = {  } #province scope

##
#Effects
##
every_target_province = {  } #province scope
random_target_province = {  } #province scope

 

Спойлер

#############################
# List of EU IV Triggers
#############################
(ROOT, FROM, tag, REB, owner, PREV, THIS, emperor)

hidden_trigger = {

}
custom_trigger_tooltip = {
    tooltip =

}
has_dlc = #this trigger doesn't work for all dlcs, perhaps only the larger content ones
has_custom_ideas = yes
has_global_flag =
had_global_flag = { flag = _ days = 365 }
ironman = yes
is_playing_custom_nation = no
nation_designer_points = 200 #checks how many points were used to create nation in the nation designer
normal_or_historical_nations = yes
normal_province_values = yes
num_of_custom_nations = 1
real_day_of_year =
real_month_of_year =
start_date = 1444.11.11 #or whichever date you want to check for, will only return true if the game was started on this specific date
started_in = 1444.11.11 #or whichever date you want to check for, returns true if the game was started on or after this date. Localization is currently messed for this trigger
always = no #Will make it so that an event will never fire, if put in the potential of a decision then it will never be available, if in the allow of the decision then it can't be enacted.

#Scripted Triggers (defined in common\scripted_triggers)
scripted_triggers_name = yes #no doesn't work, must use NOT = { scripted_triggers_name = yes }

#######################################
# Both Triggers (province and country)
#######################################
check_variable = { which = _ value = 5 }
is_variable_equal = { which = _ value = 5 }
#Variable effects and triggers can now take a second variable as an argument
#Variable effects and triggers can now take a scope as an argument
#Examples from Captain Gars
check_variable = { which = var1 which = var2 }
check_variable = { which = var1 which = FROM }

is_month =
is_religion_enabled = protestant
is_religion_enabled = reformed
is_year =

#Used for counting provinces, put any trigger(s) after value = and it returns true if at least that number of provinces (the value) return true for the trigger.
num_of_owned_provinces_with = {
    value = 2

}

#############################
# Other Country Triggers
#############################
ai = yes
exists = yes #Can also use tag
great_power_rank = 1
had_country_flag = { flag = _ days = 365 }
has_country_flag =
has_country_modifier =
has_first_revolution_started = yes
has_game_started = yes
has_saved_event_target =
has_switched_nation = no
is_great_power = yes
is_revolution_target = yes
is_westernising = no
luck = no
num_of_cities = 3 #can also use ROOT, FROM, PREV, tag, etc to compare country size
personality = #use one of the ai personalities
revolution_target_exists = yes
tag =
was_player = no

#Following Trigger has two separate uses
calc_true_if = {
    #triggers
    amount = 3
}

#It can be used with multiple triggers, and it returns true if at least X amount of the triggers return true
calc_true_if = {
    ADM = 4
    religion = catholic
    full_idea_group = religious_ideas
    religious_unity = 1.0
    is_papal_controller = yes
    amount = 3
}
#So this will return true if at least 3 of these 5 triggers are true

#This trigger funtions differently if using one of the all_ triggers
#Country Scope Example
calc_true_if = {
    all_country = {
        religion = protestant
    }
    amount = 5
}
#This will return true if there are at least 5 Protestant countries in the world

#Province Scope Example
calc_true_if = {
    all_owned_province = {
        has_terrain = marsh
    }
    amount = 2
}
#This will return true if the scope has at least two provinces that have the marsh terrain

has_global_modifier_value = {
    which =
    value =
}

#Example
has_global_modifier_value = {
    which = cavalry_power
    value = 0.5
}

#Can use building names as a trigger to check that country has a certain number of a building
name_of_building = 3  #ex. university = 1

#############################
# Army
#############################
army_size = #Can use a number here to check army size. Can use tag, ROOT, FROM, PREV,etc to compare num of regiments
army_size_percentage = 0.7 #percentage of forcelimit used
army_tradition = 10
artillery_fraction = #should be a decimal
cavalry_fraction = #should be a decimal
infantry_fraction = #should be a decimal
land_forcelimit = 20
land_maintenance = 1.0
manpower = 12 #available manpower, can also compare countries with tag, ROOT, FROM, PREV, etc.
manpower_percentage = 0.5
max_manpower = 20
max_manpower_greater_than = #never found in code
num_of_artillery = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of regiments
num_of_cavalry = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of regiments
num_of_infantry = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of regiments
num_of_conquistadors = 1
num_of_generals = 1
num_of_generals_with_traits = 1
num_of_mercenaries = 1

#############################
# CB enabled
#############################
cb_on_government_enemies = yes
cb_on_overseas = yes
cb_on_primitives = yes
cb_on_religious_enemies = yes

#############################
# Colonization
#############################
has_colonial_parent = yes
is_colonial = yes #This may have been removed with 1.4
is_colonial_nation = yes
is_former_colonial_nation = yes
is_random_new_world = no
num_of_colonies = 3
num_of_colonists = 1
num_of_conquistadors = 1
num_of_explorers = 1
tariff_value = 0.25
overseas_provinces_percentage = 0.25

#############################
# Culture, Revolts, and Stability
#############################
accepted_culture =
average_autonomy = 10
average_autonomy_above_min = 2
average_effective_unrest = 2
average_home_autonomy = 10 #Excludes overseas provinces
average_unrest = 1
culture_group =
dominant_culture = #capital, specific culture
has_spawned_rebels =  #rebel type here to check for that type of rebel, works for country scope not sure for province scope
num_of_rebel_armies = 1
num_of_rebel_controlled_provinces = 1
num_of_revolts = 1
overextension_percentage = 0.05
primary_culture =
revolt_percentage = 0.1
stability = 1
unrest = 5 #Can now also be used in the country scope

#############################
# Diplomatic
#############################
ai_attitude = { who = _ attitude = _ }
alliance_with =
border_distance = { who =  distance = 100 } #check distance using debug_mode
can_justify_trade_conflict =
can_release = #never found in code
capital_distance = { who =  distance = 100 } #Calculates the distance between two capital provinces' primary cities and not the provinces' borders. Check distance using debug_mode
claim = #ROOT, tag, etc., returns true if the country has any province claims in the scope country
core_claim = #ROOT, tag, etc., returns true if the country has any core provinces in the scope country.  Tooltip states claim instead of core
defensive_war_with =
diplomatic_reputation = 5
dynasty =  #ROOT, FROM, tag, PREV, etc
federation_size = 5
guaranteed_by =
has_casus_belli = { type = _ target = _ }
has_casus_belli_against =
has_discovered = #tag, etc.
has_given_consort_to =
has_guaranteed =
has_spawned_supported_rebels = #FROM, ROOT, PREV, tag, etc
has_spy_network_from = { who = _ value = 25 }
has_spy_network_in = { who = _ value = 25 }
heir_nationality = #ROOT, FROM, PREV, probably tag as well
historical_friend_with =
historical_rival_with =
in_league =  #name of religion
institution_difference = { who = ROOT value = 2 } #Compares number institution with target country
is_client_nation_of =
is_colonial_nation_of =
is_enemy =
is_federation_leader = yes
is_in_coalition = no
is_in_trade_league_with =
is_league_enemy = #ROOT, FROM, PREV, etc.
is_league_friend =
is_neighbor_of =
is_origin_of_consort =
is_possible_march =
is_possible_vassal = #never found in code, tested and confirmed to work
is_rival =
is_subject_of =
is_threat =
junior_union_with =
knows_country =
march_of =
marriage_with =
neighbors_tech_discount =
num_of_allies = 3
num_of_coalition_members = 6
num_of_colonial_subjects = 3
num_of_diplomats = 1
num_of_diplomatic_relations = 4
num_of_free_diplomatic_relations = 1
num_of_marches = 1
num_of_protectorates = 2
num_of_royal_marriages = 3
num_of_trusted_allies = 5
num_of_unions = 2
num_of_vassals = 1
num_of_war_reparations = 5
offensive_war_with =
overlord_of =
provinces_on_capital_continent_of =
subsidised_percent_amount = 0.5
succession_claim =
senior_union_with =
tech_difference =
trade_embargoing = #never found in code
trade_embargo_by =
trade_league_embargoed_by =
truce_with =
vassal_of =
war_with =
war_score_against = {
    who =
    value =
}

has_opinion = {
    who =
    value =
}

reverse_has_opinion = { who = _ value = 80 }
#Examples
PAP = { has_opinion = { who = ROOT value = 100 } }              #This requires that the Pope has an opinion of the ROOT of at least 100
PAP = { reverse_has_opinion = { who = ROOT value = 100 } }        #This requires that the ROOT has an opinion of the Pope of at least 100

has_opinion_modifier = {
    modifier =
    who =
}

has_opinion_modifier = {
    modifier = aggressive_expansion
    who = FROM
    value = -49
}
#can also use reverse
reverse_has_opinion_modifier

#Do not need to use all of these perameters in the trigger, these are just all the possible options
is_in_war = {
    attacker_leader =
    defender_leader =
    casus_belli =
    war_score =
    duration =
    war_goal_province =
    start_date =

    # You can add multiple to check for multiple defenders/participants
    defenders =
    participants =
}

years_in_union_under = {
    who =
    years = 50
}

years_in_vassalage_under = {
    who =
    years = 10
}

#These three triggers check the scopes relative strength to the who
#Therefore 0.5 would return true if their strength is at least half of the who's strength, while 2.0 would return true if their strength is at least double the who's strength
#for who you can use tag, FROM, ROOT, PREV, etc.
army_strength = {
    who =
    value = 0.5
}
military_strength = {
    who =
    value = 2.0
}
naval_strength = {
    who =
    value = 1.0
}

#############################
# Discovery, States, Territories, Areas, and Provinces (Country Scope)
#############################
capital = #can use province id
controls = #can use province id
core_percentage = 0.5 #only considers number of provinces and not development
has_discovered = #Province id, region, continent, ROOT (if in province scope)
is_claim = #province id, ROOT, FROM, PREV, etc.
is_core = #can use province id
is_state_core = #can use province id
is_territorial_core = #can use province id
num_of_provinces_in_states = 10
num_of_provinces_in_territories = 10
num_of_states = 5
num_of_territories = 5
owns =
owns_core_province =
owns_or_vassal_of = #can use province id

has_discovered_region = {
    region =
    years =
}
#region = can use specific region name or a scope (FROM, ROOT, PREV)

#This trigger is not localized
has_discovered_capital_region_of = {
    who =
    years =
}

#This trigger is not localized
has_any_country_in_region_discovered_capital_region_of = {
    region =
    who =
    years =
}

#another way to check discovery
north_america = { has_discovered = ROOT }

#Do you own any province in this region
name_of_region_or_continent = { owned_by = tag }

#Checks if all provinces of the region return true for the trigger
#So this triggers true if you own all the provinces of this region
name_of_region_or_continent = { type = all owned_by = tag }

#This triggers true if Ottomans don't own any provinces in Western Balkans
western_balkans = { type = all NOT = { owned_by = TUR }}

#############################
# Economy, Power Currency, and Tech
#############################
adm_power = 50
adm_tech = 10
dip_power = 50
dip_tech = 10
has_institution = #Institution name
gold_income = 10
gold_income_percentage = 0.35
inflation = 5
is_bankrupt = yes
is_in_deficit = yes
is_institution_enabled = #Institution name
mil_power = 50
mil_tech = 10
monthly_income = 60
national_focus = #mil/dip/adm
num_of_loans = 5
production_efficiency = 0.5
production_income_percentage = 0.33
production_leader = { trade_goods = name_of_trade_good }
tax_income_percentage = 0.33
technology_group =
total_base_tax = 25
total_development = 200
treasury = 200
years_of_income = 0.25

#Not sure what the value part does, but it isn't needed
production_leader = { #never found in code
    trade_goods =
    value = yes #yes or no
}

#############################
# Estates, Factions, and Disasters
#############################
estate_influence = { estate = name influence = 80 }
estate_loyalty = { estate = name loyalty = 50 }
estate_territory = { estate = name territory = 15 }
faction_in_power =
has_any_disaster = no
has_disaster = #disaster name
has_disaster_progress = { disaster = _ value = _ }
has_estate_influence_modifier = { estate = name modifier = modifier_name }
has_estate_loyalty_modifier = { estate = name modifier = modifier_name }
has_estate = #estate name
has_factions = yes
num_of_powerful_estates = 3

faction_influence = {
    faction =
    influence =
}

#############################
# Governments and Advisors
#############################
advisor = #type of advisor - Can also use advisor type as a trigger to check skill level, i.e. statesman = 3
advisor_exists = 236  #This number is the advisor_id, found in advisor history
corruption = 50
current_debate = #Debate name
current_size_of_parliament = 3
government = dictatorship
government = monarchy
government = republic
government = theocracy
government = tribal
government_rank = 2
has_active_debate = yes
has_active_policy =
has_advisor = yes
has_parliament = yes
horde_unity = 70
is_advisor_employed = 562  #number is the advisor_id
is_league_leader = yes
is_nomad = no
is_orangists_in_power = yes
is_statists_in_power = yes
is_tribal = yes
legitimacy = 95  #Highest is 100
legitimacy_or_horde_unity = 95
militarized_society = 50
months_of_ruling = 12
percentage_backing_issue = 0.5
prestige = 25 #Can also compare two countries with tag, ROOT, FROM, PREV, etc.
primitives = yes
republican_tradition = 80
statists_vs_orangists = 0.9
yearly_corruption_increase = 0.001

#Can use any combination of the following three parameters
employed_advisor = {
    home_religion =
    home_culture =
    type =
}
#home_religion = #specific religion, true_faith, heretic, heathen, or ROOT
#home_culture = #specific culture or ROOT

#Can also check gender
employed_advisor = {
    type =
    is_male = yes
}
employed_advisor = {
    type =
    is_female = yes
}

#############################
# HRE
#############################
allows_female_emperor = no
has_hre_emperor_modifier =
has_hre_member_modifier =
hre_heretic_religion = #ROOT, FROM, tag, PREV, etc
hre_leagues_enabled = yes
hre_reform_level = 6
hre_religion = #name of religion
hre_religion_locked = no
hre_religion_treaty = no
hre_size = 25
imperial_influence = 10
is_elector = yes
is_emperor = yes
is_imperial_ban_allowed = yes
is_part_of_hre = yes
num_of_electors = #never found in code, should probably be a number
preferred_emperor = #ROOT, FROM, tag, PREV, etc
will_back_next_reform = yes

#############################
# Ideas
#############################
full_idea_group =
has_idea =
has_idea_group =
#Can check for number of ideas in each catagory, i.e. administrative_ideas = 1

#############################
# Military (both navy and army)
#############################
had_recent_war = 10 #number of years since last war
has_leader = "_"  #name of leader
has_truce = no
has_unit_type =
has_wartaxes = yes
is_at_war = yes
is_in_league_war = no
war_exhaustion = 5
war_score = 25
war_with_nomads = #I believe this yes or no but not sure

#found in list of triggers but not in code, unsure how it should be formated, Update- See below
has_leader_with

#Killzerslaul has tested the trigger using the following format and says that it works. Thanks for testing!
#Checks that the country has a leader with at least these stats
has_leader_with = {
    fire = 6
    shock = 6
    manuever = 6
    siege = 1
}
#Golladan also discoverd that we can specify the type of leader using the following
has_leader_with = {
   admiral = yes
   manuever = 1
}
has_leader_with = {
   general = yes
   manuever = 1
}
#Can use general or admiral, but not explorer or conquistador.  Explorers are considered admirals, and conquistadors are considered generals

#############################
# Missions
#############################
ai_mission = yes #Allows the mission to fire for the AI, without this only the player can get the mission
last_mission = #mission name here, check that the mission was or wasn't the last chosen

#############################
# Navy
#############################
blockade = 75 #maybe checking percentage of country blockaded
galley_fraction = #should be a decimal
has_privateers = yes
heavy_ship_fraction = #should be a decimal
light_ship_fraction = #should be a decimal
transport_fraction = #should be a decimal
naval_forcelimit = 40
naval_maintenance = 1.0
navy_size = #Can use a number here to check navy size. Can use tag, ROOT, FROM, PREV,etc to compare num of ships
navy_size_percentage = 0.5
navy_tradition = 40
num_of_admirals = 1
num_of_admirals_with_traits = 1
num_of_explorers = 1
num_of_galley = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of ships
num_of_heavy_ship = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of ships
num_of_light_ship = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of ships
num_of_transport = 10 #Can also use tag, ROOT, FROM, PREV,etc to compare num of ships
num_of_ports = 1
num_of_ports_blockading = 10
num_of_total_ports = 10
num_ships_privateering = 50
sailors = 4000
sailors_percentage = 0.9

#############################
# Religion
#############################
at_war_with_religious_enemy = yes
authority = 50
church_power = 50
devotion = 75
dominant_religion = #capital, specific religion, secondary
doom = 5
fervor = 75
has_active_fervor = no
has_adopted_cult = #cult name
has_border_with_religious_enemy = yes
has_church_aspect = #Aspect's name
has_friendly_reformation_center = yes
has_hostile_reformation_center = yes
has_matching_religion = #ROOT, FROM, TAG, PREV, etc.
has_personal_deity = #Deity's name
has_unlocked_cult = #cult name
invested_papal_influence = 10
is_any_heresy_enabled = yes #never found in code
is_crusade_target = yes
is_defender_of_faith = yes
is_excommunicated = no
is_force_converted = no
is_papal_controller = yes
is_previous_papal_controller = yes
is_religion_reformed = yes
karma = 50 #Goes from -100 to 100
num_of_active_blessings = 2
num_of_aspects = 2
num_of_cardinals = 1 #guessing this is number of cardinals under your influence
num_of_missionaries = 2
num_of_religion = { religion = _ value = 3 }  #with _ being name of religion, also seen value be a decimal and in this case it is probably a percentage of total provinces
num_of_religion = { heretic = yes value = 3 } #Checks for scope's religion and heretic religions, so basically counts all provinces of the scope's religous group
num_of_unlocked_cults = 2
papacy_active = yes  #Country and Province Scope
papal_influence = 20
patriarch_authority = 0.5
piety = -0.1
reform_desire = 0.1
religion = #name of religion, ROOT, FROM, PREV, secondary
religion_group =
religion_years = { protestant = 5 }
religion_years = { reformed = 5 }
religious_unity = 1.0 #Percentage of people in your country following the state religion, based on province taxes
secondary_religion = #name of religion
total_number_of_cardinals = 1
uses_authority = yes
uses_blessings = yes
uses_church_aspects = yes
uses_cults = yes
uses_doom = yes
uses_fervor = yes
uses_karma = yes
uses_papacy = yes
uses_patriarch_authority = yes
uses_personal_deities = yes
uses_piety = yes
uses_syncretic_faiths = yes

#this may need to be confirmed
#Can also use religion = a_number to check the tolerance of a particular religion
#example
NOT = { protestant = -2 }

#############################
# Rulers, Heirs, and Consorts
#############################
ADM = 3
DIP = 3
MIL = 3
can_heir_be_child_of_consort = yes #Checks if heir is a child of your consort
consort_age = 30
consort_adm = 3
consort_dip = 3
consort_mil = 3
consort_has_personality = #personality name
dynasty = "dynasty name"
had_consort_flag = { flag = _ days = 365 }
had_heir_flag = { flag = _ days = 365 }
had_ruler_flag = { flag = _ days = 365 }
has_consort = yes
has_consort_flag = yes
has_consort_regency = yes
has_female_consort = yes
has_female_heir = no
has_foreign_consort = yes
has_foreign_heir = yes
has_heir = yes #can also use a specific name
has_heir_flag =
has_new_dynasty = yes
has_regency = no #Includes consort regencies
has_ruler = "specific ruler name"
has_ruler_flag =
has_ruler_modifier =
heir_adm = 3
heir_dip = 3
heir_mil = 3
heir_age = 15
heir_claim = 90
heir_has_consort_dynasty = yes
heir_has_personality = #personality name
heir_has_ruler_dynasty = yes
is_heir_leader = yes
is_female = no
is_monarch_leader = yes
ruler_age = 40
ruler_consort_marriage_length = 3 #in years
ruler_has_personality = #personality name
ruler_is_foreigner = yes

#############################
# Subjects
#############################
can_create_vassals = #never found in code
has_divert_trade = yes #Subject interaction, used in subject's scope
has_embargo_rivals = yes #Subject interaction, used in subject's scope
has_promote_investments = #Trade Company Tag, Subject interaction but since only for trade companies it won't be in subject's scope
has_scutage = yes #Subject interaction, used in subject's scope
has_send_officers = yes #Subject interaction, used in subject's scope
has_subsidize_armies = yes #Subject interaction, used in subject's scope
has_support_loyalists = yes #Subject interaction, used in subject's scope
is_client_nation = yes
is_lesser_in_union = no
is_march = yes
is_overseas_subject = yes
is_protectorate = yes
is_subject = no
is_vassal = no
liberty_desire = 80

#############################
# Trade
#############################
cotton = 1 OR grain = 1 (etc)
is_in_trade_league = yes
is_trade_league_leader = yes
mercantilism = 25
num_of_merchants = 4
num_of_strong_trade_companies = 4
num_of_trading_bonuses = 7
num_of_trade_embargos = #not found in code
trade_efficiency = 0.5
trade_income_percentage = 0.35

trading_bonus = {
    trade_goods = #type of trade good
    value = yes #yes or no
}

trading_part = {
    trade_goods = #type of trade good
    value = 0.2
}

#############################
# Province
#############################
##
# Other Triggers
##
base_manpower = 8
base_production = 8
base_tax = 8
can_build =
construction_progress = 0.5
development = 10
had_province_flag = { flag = _ days = 365 }
has_building =
has_climate = #Climate name
has_construction = #core, culture, building, merchant, diplomat, missionary, army, navy, canal, great_project or any
has_great_project = #specific name
has_port = yes
has_province_flag =
has_province_modifier =
has_terrain =
has_winter =
institution_name = 50 #0-100, check how close the province is to gaining a specific institution
is_institution_origin = #institution name
island = yes
is_capital = yes
is_city = yes
is_in_capital_area = yes #Need to test this
is_part_of_hre = yes
is_sea = yes #checks if is a sea province (ocean, sea, lake)
num_free_building_slots = 1
num_of_times_improved = 5

has_local_modifier_value = {
    which =
    value =
}

##
# Colonies
##
colonial_claim_by_anyone_of_religion = #country or specific religion, checks if anyone from that religion (or the country's religion) has gotten a colonial grant for the scope's colonial region from any potential pope-like entities
colonial_region =
colonysize = 500
has_colonist = yes
has_empty_adjacent_province = yes #can only use yes, using no doesn't work.  Instead use NOT = { has_empty_adjacent_province = yes }
is_colony = yes
is_empty = yes
is_overseas = no
is_religion_grant_colonial_claim = yes #yes, no, or country, checks if a province has been granted by any/all religious leader(s) to any country, to no country, or by their own religious leader to a specific country
native_ferocity = 3
native_hostileness = 5
native_size = 1
range = #ROOT, FROM, PREV, tag, etc.  This checks if the province or region is in colonization range.

##
# Controls, Cores, and Claims
##
controlled_by = #owner, REB, tag, ROOT, PREV, FROM, rebel_type
is_claim = #tag, ROOT, FROM, PREV, controller, owner
is_core = #tag, ROOT, FROM, PREV, controller, owner
is_state_core = #tag, ROOT, FROM, PREV, controller, owner
is_territorial_core =  #tag, ROOT, FROM, PREV, controller, owner
months_since_defection = 60  #not entirely sure what this checks, found in flavorGEN,flavorMAM
months_since_last_owner_change = 60 #never found in code and reported that it doesn't work
owned_by =
previous_owner = #tag, ROOT, FROM, PREV, etc.

##
# Estates and Parliament
##
has_estate = #yes or estate name, not sure if has_estate = no works since Paradox always uses NOT = { uses has_estate = yes }
has_seat_in_parliament = yes
is_backing_current_issue = no

##
# Military
##
fort_level = 1
garrison = 1000
has_heir_leader_from = #ROOT, PREV, FROM, TAG, owner, controller
has_influencing_fort = yes
has_ruler_leader_from = #ROOT, PREV, FROM, TAG, owner, controller
has_siege = yes
is_blockaded = no
is_looted = yes
sieged_by = #owner, REB, tag, ROOT, PREV, FROM, rebel_type
units_in_province = 1 #1.13 added the ability to use scopes here, not sure if they fixed the previous issue where only the number 1 worked
unit_in_battle = yes #unit_in_battle = no doesn't work, must use NOT = { unit_in_battle = yes }
unit_has_leader = yes #unit_has_leader = no doesn't work, must use NOT = { unit_has_leader = yes }
unit_in_siege = yes #unit_in_siege = no doesn't work, must use NOT = { unit_in_siege = yes }

num_of_units_in_province = {
    who =
    type =
    amount =
}
#who = enemy, TAG, ROOT, PREV, or FROM, controller and owner may work but need to be tested
#type = infantry, cavalry, artillery, ship type, or specific unit
#type and who is not needed, if not included will default to any/all

#Check for unit types in province
artillery_in_province = 1 #can also use tags and scopes
cavalry_in_province = 1 #can also use tags and scopes
galleys_in_province = 1 #can also use tags and scopes
heavy_ships_in_province = 1 #can also use tags and scopes
infantry_in_province = 1 #can also use tags and scopes
light_ships_in_province = 1 #can also use tags and scopes
transports_in_province = 1 #can also use tags and scopes

##
# Religion and Culture
##
culture = #ROOT, FROM, PREV, controller, owner
culture_group = #ROOT, FROM, PREV, controller, owner
has_cardinal = yes
has_missionary = yes
has_owner_culture = yes
has_owner_accepted_culture = yes
has_owner_religion = yes
is_reformation_center = yes
religion = #ROOT, FROM, PREV, controller, owner, secondary
religion_group = #ROOT, FROM, PREV, controller, owner
tolerance_to_this = 2

##
# Revolts and Rebels
##
can_spawn_rebels =  #rebel type here
has_harsh_treatment = yes #Can't use no as a right-side argument, must instead use NOT = { has_harsh_treatment = yes }
has_rebel_faction = #REB, not sure if you can put rebel type here
likely_rebels =  #rebel type here
local_autonomy = 50
nationalism = 10
pure_unrest = 2
unrest = 5

##
# States, Territories, Areas, and Regions
##
area = #area name
continent =
is_state = yes
is_territory = yes
province_group = #province group name
province_id = #id number, but can also use ROOT and such
province_size = #Unsure what this checks
region = #region name, capital, ROOT, PREV, FROM, if using a scope (such as ROOT) the tooltip is messed up and should be fixed
superregion = #super region name

#In a Region scope
country_or_vassal_holds = #ROOT, FROM, TAG, PREV, etc.  Returns true if the country or its subjects holds at least one province in the region.

#Example
the_carribean = { country_or_vassal_holds = ROOT }

#Can also include a type = all clause, which changes the requirement from 'at least one province in the region' to 'all provinces in the region'
the_carribean = {
    type = all
    country_or_vassal_holds = ROOT
}

##
# Trade
##
is_owned_by_trade_company = yes
province_trade_power
trade_company_size = 10
trade_goods = #e.g. grain
trade_range = #ROOT, tag, PREV, FROM, etc.

#Must be within a trade scope
has_merchant = #ROOT, TAG, PREV, FROM, etc.
has_most_province_trade_power = #In an active trade node or the province id of trade node.  tag, ROOT, FROM, etc
has_trader =  #Use in an active trade node or use province id of a trade node. Use ROOT, FROM, tag, PREV, etc.
highest_value_trade_node = yes
is_sea = yes #used in the active trade node scope and checks if the trade node is in a water province (can actually be used outside of a trade scope)
is_strongest_trade_power = #In an active trade node or the province id of trade node. Use tag, ROOT, FROM, etc

#Can use name and key
has_trade_modifier = {
    who =
    name =
}

#for country = can use FROM, ROOT, etc.
#Country isn't needed could just have privateer_power = { share = 10 }
privateer_power = {
    country = FROM
    share = 1
}

trade_share = {
    country = ROOT
    share = 10
}

#############################
# Unknown Scope and format
#############################
hre_majority =

#############################
# Code that doesn't work (been removed)
#############################
has_sphere = #EU IV doesn't use spheres in the way that EU III did.
in_sphere_of = # EU IV doesn't use spheres in the way that EU III did.
leads_coalition = yes #never found in code, coalitions no longer have leaders
num_of_free_ideas = #never found in code, tested and wasn't working properly
num_of_total_ideas = #never found in code, tested and wasn't working properly
num_of_placed_merchants = #never found in code. Not really needed since merchants are no longer a currency, they'll always be placed so can just count number of merchants.
num_of_trade_rights = #not found in code. I don't think there are trade rights in EU IV
pure_revolt_risk = 3 #Removed as of patch 1.8
revolt_risk = 1 #Removed as of patch 1.8
trade_leader = #Removed by Gars in 1.6 and didn't work before that

 

Спойлер

#############################
# List of EU IV Effects
#############################
clr_global_flag =
set_global_flag =

tooltip = { } #If you put tooltip = {} around an effect it only shows the tooltip and doesn't actually carry out the effect when the option is selected
custom_tooltip = # Creates a custom tooltip (as in words that the player will see when they look at the options effects). Found in elections, natives, and elsewhere
hidden_effect = {
 
}
highlight = yes #Used in an event option, this highlights the option. Vanilla uses it for options unlocked by ruler personalities.
required_personality = #Place this in an event option and it will add a tooltip that states the option is available due to having that personality

#Scripted Effects (defined in common\scripted_effects)
scripted_effects_name = yes

hide_ambient_object =
show_ambient_object =

#############################
# Other Country Effects
#############################
add_accepted_culture =
add_idea =
add_idea_group =
change_graphical_culture =
change_government =
change_primary_culture =
change_tag =
change_technology_group =
clear_global_event_target =
clear_global_event_targets =
clr_country_flag =
collapse_nation = yes
disband_rebels = #rebel type here, this should disband all rebels of this type in your lands
loan_size = 24  #Increases the amount of money loaned, loan size = 1 means each loan will be 1 months income, so loan size = 12 would be 12 months of income per loan.
remove_accepted_culture =
remove_country_modifier =
remove_idea =
remove_idea_group =
save_event_target_as =
save_global_event_target_as =
set_country_flag = #Can append a scope or event target to the end of a script flag, such as flag_name_@ROOT or flag_name_@event_target:targe_name
set_government_rank = 2 #1-3
set_primitive = no
set_revolution_target = #use ROOT, tag, FROM, etc.  Can also use xxx to make it so that no country is the revolution target (i.e. set_revolution_target = xxx )
swap_free_idea_group = yes
switch_tag =

add_country_modifier = {
    name = _
    duration = 365
}

#hidden country modifier, usually name of modifier is something timer, i.e. roman_fever_timer
hidden_effect = {
    add_country_modifier = {
        name = _
        duration = 3650
        hidden = yes
    }
}

#Can add a description of the duration, such as "the 18th century"
#Then (with a modifier titled "Prestige Loss") the tooltip will read "England will have Prestige Loss until the 18th century"
add_country_modifier = {
    name =
    duration = -1
    desc = "_"
}

country_event = { id = _ }
country_event = { id = _ tooltip = _ }
country_event = { id = _ days = 3 }
#Example event using all 3
country_event = { id = flavor_fra.3004 days = 10 tooltip = "flavor_fra.EVTTOOLTIP3002" }
#Not sure what random does here, I believe it randomizes the amount of days that it will take for the event to fire, but I haven't confirmed this yet
country_event = {
    id = _
    days = 1
    random = 5
}
#Example of all being used from flavorBOH events
country_event = {
    id = flavor_boh.3
    days = 2500
    random = 100
    tooltip = flavor_boh.2.3
}

change_price = {
    trade_goods =
    key =
    value =
    duration = -1
}
#Value is a modifier, so a value of 0.2 would increase the price of the good by 20%
#Can also have duration be the number of days it lasts until expiring

#The on_trigger is the trigger/left side argument, and each set of brackets below represent a left side argument for that trigger.
#Allows you to cut down on your IF brackets by applying a specific effect to each left side argument
#Kind of hard to explain, see the example below
trigger_switch = {
    on_trigger =
 
}
#Example
trigger_switch = {
    on_trigger = technology_group
    western = { set_variable = { which = test value = 1 } }
    eastern = { set_variable = { which = test value = 2 } }
    scandinavian_tech = { set_variable = { which = test value = 3 } }
    muslim = { set_variable = { which = test value = 4 } }
    indian = { set_variable = { which = test value = 5 } }
}

while = {
    limit = {
        check_variable = { which = variable_name value = 1 }
    }
    subtract_variable = { which = variable_name value = 1 }
    add_treasury = 5
}
#The while effect will not produce any tooltip. Also make sure you don't create an endless loop ( although there is a fail-safe at 100K loops)

#############################
# Adjust Values
#############################
add_adm_power = -50
add_corruption = 1
add_dip_power = -50
add_faction_influence = { faction = _ influence = 5 }
add_horde_unity = 5
add_inflation = 5
add_imperial_influence = 10
add_legitimacy = 10
add_liberty_desire = 5
add_mercantilism = 5
add_militarised_society = 20
add_mil_power = -50
add_prestige = -5
add_republican_tradition = -10
add_scaled_imperial_influence = 10 #Not sure of the difference between this and the regular adding of imperial influence
add_scaled_republican_tradition = -0.10 #Scaled to the country's election cycle
add_stability = -1
add_tariff_value = 0.05
add_treasury = 100
add_war_exhaustion = -10
add_westernisation = 1
add_years_of_income = 0.25
change_statists_vs_orangists = 0.25

#############################
# Advisors
#############################
create_advisor = #advisor type
kill_advisor = #random, type of advisor, probably can also use specific advisor id, I'm guessing kill advisor completely removes from game
remove_advisor = #random, type of advisor, probably can also use specific advisor id, I'm guessing remove advisor just puts advisor back in the pool.

define_advisor = {
    type =
    name = "_"
    skill = 2
}

#As of 1.11 we can now make female advisers
female = yes

#Can make an adviser cheaper with discount = yes
define_advisor = {
    type = 
    skill = 2
    discount = yes
}

#Can also add location of advisor home province, location = is the desired province id
#Example
define_advisor = {
    type = spymaster
    name = "Francis Walsingham"
    location = 235
    skill = 3
}

#############################
# AI Effects
#############################
add_ai_strategy = #never found in code
fixed_ai_strategy = #never found in code
rebuild_ai_attitudes = #never found in code
rebuild_ai_priorities = #never found in code

set_ai_personality = {
    personality =
    locked = yes/no
}

set_ai_attitude = {
    attitude =
    who =
    locked = yes/no
}

#############################
# Diplomatic - most accept TAG, ROOT, FROM, PREV, etc
#############################
add_historical_friend =
add_historical_rival =
add_opinion = { who = _ modifier = _ } #Adds an opinion modifier of the who = to the scope country
add_spy_network_from = { who = _ value = 25 }
add_spy_network_in = { who = _ value = -25 }
add_truce_with =
break_marriage =
break_union =
create_alliance =
create_guarantee =
create_march =
create_marriage =
create_protectorate =
create_union =
declare_war =
free_vassal = #never found in code
form_coalition_against =
inherit =
join_league =
leave_league =
release =
release_all_subjects = yes
release_vassal =
remove_fow = 3 #Remove Fog of War, not sure what the number is, maybe number of months
remove_historical_friend =
remove_historical_rival =
reverse_add_opinion = { who = _ modifier = _ } #Adds an opinion modifier of the scope country to the who =
vassalize =
white_peace =

#Gives the scope country a CB against the target
add_casus_belli = {
    target =
    type =
    months = 1825
}

#Gives the target a CB against the scope country
reverse_add_casus_belli = {
    target =
    type =
    months = 12
}

remove_casus_belli = {
    type =
    target =
}
#can also use reverse
reverse_remove_casus_belli

#Can also add a time frame on the opinion modifier
add_opinion = {
    who =
    modifier =
    years = 50
}

remove_opinion = {
    who =
    modifier =
}

reverse_remove_opinion = {
    who =
    modifier =
}

#Use a CB to declare war, who = the target (use tag, ROOT, etc) and casus_belli = the CB used
declare_war_with_cb = {
    who =
    casus_belli =
}

#Reverse effects are good for random country diplomacy
#Example
random_country = {
    limit = { is_neighbor_of = ROOT }
    reverse_add_casus_belli = {
        target = ROOT
        type = cb_insult
        months = 12
    }
}

#############################
# Estates, Factions, Parliaments, and Disasters
#############################
add_disaster_modifier = { name = key disaster = disaster_key duration = x }
add_disaster_progress = { disaster = _ value = _ }
add_faction = #name of faction
create_independent_estate = #name of estate
create_independent_estate_from_religion = #name of estate
dissolve_parliament = yes #Removes the Parliament mechanic from the country
end_disaster = #disaster name
reinstate_parliament = yes #Re-adds the Parliament mechanic to a country that had it dissolved
remove_faction = #name of faction

add_estate_influence_modifier = {
    estate =
    desc =
    influence = -10
    duration = 3650
}
add_estate_loyalty = {
    estate =
    loyalty = -15
}
add_estate_loyalty_modifier = {
    estate =
    desc =
    loyalty = 10
    duration = 7300
}

#############################
# HRE
#############################
add_hre_emperor_modifier =
add_hre_member_modifier =
dismantle_hre = yes
elector = #Grants elector status
enable_hre_leagues = yes
hre_inheritable = yes
imperial_ban_allowed = yes
internal_hre_cb = no
remove_hre_emperor_modifier =
remove_hre_member_modifier =
revoke_reform = #never found in code
set_allow_female_emperor = yes
set_hre_heretic_religion =  #name of religion
set_hre_religion = #name of religion
set_hre_religion_locked = yes
set_hre_religion_treaty = yes
set_in_empire = no #No will remove all scope's provinces from the empire, yes will add all scope's provinces

#############################
# Military
#############################
add_army_tradition = 10
add_manpower = -8   #can also be a decimal
add_navy_tradition = 10
add_sailors = 1000
add_yearly_manpower = -0.25
add_yearly_sailors = 1.5
change_unit_type =
create_admiral = 10
create_conquistador = 5
create_explorer = 5
create_general = 10
kill_leader = { type =  } #general, admiral, conquistador, explorer, random, or specific name

#As of 1.12, leaders no longer have to have a name
define_admiral = {
    name = "_"
    shock = 4
    fire = 4
    manuever = 5
}

define_conquistador = {
    name = "_"
    fire = 3
    shock = 3
    manuever = 3
    siege = 1
}

define_explorer = {
    name = "_"
    fire = 2
    shock = 2
    manuever = 6
    siege = 0
}

define_general = {
    name = "_"
    fire = 3
    shock = 3
    manuever = 3
    siege = 1
}

#Can add this to make a leader female
female = yes

#Add Units- can use province id, i.e. cavalry = 236
#Although vanilla uses unit_type = capital (i.e. infantry = capital) this effect is bugged and doesn't work properly.
artillery =
cavalry =
galley =
heavy_ship =
infantry =
light_ship =
transport =

#Can also add specific units with specific_unit_name = province_id
british_redcoat = 236
twodecker = 236

#The following allows you to build mercenary units- can use province id
mercenary_cavalry = 236
mercenary_infantry =  236

#############################
# Province Effects (Country Scope)
#############################
#Can probably also use tag, ROOT, PREV, etc. with these, not tested for all of them though
add_claim = #province id
add_core = #province id
add_territorial_core = #province id
discover_province = #province id, Confirmed by AKronblad that PREV works here
remove_core = #province id
remove_territorial_core =  #province id
set_capital = #province id
undiscover_province = #province id

#############################
# Random
#############################
#one use for random effects is to put in the immediate = { } for randomness, and then have options play off it
random = {
    chance = 50
    #Effect Here
}

random_list = {
    25 = {

    }
    25 = {

    }
    25 = {

    }
    25 = {

    }
}

#############################
# Religion
#############################
add_authority = 5
add_church_aspect = #Aspect's name
add_church_power = 20
add_devotion = 10
add_doom = -5
add_fervor = 10
add_karma = 10
add_papal_influence = 1
add_patriarch_authority = 0.25  #this is a percentage
add_piety = 0.1
add_reform_desire = 0.01 #this is a percentage
change_personal_deity = #deity's name
change_religion =
enable_religion =  #religion name
excommunicate = #ROOT, TAG, FROM, PREV, etc, if target is already excommunicated then it will be ended
force_converted = yes
remove_church_aspect = #Aspect's name or random
remove_religious_reforms = 2
set_karma = 10
set_papacy_active = no

#############################
# Ruler and Heir
#############################
add_heir_claim = -20
add_heir_personality = #personality name
add_heir_support = 10
add_queen_personality = #personality name, does not have a tooltip
add_ruler_personality = #personality name
change_adm = 1
change_dip = 1
change_mil = 1
change_consort_regent_to_ruler = yes
change_heir_adm = 1
change_heir_dip = 1
change_heir_mil = 1
clear_scripted_personalities = yes #Removes all ruler personalities. Does not remove heir or consort personalities
clr_consort_flag =
clr_heir_flag =
clr_ruler_flag =
convert_female_ruler_to_general = yes
convert_female_heir_to_general = yes
convert_heir_to_general = yes
convert_ruler_to_general = yes
exile_heir_as = #unique text string, similar to flags.  Also like flags, we can use dynamic strings with @ROOT, TAG, FROM, PREV, etc.
exile_ruler_as = #unique text string, similar to flags.  Also like flags, we can use dynamic strings with @ROOT, TAG, FROM, PREV, etc.
kill_heir = yes
kill_ruler = yes
remove_consort = yes
remove_heir = yes
remove_heir_personality = #personality name
remove_queen_personality = #personality name, does not have a tooltip
remove_ruler_personality = #personality name
set_dynasty = #set dynasty without killing the ruler. Can use tags and a specific dynasty, probably ROOT, FROM, PREV, etc as well
set_consort_flag =
set_heir = #unique text string previously set with the exile_heir_as effect.
set_heir_flag =
set_ruler = #unique text string previously set with the exile_ruler_as effect. Setting a ruler will remove any existing heir
set_ruler_flag =

#Ruler modifiers last until the ruler's death.  Can use either of the two formats below, the -1 duration isn't needed.
add_ruler_modifier = { name = _ }
add_ruler_modifier = {
    name = "_"
    duration = -1
}

#Could also be a specific dynasty or FROM if fired from someone else's event, could also use THIS and PREV
#Can also just define one or two ruler stats, leaving rest up for chance
define_heir = {
    claim = 100
    dynasty = ROOT
    name = "Alexander"
    adm = 3
    dip = 3
    mil = 3
}
#Can use fixed = yes to make those numbers the heir's exact stats

#As of 1.4 can now set the age of heir #Tested and confirmed by AKronblad
define_heir = {
    claim = 100
    dynasty = ROOT
    name = "Louis"
    adm = 3
    dip = 3
    mil = 3
    age = 12
}

#Setting heir birth date
define_heir = {
    adm = 1
    dip = 2
    mil = 1
    birth_date = 1440.2.22
}

#Add this to ensure that the heir is male
define_heir = {
    male = yes
}

#Add this for a female heir
define_heir = {
    female = yes
}

#Can hide the stats of the new heir
define_heir = {
    hidden = yes
}

#These were added in 1.18
define_heir = {
    dynasty = original_dynasty
    max_random_adm = 5
    max_random_dip = 5
    max_random_mil = 5
}

#Adding this ensures that a consort isn't spawned with the heir (ex. the Child in the Reeds event)
define_heir = {
    no_consort_with_heir = yes
}

define_heir_to_general = {
    fire = 4
    shock = 4
    manuever = 3
    siege = 1
}

#Random but numbers must be at least this high
define_ruler = {
    adm = 1
    dip = 1
    mil = 1
}

#fixed = yes means that these are the exact numbers of the ruler
define_ruler = {
    mil = 1
    adm = 4
    dip = 1
    fixed = yes
}

#As of 1.4 can now set the age of a ruler
define_ruler = {
    adm = 2
    dip = 1
    mil = 2
    age = 28
}


#As of 1.10 can now set starting legitimacy of the ruler
define_ruler = {
    adm = 2
    dip = 1
    mil = 2
    claim = 75
}

#Can also set a regency council
define_ruler = {
    regency = yes
}

#For dynasty, can use specific name, ROOT, FROM, PREV, TAG, etc.
#When using dynasty with a republic it will determine the ruler's surname
define_ruler = {
    dynasty = "Habsburg"
    DIP = 5
    ADM = 3
    MIL = 3
}

#Example of turning a current military leader into a ruler
define_ruler = {
    name = "Andrea Doria"
    dynasty = "Doria"
    DIP = 5
    ADM = 5
    MIL = 5
    attach_leader = "Andrea Doria"
}

#Example of making a leader the regent
define_ruler = {
    name = "(Regent) János"
    dynasty = "Hunyadi"
    DIP = 5
    ADM = 4
    MIL = 5
    regency = yes
    attach_leader = "János Hunyadi"
}

#These were added in 1.18
define_ruler = {
    dynasty = original_dynasty
    max_random_adm = 5
    max_random_dip = 5
    max_random_mil = 5
}

define_ruler_to_general = {
    fire = 4
    shock = 4
    manuever = 3
    siege = 1
}

#Make a leader into the ruler
define_leader_to_ruler = {
    type =
    claim =
}
#Type- can use general and conquistador, assuming that admiral and explorer can also be used
#Can also use the properties fixed/ADM/DIP/MIL, just as in define_ruler, or name instead of type to use a specific leader

define_consort = {
    name = ""
    country_of_origin =
    dynasty = ""
    adm = 3
    dip = 3
    mil = 3
    female = yes
}
#country_of_origin can be a tag, scope, or event target.  Not including this represents domestic spouse
#Can use fixed = yes like with rulers and heirs

#############################
# Variables
#############################
change_variable = { which = _ value = 1 }
divide_variable = { which = _ value = 2 }
multiply_variable = { which = _ value = 2 }
set_variable = { which = _ value = 1 }

#Variable effects and triggers can now take a second variable as an argument, can also use OWNER
#Example from Captain Gars
set_variable = { which = var1 value = 5 } # var1 = 5
set_variable = { which = var2 which = var1 } # var2 = 5
change_variable = { which = var2 value = 2 } # var2 = 7
multiply_variable = { which = var1 which = var2 } # var1 = 35
divide_variable = { which = var1 value = 2 } # var1 = 17.5
subtract_variable = { which = var1 which = var2 }

#Variable effects and triggers can now take a scope as an argument
#Example from Captain Gars
multiply_variable = { which = var1 which = FROM }

export_to_variable = {
    which =
    value =
}

#Examples
export_to_variable = {
    which = prestigeVar
    value = prestige
}
export_to_variable = {
    which = stabilityVar
    value = stability
    who = FROM
}
export_to_variable = {
    which = productionEfficiencyVar
    value = modifier:production_efficiency
}
export_to_variable = {
    which = borderDistanceVar
    value = borderDistance
    who = FRA
}
#Allowed arguments for which

#Country
prestige
war_exhaustion
manpower
manpower_percentage
max_manpower
states_development
average_autonomy
average_home_autonomy
corruption
stability
treasury
land_forcelimit
naval_forcelimit
average_unrest
num_of_cities
army_tradition
navy_tradition
mercantilism
overextension_percentage
inflation
num_of_ports
patriarch_authority
piety
religious_unity
ADM
DIP
MIL
heir_adm
heir_dip
heir_mil
tolerance_to_this
trade_income_percentage
years_of_income
monthly_income
army_size
navy_size
adm_tech
dip_tech
mil_tech
border_distance
capital_distance
consort_adm
consort_dip
consort_mil
+ all global modifiers

#Province
province_trade_power
local_autonomy
base_manpower
base_production
base_tax
development
unrest
nationalism
tolerance_to_this
+ all local modifiers

#############################
# Province Effects (Province Scope)
#############################
##
#Changes in Province
##
add_base_manpower = 1
add_base_production = 1
add_base_tax = 1
add_building =  #Building name
add_construction_progress = -0.05 #have only seen this used for great projects
add_core_construction #Unsure of format, probably use "yes" as a right side argument
add_culture_construction = #probably uses "yes"
add_great_project = #specific name
add_local_autonomy = 10
add_scaled_local_adm_power = #Gives adm power based on base tax, so 0.5 would give 4 with 8 tax and 1.0 would give 8
add_scaled_local_dip_power = #Gives dip power based on base production, so 0.5 would give 4 with 8 production and 1.0 would give 8
add_scaled_local_mil_power = #Gives mil power based on base manpower, so 0.5 would give 4 with 8 manpower and 1.0 would give 8
cancel_construction = yes #have only seen this used for great projects
change_culture =  #Can use owner, specific culture, ROOT, FROM, PREV, or capital
change_province_name = #new name
create_advisor =  #adivisor type
remove_building = #building name
rename_capital = #new name
set_in_empire = no
set_local_autonomy = 25

add_building_construction = {
    building = name_of_building
    speed = 1 # 100% of original speed
    cost = 1 # 100% of original cost
}

add_institution_embracement = {
    which = ""
    value = 5
}

remove_loot = {
    who =
    amount = 5
}
#For the who you can use TAG, ROOT, FROM, PREV, enemy, ect.  Using enemy will divide the loot between all enemies present

##
#Colonial and Discovering
##
add_colonysize = 200
change_native_ferocity = -1
change_native_hostileness = -1
change_native_size = -3
create_colony = 200 #As of 1.4 this now takes the actual number of settlers
discover_country =  #discovers the provinces of the scope for the said country (i.e. ROOT, tag, etc)
multiply_colonysize = 0.5
undiscover_country = #undiscovers the provinces of the scope for the said country (i.e. ROOT, tag, etc)

##
#Control, Claims, and Cores
##
add_claim =
add_core =
add_permanent_claim =
add_territorial_core =
cede_province = #TAG, FROM, ROOT, THIS, PREV, previous_owner
change_controller =
change_siege = 20
remove_claim =
remove_core =
remove_territorial_core =

##
#Estates and Parliament
##
back_current_issue = #yes or no
remove_estate = #tooltip doesn't work, states that the province will get the estate
set_estate = #tooltip doesn't show correct influence gain
set_seat_in_parliament = yes #yes or no

##
#Flags, Modifiers, and Events
##
clr_province_flag =
province_event = { id = _ }
remove_province_modifier =
set_province_flag =

add_province_modifier = {
    name = "_"
    duration = 365
}

add_permanent_province_modifier = {
    name =
    duration = -1
}

##
#Military
##
kill_leader = #general, admiral, conquistador, explorer, random, or specific name.  Won't do anything if the leader isn't in the province

kill_units = {
    who =
    type =
    amount =
}
#who = enemy, TAG, ROOT, PREV, FROM, controller, or owner
#type = infantry, cavalry, artillery, ship type, or specific unit
#type is not needed, if not included will default to all

#Add Units, can use specific unit, tag, ROOT, etc.
artillery =
cavalry =
galley =
heavy_ship =
infantry =
light_ship =
transport =

#Can also add specific unit types
british_redcoat = #ROOT, THIS, PREV, FROM, etc
twodecker = #ROOT, THIS, PREV, FROM, etc

#The following allows you to build mercenary units.
mercenary_cavalry = #ROOT, PREV, FROM, TAG, THIS. Specific unit names don't work
mercenary_infantry =  #ROOT, PREV, FROM, TAG, THIS. Specific unit names don't work

#type = specific unit name, infantry, cavalry, light ships, etc.
#amount = how many, speed = how fast they will recruit (percentage of normal rate), cost = how much they will cost
add_unit_construction = {
    type =
    amount = 20
    speed = 0.25
    cost = 0
}
#Can also construct mercenary units by adding the following to add_unit_construction
mercenary = yes

#builds this percentage of forcelimit in the province scope
build_to_forcelimit = {
    infantry = 0.6
    cavalry = 0.3
    artillery = 0.1
}
#Same thing with ships
random_owned_province = {
    limit = {
        has_port = yes
    }
    build_to_forcelimit = {
        heavy_ship = 0.3
        light_ship = 0.3
        transport = 0.2
        galley = 0.2
    }
}

#Removes loot from the province
remove_loot = {
    who =
    amount = 5
}
#who = can use enemy to divide the loot up between all enemy countries present in the province (as vanilla does)
#Or you can use a specific tag to give the loot just to that tag.  I'm assuming that we can also use scopes, but this will need to be tested

##
#Religion
##
add_cardinal = yes
add_reform_center = #name of religion
change_religion =  #Can use owner, specific religion, ROOT, FROM, PREV, an event target, or heretic (which will change it to a random heretic religion)
change_to_secondary_religion = yes
remove_cardinal = yes
remove_reform_center = #Name of religion
send_missionary = yes

##
#Revolts and Rebels
##
add_nationalism = 10 # Add ten extra years of nationalism
add_unrest = 10
create_native = 1
create_pirate = 1
create_revolt = 2
#Can also use a specific rebel name = 1 (size of rebellion) to create rebels
#Example
noble_rebels = 1

#Another way to spawn rebels, this was used as a random list effect
spawn_rebels = {
    type = _
    size = 2
}

#Can name rebel leader, good for pretender rebel (not sure if can do dynasty, maybe second name is dynasty, i.e. Jane Grey)
spawn_rebels = {
    type =
    size = 1
    leader = "_"
}
unrest = 15 #adds progress to the rebel faction
win = yes #to give the rebels control of the province
#Can also set if the rebel leader is a female (place after leader = )
female = yes

#Can set rebel friend (tag, ROOT, FROM, etc)
spawn_rebels = {
    type =
    size = 2
    friend =
}

##
#Trade
##
add_trade_node_income = 10 #Inside trade node scope
change_trade_goods =  #Trade good type
recall_merchant = #ROOT, FROM, tag, PREV, etc

#Set a trade modifier, don't know what key = means (maybe localization)
#Example
add_trade_modifier = {
    who = root
    duration = 7300
    power = 1
    key = control_of_famagusta
}

remove_trade_modifier = {
    who =
    name =
}

#Inside a region scope, you can apply effects to all the provinces of that region

#############################
# Unknown
#############################
negative_power = #Not found in code

#############################
# Code that doesn't work or has been removed
#############################
#add_province_manpower = 1 #removed as of 1.12
#add_revolt_risk
#culture_group_union = #Removed as of 1.14
#remove_core_from = #never found in code, doesn't work, likely an old remnant

 

Переводы некоторых статей по теме от @Semenar

Перевод Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.  - в теме: "Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

Перевод Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.  - в теме "Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое. "

 

Относящиеся к теме:

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

Спойлер

############################
# Localization Strings
############################

###
# Old Method (doesn't work in tooltips)
###
$CAPITAL$ #name of the capital region
$CAPITAL_CITY$ #name of the capital city
$CONTROLLERNAME$ #name of the country controlling the province
$COUNTRY$
$COUNTRY_ADJ$
$COUNTRYNAME$
$COUNTRY_RELIGION$
$CULTURE$
$DYNASTY$
$EMPERORNAME$
$ESTATE_NAMEOFESTATE$ #Example- $ESTATE_NOBLES$
$FROM$
$FROMCOUNTRY$
$GOOD$ #Trade good
$GOV$
$GOVT$
$HEIR$
$HEIR_DYNASTY$
$HEIR_ADJ$ #his/her
$HEIR_CAP_ADJ$ #His/Her
$HEIR_O_PRONOUN$ #him/her
$HEIR_S_PRONOUN$ #he/she
$HEIR_CAP_S_PRONOUN$ #He/She
$HEIRNAME$ #not sure of difference between this and regular $HEIR$
$LIKELYREBELS$
$LORD$ #Overlord
$MONARCH$
$MONARCHTITLE$
$OWNERNAME$
$PROVINCECAPITAL$
$PROVINCECULTURE$
$PROVINCENAME$
$RANDOM_OLD_MONARCH$
$RANDOM_OLD_WAR$
$RANK$ #government rank
$RANK1$ #name of government rank 1
$RANK2$ #name of government rank 2
$RANK3$ #name of government rank 3
$RELIGION_GROUP$
$RULER_ADJ$ #his/her
$RULER_S_PRONOUN$ #he/she
$TAG$
$YEAR$

\n #new line

###
# Icons
###
£adm£ #ADM power symbol
£dip£ #DIP power symbol
£mil£ #MIL power symbol
¤ # ducats icon
£artillery_icon_small£ # artillery icon
£cavalry_icon_small£ # cavalry icon
£infantry_icon_small£ # infantry icon
£icon_manpower£ #Manpower symbol
£icon_missionary£ # missionary icon
£icon_sailors£ # sailors icon
£yes£ # icon for conditions that are met (green ✓)
£no£ # icon for conditions that are not met (red X)
@TAG #Will show the flag of the country.  Can only use tags, not other scopes (e.g. ROOT)

###
# New Method (will work in tooltips)
###
#Can use Root, tag, From, This,
[Root.Culture.GetName] #Not found in code but confirmed to work by a fellow modder
[Root.Culture.GetGroupName]
[Root.GetCult]
[Root.GovernmentName]
[Root.Heir.GetName]
[Root.Heir.Dynasty.GetName]
[Root.Heir.GetHerHim]
[Root.Heir.GetHerHis]
[Root.Heir.GetHerselfHimself]
[Root.Heir.GetSheHe]
#[Root.Heir.GetWomanMan] #This one doesn't work for some reason
[Root.GetName]
[Root.GetAdjective]
[Root.Monarch.GetName]
[Root.Monarch.Dynasty.GetName]
[Root.Monarch.GetTitle]
[Root.Monarch.GetHerHim]
[Root.Monarch.GetHerHis]
[Root.Monarch.GetHerHisCap]
[Root.Monarch.GetHerselfHimself]
[Root.Monarch.GetSheHe]
[Root.Monarch.GetWomanMan]
[Root.Monarch.GetAdm]
[Root.Monarch.GetDip]
[Root.Monarch.GetMil]
[Root.Capital.GetName]
[Root.Capital.GetCapitalName]
[Root.Capital.Religion.GetName]
[Root.Owner.Capital.GetCapitalName]
[Root.Owner.Monarch.GetName]
[Root.Owner.Religion.GetName]
[Root.Religion.GetName]
[Root.variable_name.GetName] #can use scopes, tags, and event targets
[Root.variable_name.GetValue] #can use scopes, tags, and event targets

#Examples of other uses
[From.Monarch.GetName]

#Can call farther back
[From.From.Capital.GetCapitalName]
[From.From.From.Capital.GetCapitalName]

#Added in 1.4
[GetDate]
[GetDateText]
[GetMonth]
[GetWomanMan]
[GetYear]

###
# Color of text
###
§b #Black
§B #Blue
§G #Green
§R #Red
§W #White
§Y #Yellow
§M #Light Blue
§g #Grey
§T #Turquoise
§l #Lime Green
§O #Orange
§! #Return to the default color text

###
# Advisors
###
#Advisors are just capitalized
#Examples
$ARTIST$
$THEOLOGIAN$
$TREASURER$
$STATESMAN$

#Pronouns
$INQUISITOR_ADJ$ #his/her
$INQUISITOR_CAP_ADJ$ #His/Her
$INQUISITOR_PRONOUN$ #him/her
$INQUISITOR_S_PRONOUN$ #he/she
$INQUISITOR_CAP_S_PRONOUN$ #He/She

 

Относящиеся к моддингу в целом, которые могут быть полезны:

 

Спойлер

New Script Features
- Culture & culture groups now have modifiers for country & province.
- Subject type rules can now be modified through script (common/subject_types/).
- Added customizable localization.
- "yesman" console command now only works when the sender of the action is the player.

Effects
- Added an 'add_absolutism = x' effect.
- Added 'every_province_in_state = {}' & 'random_province_in_state = {}' effects.
- Added create_subject effect.
- Added add_isolationism (= value) effect.
- Added set_isolationism (= value) effect.
- Added add_incident_variable_value (= { incident = incidentname value = [value] }) effect.
- Added set_incident_variable_value (= { incident = incidentname value = [value] }) effect.
- Added add_harmonized_religion = religion effect.
- Added add_trust effect with optional mutual = yes (Example add_trust = { who = JAP value = 10 mutual = yes}).
- Added remove_advisor_by_category effect. (=ADM, =DIP, =MIL)

Triggers
- Added if trigger.
- Added support for "else" inside the if trigger.
- Added 'any_province_in_state = {}' & 'all_province_in_state = {} 'triggers.
- Added trigger-scope 'all_state_province = {}'
- Added trigger 'current_age = x'
- Added trigger 'num_of_continents = x'
- Added trigger 'has_age_ability = <ability>'
- Added trigger 'splendor = x'
- Added effect 'add_splendor = x'
- Added a 'num_accepted_cultures = x' trigger.
- Added a 'absolutism = x' trigger.
- Added a new trigger 'has_unified_culture_group = yes/no'
- Added a new trigger 'has_commanding_three_star = yes/no'
- Added a new trigger 'num_of_owned_and_controlled_institutions = x'
- Added uses_isolationism (= yes/no) trigger.
- Added isolationism (= value) trigger.
- Added incident_variable_value (= { incident = incidentname value = [value] }) trigger.
- Added is_incident_potential (= incidentname) trigger.
- Added is_incident_active (= incidentname) trigger.
- Added is_incident_happened (= incidentname) trigger.
- Added is_incident_possible (= incidentname) trigger.
- same_continent trigger can be used to check if two provinces are on the same continent. Countrytags will automatically evaluate as their capital.
- Added is_subject_of_type, can_create_subject_of_type triggers.
- Added triggers any_state & all_states, which checks first province in a state for all states
- Added in_golden_age = yes/no trigger.
- Added num_of_banners = x trigger.
- Added num_of_harmonized = x trigger.
- owns_or_vassal_of trigger renamed to more correct owns_or_subject_of. Old trigger still maps to the new one for compatiblity.
- Added owns_or_non_sovereign_subject_of trigger, excluding Tributaries.
- country_or_vassal_holds trigger renamed to more correct country_or_subject_holds. Old trigger still maps to the new one for compatiblity.
- Added country_or_non_sovereign_subject_holds trigger, excluding Tributaries.

Modifiers & Rules
- Added new country modifier 'claim_duration' which affects duration of claims.
- Added new country modifer 'placed_merchant_power'
- Added new country modifier 'ship_power_propagation'
- Added new country modifier 'institution_spread_from_true_faith'
- Added new country modifier 'prestige_per_development_from_conversion'
- Added a new country modifier 'administrative_efficiency'
- Added a new country modifier 'local_years_of_nationalism'
- Added a new country modifier 'core_decay_on_your_own'
- Added a new country modifier 'autonomy_change_time'
- Added a new country modifier 'rival_change_cost'
- Added a new country modifier 'rival_border_fort_maintenance'
- Added a new country modifier 'harsh_treatment_cost'
- Added a new country modifier 'reduced_liberty_desire_on_same_continent'
- Added a new country modifier 'backrow_artillery_damage'
- Added a new country modifier 'enforce_religion_cost'
- Added a new modifier called 'liberty_desire_from_subject_development'.
- added new modifiers: war_taxes_cost_modifier, siege_blockade_progress, warscore_cost_vs_other_religion, mercenary_discipline country scope modifiers.
- Added modifier artillery_bonus_vs_fort = x.
- Added monarch_admin_power modifier, adding admin power to future monarchs and Consorts from that country.
- Added monarch_diplomatic_power modifier, adding diplomatic power to future monarchs and Consorts from that country.
- Added monarch_military_power modifier, adding military power to future monarchs and Consorts from that country.
- Added meritocracy modifier, adding yearly meritocracy
- cav_to_inf_ratio is no longer a techgroup variable, but a normal modifier.

- Added new province modifier 'religious_conversion_resistance' which increases resistance to conversion from reformation centers.
- Added a local_monthly_devastation modifier.

- Added new rules can_bypass_forts, ignore_coring_distance, force_march_free.
- Added new rules can_chain_claim,free_maintenance_on_expl_conq, can_colony_boost_development & attack_bonus_in_capital_terrain.
- Split local_movement_speed into local_friendly_movement_speed & local_hostile_movement_speed.

Misc
- Big performance improvement to script defined variables.
- Export to variable now takes average_autonomy_above_min, average_effective_unrest, num_of_rebel_armies, num_of_rebel_controlled_provinces.
- on_province_owner_change's scope now has the previous owner as FROM scope.
- "create_march" and "vassalize" effects now properly clear alliances etc.
- Lots of refactoring on how subjecttypes are checked through script.
- Checking num_of_(subject type) can now be done by putting vassal type = (num of vassals). Tributary = 2 would check that the country has at least 2 tributaries.
- Added skill_scaled_modifier to advisor types that get multiplied by their skill level.
- Added MIN_ASKED_TRADE_POWER and MAX_ASKED_TRADE_POWER to defines. These control the minimum and maximum amount of trade power than can be asked from another country peacefully.
- Added "mandate" console command (adds mandate to Emperor of China).
- Added "tributary", "make_subject" console cmds.
- Moved Prussian Government monarch military power bonus to Prussian Monarchy rank modifiers
- GUI files now support if_resolution = { [...] } for moving/changing stuff depending on the resolution.
- Can now use primary culture, religion, religious group as prefix for event pictures.
- Added FORM_MARRIAGE_HIGHER_PRESTIGE to defines for legitimacy change on royal marriage.
- Added FORM_MARRIAGE_HIGHER_LEGITIMACY to defines for legitimacy change on royal marriage.

.

Изменено пользователем Kassatka
Поправлены слетевшие спойлеры
Ссылка на комментарий

Дмитрий Казак

Очень познавательно! Спасибо, такой вопрос: что такое set_country_flag в евентах? Как создать собственные, просто прописав что-нибудь сталкиваюсь с тем что событие перестает работать.

Ссылка на комментарий

Iamneo94
10 часов назад, Дмитрий Казак сказал:

Очень познавательно! Спасибо, такой вопрос: что такое set_country_flag в евентах? Как создать собственные, просто прописав что-нибудь сталкиваюсь с тем что событие перестает работать.

 

Как выглядит, тем и является: устанавливается по сути триггер, который можно использовать в других ивентах, решениях, скриптах и т.п.

 

Возьмем актуальный пример, ну старт англиканской реформации (вырезано ненужное)

 

Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

 

Ивент очевидно не произойдет, если английская реформация уже стартовала и установлен флаг had_anglican_question (в данном случае это по сути замена fire_only_once = yes)

 

Бывают намного более сложные вещи, например ивенты и миссии Бургундии, например Мария Бургундская может стать наследницей, только если стартует скрытый модификатор (он начнется после смерти 1-го правителя) burgundian_succession_crisis, и она же запускает скрытый флаг burgundian_succession_start.

(incident/Incident_Burgundian_Inheritance.txt)

Изменено пользователем Iamneo94
Ссылка на комментарий

Дмитрий Казак
Войдите или зарегистрируйтесь, чтобы увидеть скрытое содержимое.

Например я хочу создать "had_spanish_question"  - реформация в Испании. 

 

Ссылка на комментарий

Всем привет, я бы хотел узнать можно ли сделать так что бы выпадал один из нескольких эффектов.

Например:

Выпадает ивент и у него есть 3 эффекта: 

+50 монет

-50 монет

+50 админки

И мне нужно что бы выдавался один из трёх эффектов с одинаковым шансом без возможности выбора игроком или ИИ.

 

Изменено пользователем nyn_wupa
Ссылка на комментарий

Присоединиться к обсуждению

Вы можете оставить комментарий уже сейчас, а зарегистрироваться позже! Если у вас уже есть аккаунт, войдите, чтобы оставить сообщение через него.

Гость
Ответить в тему...

×   Вы вставили отформатированное содержимое.   Удалить форматирование

  Only 75 emoji are allowed.

×   Ваша ссылка автоматически преображена.   Отображать как простую ссылку

×   Предыдущее содержимое было восстановлено..   Очистить текст в редакторе

×   You cannot paste images directly. Upload or insert images from URL.

  • Сейчас на странице   0 пользователей

    • Нет пользователей, просматривающих эту страницу


Copyright © 2008-2024 Strategium.ru Powered by Invision Community

×
×
  • Создать...