-
Notifications
You must be signed in to change notification settings - Fork 17
International Situations
Situations are meant to model clashes between factions on an international scale. They can have multiple journal entries associated with it and provide a tool to model complex power struggles.
These are implemented as contextless journals in the je_group_global_international_situations journal group. CMF's International Situation Framework seeks to aid this by providing a custom journal entry widget and some supporting effects. This takes advantage of the ability to inject widgets into journal entries as of V3 patch 1.13.
This framework consists of the following features:
- Modification to the outliner to add support for Situation journals
- Addition of variable checks to hide various elements from journal entries
- Custom injectable journal widgets that combine the design of V3 journals, CK3 struggles, and EU5 situations
This framework takes advantage of the partitioning of the outliner journal pins provided by the International Organizations Framework.
This section displays any pinned journal entry groups that are included in the com_international_situation_journal_groups global list. The group je_group_global_international_situations is automatically added to this list.
This framework takes advantage of the International Organizations Framework's variable checks to hide/modify certain elements of the journal entry panel by setting variables on the journal entry scope.
-
com_header_varto replace the journal sub-header with a flag variable -
com_hide_timeoutto hide the timeout timer and effects -
com_hide_status_descto hide the status desc -
com_hide_scripted_buttonsto hide the scripted buttons -
com_hide_journal_reasonto hide the journal _reason -
com_hide_involved_countriesto hide the involved countries -
com_hide_complete_triggersto the hide the journal completion triggers/effects -
com_hide_fail_triggersto the hide the journal failure triggers/effects -
com_hide_modifiersto the hide the journal modifiers
This framework is centered on a custom journal widget that combines features from the CK3 Struggle GUI and EU5 Situations GUI with the V3 journal entry. This is injected like any other journal entry widget. The effect com_hide_all_journal_elements_for_situation_effect is provided to hide all journal entry elements to avoid collisions with the widget. The following features are included:
- Small header textbox at the top of the widget that accepts a flag variable
- Rectangular illustration widget that accepts a custom background texture (inspired by EU5 situations)
- Situation phase UI element that allows for displaying phase information (inspired by CK3 struggles)
- Collapsible container that shows involved countries with an option secondary container for "Interloper" countries (derived from the IO framework)
- Scripted button container from the IO framework
- Collapsible container that displays the potential outcomes of the journal entry (inspired by CK3 struggles)
- Toggleable containers that display progress towards phases and their factors (inspired by CK3 struggles)
To use these widgets, you must inject them using one of the journal anchor points available since V3 patch 1.13. It is recommended to inject these widget into the custom_widget_container_je_icon anchor point. This anchor point removes the default journal icon. We also provide a scripted effect to hide all other journal elements.
First, you will need to inject the widget by placing this into your journal entry script:
widget = {
gui = "gui/com_journal_injects/situation_widgets.gui"
name = "widget_com_international_situation"
container = "custom_widget_container_je_icon"
}
Second, you will need to run this in the immediate of your contextless journal:
immediate = {
scope:journal_entry = {
com_hide_all_journal_elements_for_situation_effect = yes
}
}
The elements of the situation widget are also packaged as standalone widgets for injection in various journal anchors. The widget names are:
-
widget_com_international_situation_illustrationSituation Illustration -
widget_com_international_situation_phase_informationSituation Phase Information -
widget_com_international_situation_involved_countriesSituation Involved Countries -
widget_com_international_situation_outcome_containerSituation Outcomes -
widget_com_international_situation_phase_progressSituation Phase Process
All elements of widget_com_international_situation are completely optional. The core journal entry mechanics are unchanged by this framework so the underlying journal logic such as complete/fail trigger and any pulses will work as expected. The activation of the widget's elements are driven by a system of variables set on the journal scope.
This is a small header that appears at the very top of the widget. This is activated by setting com_situation_header_var on the journal. This variable expects a flag and will display the localization entry at the top of the widget.
This is a rectangular element inspired by the situations UI from EU5. This is activated by setting com_situation_illustration_var on the journal scope.
Usage is as follows:
-
com_situation_illustration_varexpects a savedig_trait:scope from which it will pull it's background. See/common/interest_group_traits/com_situation_illustrations.txtfor some pre-made traits with working backgrounds. - The start date of the struggle can be displayed on the upper right of the illustration box. This is activated by setting both
com_situation_start_month_varandcom_situation_start_year_varon the journal scope.com_situation_start_month_varexpects a flag variable whilecom_situation_start_year_varexpects an integer value. Both must be set for this element to appear. The effectscom_situation_start_date_today_effectandcom_set_situation_start_date_effectare provided to streamline this process.
Note: We recommend that your custom illustration be at 520x200 resolution
This element is inspired by the CK3 phase information element. This is activated by setting both com_situation_phase_icon_var and com_situation_phase_name_var on the journal scope.
Usage is as follows:
-
com_situation_phase_icon_varexpects a text icon that is scaled to fit the UI element -
com_situation_phase_name_varexpects a flag variable - The "Phase Effects" container use the
[JournalEntry.GetTimedModifiers]datamodel; remember that contextless journal modifiers flow down to all involved countries
This small container displays the journal timeout timer and also provides a small textbox. This can be activated by setting com_involvement_status_var on the journal scope. Usage is as follows:
- The timer will only be present if
JournalEntry.CanTimeOutreturns true -
com_involvement_status_varexpects a flag variable
This container implements the base game journal entry flavor text contianer. This is activated by setting com_situation_reason_var on the journal scope. com_situation_reason_var expects a flag variable.
This container contains three dynamicgridbox elements that display participating countries. Usage is as follows:
- The first is always active and uses the
[JournalEntry.GetInvolvedCountries]datamodel - The second can be activated by populating the variable list
com_situation_involved_liston the journal scope; this will hide the first container and serves to mimic the involvement list for country-scope journals - The third can be activated by populating the variable list
com_situation_interloper_liston the journal scope.
This element contains three (3) widgets for displaying the potential outcomes of the situation. Each one of these corresponds the complete, fail, and timeout blocks of the journal entry and will display the corresponding autogen trigger and effect text as a tooltip. Both the names and textures of each outcome element are customizable.
Usage is as follows:
-
com_situation_complete_name_varexpects a flag variable with the localization of thecompleteoutcome -
com_situation_complete_illus_varexpects a saved IG trait scope from which it will pull it's background. -
com_situation_timeout_name_varexpects a flag variable with the localization of thetimeoutoutcome -
com_situation_timeout_illus_varexpects a saved IG trait scope from which it will pull it's background. -
com_situation_fail_name_varexpects a flag variable with the localization of thefailoutcome -
com_situation_fail_illus_varexpects a saved IG trait scope from which it will pull it's background. See/common/interest_group_traits/com_situation_illustrations.txtfor some pre-made traits with working backgrounds. Note: We recommend that your custom texture be at 160x200 resolution
This element contains four (4) sub-elements for displaying progress towards situation phases. These are activated by setting com_situation_group_$index$_next_phase_name_var on the journal scope where $index$ is the number of a given group. Note that multiple variables are required for these elements to function. Each one is numbered 1 thru 4.
Usage is as follows:
-
com_situation_group_$index$_next_phase_name_varexpects a flag variable with the localization of the next phase -
com_situation_group_$index$_next_phase_icon_varexpects a flag variable with the text icon of the next phase -
com_situation_group_$index$_next_phase_progress_varexpects a numerical value for the progress bar value -
com_situation_group_$index$_next_phase_max_progress_varexpects a numerical value for the maximum range of the progress bar -
com_situation_group_$index$_next_phase_min_progress_varexpects a numerical value for the minimum range of the progress bar
The following effects and triggers are available to use for managing journals with the International Organization Framework:
- com_hide_all_journal_elements_for_situation_effect
- com_situation_start_date_today_effect
- com_set_situation_start_date_effect
- com_set_situation_illustration_background_effect
- com_set_situation_left_character
- com_set_situation_right_character
- com_set_situation_phase_effect
- com_set_situation_outcome_name_effect
- com_set_situation_outcome_texture_effect
- com_set_situation_outcome_details_effect
- com_set_indexed_situation_phase_progress_details_effect
- com_update_indexed_situation_phase_progress_effect
- com_remove_indexed_situation_phase_progress_details_effect
- com_hide_indexed_situation_phase_progress_details_effect
Sets the following variables on the journal:
-
com_hide_timeoutto hide the journal timeout container -
com_hide_scripted_buttonsto hide the journal scripted buttons container -
com_hide_journal_reasonto hide the journal _reason -
com_hide_involved_countriesto hide the involved countries -
com_hide_complete_triggersto the hide the journal completion triggers/effects -
com_hide_fail_triggersto the hide the journal failure triggers/effects -
com_hide_modifiersto the hide the journal modifiers -
com_hide_status_descto the hide the status_desc
Parameters:
- None
Sets the following variables on the journal:
-
com_situation_start_month_varwith the flag of the current in-game month -
com_situation_start_year_varwith the value of the current in-game year
Parameters:
- None
Allows for manually setting com_situation_start_month_var and com_situation_start_year_var
Parameters:
-
monththe localization key of the desired month -
yearthe integer value of the desired year
Sets the variable com_situation_illustration_var with an IG scope
Parameters:
-
texturethe key of an IG trait
Sets the variable com_situation_character_left_var
Parameters:
-
charactersome type of character scope
Sets the variable com_situation_character_right_var
Parameters:
-
charactersome type of character scope
Sets the variables required to display the current phase information Parameters:
-
phase_icona flag variable containing the text icon of the current phase -
phase_namea flag variable containing the localization name of the current phase
Sets the header name for a situation outcome Parameters:
-
typethe desired outcome (this can becomplete,timeout, orfail) -
namea flag containing the header name
Sets a custom texture for a situation outcome Parameters:
-
typethe desired outcome (this can becomplete,timeout, orfail) -
texturethe key of an IG trait
Sets both the header and texture for a situation outcome Parameters:
-
typethe desired outcome (this can becomplete,timeout, orfail) -
namea flag containing the header name -
texturethe key of an IG trait
Sets all variables for a specific phase progress group.
Note: This effect will fail with an error if a non-int or out of range index value is provided
Parameters:
-
indexthe number of the group; expects an integer from 1 thru 4 -
next_phase_namea localization flag for this group's next phase name; expects a string -
next_phase_icona localization flag for this group's next phase icon; expects a text icons -
progress_valuethe current value of the progress bar; expects a numerical value -
max_valuethe maximum displayed value of the progress bar; expects a numerical value -
min_valuethe minimum displayed value of the progress bar; expects a numerical value
Sets the flag variables for a specific phase progress group. This effect does not set any of the other required variables.
Note: This effect will fail with an error if a non-int or out of range index value is provided
Parameters:
-
indexthe number of the group; expects an integer from 1 thru 4 -
next_phase_namea localization flag for this group's next phase name; expects a string -
next_phase_icona localization flag for this group's next phase icon; expects a text icons
Updates the progress bar value for a specific phase progress group.
Note: This effect will fail with an error if a non-int or out of range index value is provided
Parameters:
-
indexthe number of the group; expects an integer from 1 thru 4 -
progress_valuethe current value of the progress bar; expects a numerical value
Removes all variables for a specific phase progress group.
Note: This effect will fail with an error if a non-int or out of range index value is provided
Parameters:
-
indexthe number of the group; expects an integer from 1 thru 4
Removes com_situation_group_$index$_next_phase_progress_var which is used by the UI to hide and show the progress element for that index number. This effect can be reversed by running any of the other effects that update com_situation_group_$index$_next_phase_progress_var.
WARNING this effect assumes you have already set all other variables via com_set_indexed_situation_phase_progress_details_effect first!
Parameters:
-
indexthe number of the group; expects an integer from 1 thru 4