### Example of Required Localisation for Paradox Language Types Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Provides examples of the localisation keys that would be required based on a type definition with specific localisation requirements and a subtype. ```Text my_ship my_ship_desc my_ship_required ``` ```Text my_ship_mk_2 my_ship_mk_2_desc my_ship_mk_2_required my_ship_mk_2_advanced ``` -------------------------------- ### Example Paradox-like Configuration Syntax Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxScript.codeStyleSettings.txt This snippet demonstrates various data types and structures supported in a Paradox-like configuration language, including boolean, number, string, nested objects, arrays, RGB colors, variables, and conditional parameters. ```Paradox-like Config @var = 1 # Line comment settings = { boolean_value = yes number_value = 1.0 number_value = @var string_value = Foo string_value = "Foo\n bar " values = { foo = bar } values = { 1 2 3 } color = rgb { 142 188 241 } parameter = $PARAM$ [[!PARAM] parameter_condition = $PARAM$ ] inline_math = @[2 + ($MAX$ - 1 + var)] } ``` -------------------------------- ### Example Paradox Command Expressions Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxLocalisationIncorrectCommandExpression.html Illustrates examples of command expressions used in Paradox localisation, showing how to access properties and variables within the game's data model. ```Paradox DSL Root.GetName Root.Owner.var ``` -------------------------------- ### English Adjectivization Pattern Example Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_GRAMMAR.txt Provides an example of an adjectivization pattern used in English. It demonstrates how a pattern like 'adj_NNus:0 "*an $1$"' transforms a base name (e.g., 'Ganvius') into its adjectival form ('Ganvian $1$'). ```Paradox Localization adj_NNus:0 "*an $1$" ``` -------------------------------- ### Example of Missing Parameter Detection in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptMissingParameter.html Demonstrates a scenario where a parameter is considered missing. In this example, 'some_definition' is instantiated within 'some_other_definition', but $PARAM2$ is not explicitly set, leading to a missing parameter report. This highlights how the system flags parameters that are used but not provided a value. ```Custom Script # some_other_script_file.txt some_other_definition = { some_definition = { $PARAM1$ = value # PARAM2 is missing } some_sv_prop = value:some_sv|$PARAM1$|value| # PARAM2 is missing } ``` -------------------------------- ### Example of Parameter Definition in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptMissingParameter.html Illustrates a definition declaration in a Paradox script file, showing how parameters are referenced using the '$PARAM$' syntax. This snippet defines 'some_definition' with two parameters, $PARAM1$ and $PARAM2$. ```Custom Script # some_script_file.txt some_definition = { some_prop = $PARAM1$ some_other_prop = $PARAM2$ } ``` -------------------------------- ### Paradox Script Language Syntax Overview Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxScript.colorSettings.txt This snippet illustrates a comprehensive set of syntax features in Paradox game scripting. It includes variable assignment, various data types (boolean, number, string, array, color), nested blocks, conditional parameters, inline mathematical expressions, and references to game-specific definitions and scopes, along with scope and value field expressions using XML-like tags. ```Paradox Script @var = 1 # Line comment settings = { boolean_value = yes number_value = 1.0 number_value = @var string_value = Foo string_value = "Foo\n bar " values = { foo = bar } values = { 1 2 3 } color = rgb { 142 188 241 } parameter = $PARAM$ [[!PARAM] parameter_condition = $PARAM$ ] inline_math = @[2 + ($MAX$ - 1 + var)] } some_definition = { tag_name key = definition_name key = complex_enum_value key = definition_reference key = localisation_reference key = synced_localisation_reference key = path_reference key = enum_value key = complex_enum_value root.owner = { scope_field_expression = prefix:value value_field_expression = prefix:value variable_field_expression = some_variable script_value_expression = some_script_value|PARAM|value| dynamic_value_expression = some_dynamic_value database_object_expression = civic:some_civic modifier = some_modifier trigger = some_trigger effect = some_effect variable = some_variable } } ``` -------------------------------- ### Valid Database Object Expression Examples Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxLocalisationIncorrectDatabaseObjectExpression.html These examples demonstrate the correct syntax for database object expressions, which can be used as concept names in Paradox localization files. They show both a simple and a more complex form of the expression. ```Paradox Language civic:some_civic, civic:some_civic:some_swapped_civic ``` -------------------------------- ### Comprehensive Example of Parameterized Paradox Scripted Effect Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_advanced_documentation.txt This example demonstrates a scripted effect that grants energy or minerals based on whether an 'ENERGY' parameter is provided. It shows both the definition and how to call it. ```Paradox Scripting Language # In common/scripted_effects: example_effect = { # To use, set ENERGY to desired energy reward. Otherwise, 100 minerals are granted [[ ENERGY ] add_resource = { energy = $ENERGY$ } ] [[ !ENERGY ] add_resource = { minerals = 100 } ] } # When called in script: example_effect = yes #adds 100 minerals example_effect = { ENERGY = 150 } #adds 150 energy ``` -------------------------------- ### Identifying Unused Parameters in Paradox Script Examples Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptUnusedParameter.html This example demonstrates how parameters are flagged as unused in Paradox script files. It shows cases where parameters are checked or set but not referenced in definition declarations, leading to them being reported as unused. ```Paradox Script # some_script_file.txt some_definition = { some_prop = $PARAM$ # used [[UNUSED_PARAM]] # checked but not used some_other_prop = $PARAM$ ] } ``` ```Paradox Script # some_other_script_file.txt some_other_definition = { some_definition = { UNUSED_PARAM = value # set but not used } some_sv_prop = value:some_sv|UNUSED_PARAM|value| # set but not used } ``` -------------------------------- ### Define Top-Level Types for File-to-Rule Connection in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Types are top-level entities that link game files to configuration rules, often corresponding to folders. This example demonstrates defining simple types with a 'path' and a type with a custom 'name_field' to specify where to extract the entity's name. ```Paradox Script types = { type[technology] = { path = "game/common/technology" } type[ship_behavior] = { name_field = "name" path = "game/common/ship_behaviors" } } ``` -------------------------------- ### Example Define Reference Expression Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptIncorrectDefineReferenceExpression.html An example of a define reference expression, which is a script expression matching the CWT expression data type '$define_reference'. This type of expression is used within the Paradox language support. ```Paradox DSL define:NPortrait|GRACEFUL_AGING_START ``` -------------------------------- ### Using Template Expressions in CWT Config Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/docs/en/config.md This section explains template expressions in CWT, which combine multiple data expressions for flexible matching. Examples include string literals, references to jobs, enum values, and dynamic values, demonstrating how they expand matching capabilities beyond exact strings. ```cwt # a string literal, exactly matches 'x' x # a template expression which contains a reference to jobs, matches 'a_researcher_b', 'a_farmer_b', etc. a__b # a template expression which contains a references to enum values of 'weight_or_base', matches 'a_weight_b' and 'a_base_b' a_enum[weight_or_base]_b # a template expression which contains a references to dynamic values of 'anything' # generally, there is no limit for 'value[anything]', so this expression is equivalent to regex 'a_.*_b' a_value[anything]_b ``` -------------------------------- ### Performing Inline Mathematics in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_advanced_documentation.txt The inline maths system allows mathematical equations using @\[ civic:some_civic']) within localization strings, providing clickable links or tooltips. ```Paradox Localization KEY_WITH_CONCEPT:0 "Concept: ['concept', concept text] ['civic:some_civic']" ``` -------------------------------- ### links.cwt File Structure Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This file contains a 'links' block representing 1:1 links used in 'x.y' chains. Each entry defines a link keyword, its documentation, input/output scopes, data source, prefix, and type. ```APIDOC links = { faith = { desc = " Unknown, add something in code registration" // Documentation string from_data = yes // Indicates if it's a set of links generated from other script files type = scope // Type of link: 'scope' or 'both' (scope/value) data_source = // CWTools data source for valid values prefix = faith: // Mandatory prefix before each key (e.g., 'faith:christian') input_scopes = { landed_title province } // Scopes it can chain from; if absent, it's a global scope link output_scope = faith // The scope it results in } // ... other link definitions } ``` -------------------------------- ### Paradox Script Type Configuration Options Reference Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This section provides a reference for various configuration options available when defining 'types' in Paradox Script, detailing parameters like root key skipping, path matching, key filtering, and graph view enablement. ```APIDOC Type Configuration Options: skip_root_key: Description: Skips the top-level key(s) when processing files for types. Values: - "tech_group": Skips 'tech_group' and looks for types at the second level. - "any": Skips any top-level key, finding types at every second level. - "!= key": Skips any top-level key except the specified one (e.g., '!= tech_group'). - "{ key1 key2 key3 }": Skips multiple nested levels (e.g., 'something = { blah = { else = {'). - Multiple entries: Each entry is processed (e.g., 'skip_root_key = tech' 'skip_root_key = tech_group'). path_strict: Description: Requires the file's directory to match 'path' entirely, excluding subfolders. Value: "yes" path_file: Description: Only matches the given filename. Value: "test.txt" (example) path_extension: Description: Only matches files with the given extension. Value: ".txt" (example) type_key_filter: Description: Requires all entries for this type to have a specific key or keys. Values: - "key": Requires the key 'country_event'. - "<> key": Requires any key other than 'country_event'. - "{ key1 key2 key3 }": Requires one of the listed keys. type_per_file: Description: If 'yes', starts types from the root of a file instead of all top-level blocks. Value: "yes" starts_with: Description: Only matches blocks whose names start with the specified prefix. Value: "b_" (example, e.g., for CK2 titles) severity: Description: Reduces the error level for this type to warnings. Value: "warning" unique: Description: Shows errors if the same type name is defined multiple times. Value: "yes" graph_related_types: Description: Enables the graph view for this type and will include the listed types in the graph. Value: "{ special_project anomaly_category }" (example, comment option) ``` -------------------------------- ### folders.cwt File Structure Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This file defines a list of folder names that should be scanned for script files within the game's directory structure. ```APIDOC folders = { "common/scripted_triggers" "events" // ... other folder names } ``` -------------------------------- ### Subtype Clause Options Reference Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Reference for available options that can be used with the `subtype` clause in Paradox language definitions, including filters, scope pushing, key matching, and display properties. ```APIDOC Subtype Options: - type_key_filter: string (e.g., "country_event") Description: Subtypes can take a single type_key_filter. - push_scope: string (e.g., "country") Description: If this subtype is valid, this scope is set when validating the type. - starts_with: string (e.g., "b_") Description: If the type key starts with this, it will have this subtype. - display_name: string (e.g., "\"Fancy name\"") Description: The pretty name for the subtype. - abbreviation: string (e.g., "ST") Description: The short form for this subtype in graph displays. ``` -------------------------------- ### localisation.cwt File Structure Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This file contains a 'localisation_commands' block that lists localisation commands and the specific scopes in which they can be used. This file is primarily used in pre-Jomini Paradox games. ```APIDOC localisation_commands = { GetMotherFather = { monarch heir consort advisor } // ... other localisation commands and their valid scopes } ``` -------------------------------- ### Define Basic Localization Key-Value Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxLocalisation.colorSettings.txt Demonstrates the fundamental structure of a localization entry, consisting of a key, a numerical identifier (often 0), and a string value. This is the simplest form of a localization string. ```Paradox Localization KEY:0 "Value" ``` -------------------------------- ### CWT Config File Basic Syntax Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/docs/en/config.md Illustrates the basic syntax of a CWT config file, including comments, key-value pairs, and nested clauses. Both equal and not-equal signs can be used as separators, and properties/options can be mixed with values within clauses. ```cwt # both equal sign ('=', '==') and not equal sign ('<>', '!=') can be used as the k-v separator (also available in options) # properties (options) and values can be mixed in clauses (also available in options) ### documentation comment ## option = option_value ## option_0 = { k = v } ## option_value prop = { # line comment k = v v } ``` -------------------------------- ### Paradox Script: Scope Field Expression Examples Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptIncorrectScopeFieldExpression.html Illustrative examples of valid scope field expressions used in Paradox game scripting, demonstrating how to reference game objects and properties within different scopes. These expressions match CWT expression data types such as 'scope', 'scope_field', or 'scope_group'. ```Paradox Script root root.owner event_target:some_target root.owner.event_target:some_target ``` -------------------------------- ### Supported Database Object Types for Concepts Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_CONCEPTS.txt Lists the types of database objects that are currently supported for automatic concept tooltip generation. This includes various game elements like ascension perks, authorities, buildings, civics, and technologies, specifying any known limitations. ```APIDOC List of currently supported object types: ascension_perk authority authority_swaps building civic (includes origins) district edict ethic starbase_building starbase_module technology (note: the tooltip currently only shows the name and description) tradition tradition_category trait (both species and leader traits) ``` -------------------------------- ### Define Empty Localization String Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxLocalisation.colorSettings.txt Shows how to define a localization key with an empty string value. This can be used for placeholders or to intentionally display no text. ```Paradox Localization EMPTY:0 "" ``` -------------------------------- ### Use Parameters in Localization Strings Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxLocalisation.colorSettings.txt Demonstrates how to embed dynamic parameters (e.g., $KEY$, $KEY|Y$) within localization strings. These parameters are replaced by game-specific values at runtime, optionally with formatting. ```Paradox Localization KEY_WITH_PARAMETER:0 "Parameter: $KEY$ and $KEY|Y$" ``` -------------------------------- ### Example of Unused Dynamic Value Detection in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptUnusedDynamicValue.html This snippet illustrates a 'set_global_flag' for 'unused_flag' which is never referenced by a 'has_global_flag' or similar expression, making it an unused dynamic value. The tool would report 'unused_flag' as unused, highlighting code that can be removed. ```Paradox Script # some_script_file.txt some_definition = { set_global_flag = unused_flag # set but not used some_prop = { limit = { has_global_flag = flag } # ... } } ``` -------------------------------- ### Embed Commands and Scopes in Localization Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxLocalisation.colorSettings.txt Illustrates the complex syntax for embedding game commands, scopes, and dynamic values within localization strings. This allows displaying information derived from game state or specific objects. ```Paradox Localization KEY_WITH_COMMAND:0 "Command: [Root.Owner.event_target:some_event_target.GetName] [some_scripted_loc] [some_variable]" ``` -------------------------------- ### Define Dynamic Complex Enums in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Complex enums allow dynamic generation of enum values from mod files. This example illustrates how to configure a complex enum using 'path' to specify the source folder and 'name' with 'counter' and 'scalar' to map file entities to enum names. ```Paradox Script complex_enum[event_chain_counter] = { path = "game/common/event_chains" name = { counter = { enum_name = { } } scalar = { scalar = enum_name } } } ``` -------------------------------- ### Paradox .cwt Comment Conventions Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Defines the usage of '#' characters for comments, options, and documentation within .cwt files, similar to pdxscript files. ```APIDOC # // Used for single-line comments: '# This text will be completely ignored' ## // Used for rule options: '## cardinality = 0..1' ### // Used for documentation: '### This text will be displayed in the completion info' ``` -------------------------------- ### Defining a Concept with Database Tooltip Override Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_CONCEPTS.txt Shows how to define a custom concept that uses a database object as its tooltip override. This combines the benefits of custom concepts (aliases, icons) with the automatic tooltip generation of database concepts. ```Paradox Script concept_id = { tooltip_override = "civic:civic_imperial_cult" } ``` -------------------------------- ### Paradox .cwt Rule Options Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Options applied to rules by placing them in a comment above the rule. These control cardinality, scope changes, and error severity for validation rules. ```APIDOC ## cardinality = min..max // min: any integer, max: any integer or 'inf' for unlimited ## cardinality = ~min..max // Same as above, but warning if below min threshold (less strict) ## push_scope = // Context switch/scope change, adds the specified scope onto the current scope stack ## replace_scope = { this = root = from = fromfrom = ... } // Replaces given parts of the current scope context with specified scopes ## severity = // Changes any errors for the following rule to this severity (error/warning/information/hint) ## scope = // The following rule is only valid when the current scope matches the given scope ## scope = { ... } // The following rule is valid for multiple specified scopes ``` -------------------------------- ### Example: Detecting Unset Global Flags in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/inspectionDescriptions/ParadoxScriptUnsetDynamicValue.html This code snippet illustrates a Paradox script where a global flag, 'unset_flag', is referenced by a 'has_global_flag' expression within a 'limit' block, but is not defined or set elsewhere in the script. This usage without prior definition causes it to be flagged as an unset dynamic value. ```Paradox Script # some_script_file.txt some_definition = { set_global_flag = flag some_prop = { limit = { has_global_flag = unset_flag # used but not set } # ... } } ``` -------------------------------- ### Define OR Condition for Ethics in Paradox Script Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/test/testData/script/t_inline_template_expression.txt This snippet defines a 'test' block that evaluates to true if the entity possesses either the 'pacifist' or 'materialist' ethic. It uses the 'OR' logical block to combine multiple 'has_ethic' conditions. This pattern is commonly used in Paradox game modding for event triggers, country modifiers, or character traits. ```Paradox Script test = { OR = { has_ethic = ethic_[[fanatic]fanatic_]pacifist has_ethic = ethic_[[fanatic]fanatic_]materialist } } ``` -------------------------------- ### Define Parameters in CWT Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/docs/en/config.md This snippet details how to define parameters in CWT. It covers the 'x' or 'x = xxx' syntax, where 'x' is a parameter name or pattern. It explains the 'context_key' option for linking parameters to containing definitions or inline scripts, and how to declare context configurations (including multiple types) and scope context. It also shows how parameters can inherit context. ```cwt parameters = { # 'x' or 'x = xxx' # 'x' is a parameter name, e.g., for '$JOB$', 'x' should be 'JOB' # 'x' can also be a pattern expression (template expression, ant expression or regex) # use 'x = xxx' to declare context config(s) (add '## context_configs_type = multiple' if there are various context configs) # for value of option 'context_key', # before '@' is the containing definition type (e.g., 'scripted_trigger'), or 'inline_script' for inline script parameters # after '@' is the containing definition name, or the containing inline script path # since 1.3.6, value of option 'context_key' can also be a pattern expression (template expression, ant expression or regex) ### Some documentation ## context_key = scripted_trigger@some_trigger x # more detailed examples for declaring context config(s) ## context_key = scripted_trigger@some_trigger x = localistion ## context_key = scripted_trigger@some_trigger ## context_configs_type = multiple x = { localisation scalar } # since 1.3.5, scope context related options are also available here ## context_key = scripted_trigger@some_trigger ## replace_scopes = { this = country root = country } x # since 1.3.6, using single alias at root level is also available here ## context_key = scripted_trigger@some_trigger ## context_configs_type = multiple x = single_alias_right[trigger_clause] # since 1.3.12, a parameter's config context and scope context can be specified to inherit from its context # e.g. for parameter 'x' with context key 'scripted_trigger@some_trigger', its context is scripted trigger 'some_trigger' ## context_key = scripted_trigger@some_trigger ## inherit x } ``` -------------------------------- ### Apply Text Formatting in Localization Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxLocalisation.colorSettings.txt Shows how to use specific formatting tags (e.g., #v for bold, #! to reset) to apply styles like bold, italic, or underline to parts of the localization text. ```Paradox Localization KEY_WITH_TEXT_FORMAT:0 "Text format: #v text#!" ``` -------------------------------- ### Localization Key Lookup with Angle Brackets Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_GRAMMAR.txt Demonstrates how to use angle brackets to look up a different localization key and apply tags from a name. This method is particularly useful for patterns that are frequently repeated within a language's text. ```Paradox Localization plot_string:0 "We have uncovered [From.GetAdj: <1> plot]" a_an:0 "a|||vowel:an" ``` -------------------------------- ### Defining a Specific Effect Alias in Paradox Language Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Shows how to define a reusable alias for a specific effect, such as `create_starbase`, including its expected parameters and their cardinalities. ```PDX Language alias[effect:create_starbase] = { ## cardinality = 1..1 owner = scalar ## cardinality = 1..1 size = scalar ## cardinality = 0..100 module = scalar ## cardinality = 0..100 building = scalar ## cardinality = 0..1 alias_name[effect] = alias_match_left[effect] } ``` -------------------------------- ### GUI Parameter for Missing DLC Requirements Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_CONCEPTS.txt Documents the `concepts_show_missing_dlc` parameter for `instantTextBoxType` in the GUI, which, when set to 'yes', enables database concept tooltips to display unmet DLC requirements. Notes the specific object types currently supported for this feature. ```APIDOC In GUI, instantTextBoxType has a "concepts_show_missing_dlc" parameter. If set to "yes", database concept tooltips inside the text box will show unmet DLC requirements for the database object. Currently, this only works for authorities, civics, ethics and species traits. ``` -------------------------------- ### Define Parameterized Inline Script for Policy Options Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/inline_script.txt This snippet defines an inline script "test_basic_policy" that uses parameters like "$KEY$", "$MODIFIER_A$", and "$MODIFIER_B$". These parameters act as placeholders that can be replaced with specific values when the script is included, allowing for flexible and reusable policy option definitions. ```Paradox Script $KEY$ = { option = { name = "$KEY$_a" on_enabled = { add_modifier = { modifier = $MODIFIER_A$ days = 360 } } } option = { name = "$KEY$_b" on_enabled = { add_modifier = { modifier = $MODIFIER_B$ days = 360 } } } } ``` -------------------------------- ### values.cwt File Structure Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This file contains a 'values' block with multiple lists of hardcoded CWTools `value_set` values. In CK3 and later games, this data is often derived from 'event targets set from code' or similar lists found in script documentation. ```APIDOC values = { value_set_1 = { value_A value_B // ... } value_set_2 = { // ... } // ... other value sets } ``` -------------------------------- ### CWT Priorities Configuration Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/docs/en/config.md Demonstrates how to configure priorities for overriding targets like scripted variables, definitions, and localisations in CWT config files. It explains the 'fios', 'lios', and 'ordered' priority types and their application to file paths. ```cwt priorities = { # LHS - file path (relative to game or mod root directory) # RHS - priority (available values: "fios", "lios", "ordered", default value: "lios", ignore case) # file path - path of specific directory (e.g. ""common/on_actions", "common/scripted_variables", "localisation") # fios - use the one that reads first, ignore all remaining items # lios - use the one that reads last (if not specified, use this as default) # ordered - reads by order, no overrides "events" = fios # ... } ``` -------------------------------- ### scopes.cwt File Structure Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This file contains a 'scopes' block that defines game scopes, their display text, aliases for referencing in rules and script, and links to localisation scopes. It can also specify subscope relationships. ```APIDOC scopes = { "Landed title" = { aliases = { landed_title "landed title" } data_type_name = "Title" // is_subscope_of = { province } // Optional: used for scopes that can be used as another scope in one direction } // ... other scope definitions } ``` -------------------------------- ### Galactic Paragons Trait Inline Script Parameters Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/000_documentation_leader_traits.txt Documents the parameters for an inline script used in Galactic Paragons to define commonly used icon layers and set trait subtitles. This script simplifies the definition of visual and descriptive elements for leader traits by providing predefined options for class, icon, rarity, council status, and tier. ```APIDOC inline_script = { script = trait/icon CLASS = admiral Class name. Accepted: leader, admiral, general, scientist, governor ICON = GFX_name Texture name defined in "interface" folder. Default trait icons are in "interface\icons\traits" folder. RARITY = veteran Rarity tag. Accepted: common, veteran, paragon COUNCIL = yes Is councilor trait? Accepted: yes, no, triggered (CLASS and COUNCIL will be set by triggered modifiers) TIER = 2 Tier number. Accepted: none, 1, 2, 3 } ``` -------------------------------- ### Specifying Context Tags for Grammatical Case Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_GRAMMAR.txt Illustrates how to specify required context tags by appending an ampersand to a property name or a sub-name slot. This allows the system to select appropriate variants based on external grammatical context, such as case. ```Paradox Localization "[From.GetName&dative]" "Empire of $1&genitive$" ``` -------------------------------- ### Direct Database Concept Usage in Localization Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_CONCEPTS.txt Explains how to directly reference a database object (e.g., civic:civic_imperial_cult) within a localization string to automatically generate a tooltip. This method bypasses the need for explicit concept definitions and concept-specific localization, though it lacks a concept icon and requires the object ID to match its localization key for automatic text replacement. ```Localization String EXAMPLE_LOC_1: "Example of ['civic:civic_imperial_cult'] with a tooltip" ``` -------------------------------- ### Define On Actions in CWT Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/docs/en/config.md This snippet illustrates how to define 'on actions' in CWT. It shows the basic 'x' or 'x = xxx' syntax, support for pattern expressions, and options for specifying scope replacements (e.g., 'this = country root = country') and event types (e.g., 'country'). ```cwt on_actions = { # 'x' or 'x = xxx' # 'x' can also be a pattern expression (template expression, ant expression or regex) ### Some documentation ## replace_scopes = { this = country root = country } ## event_type = country x } ``` -------------------------------- ### Creating String Variants Based on Tags Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_GRAMMAR.txt Illustrates how a single localization string can contain multiple variants. Variants are separated by '|||', optionally followed by required tags and a colon, then the variant string. The system selects the first variant from right to left whose tag requirements are satisfied, allowing for context-sensitive text. ```Paradox Localization string_with_variants:0 "A $1$|||vowel:An $1$" ``` -------------------------------- ### Defining a Generic Effect Alias in Paradox Language Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Demonstrates a simpler, generic alias definition for effects, allowing for recursive inclusion of other effect aliases. ```PDX Language alias[effect:THIS] = { alias_name[effect] = alias_match_left[effect] } ``` -------------------------------- ### Define Army Type Structure in Paradox DSL Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/Cwt.codeStyleSettings.txt This snippet defines the 'army' type, specifying its file path, various subtypes (buildable, pop_spawned, has_species), localization keys for name and description, and an icon image path. It illustrates how game entities are structured in Paradox configuration files. ```Paradox DSL types = { type[army] = { path = "game/common/armies" subtype[buildable] = { potential = { ## cardinality = 0..0 always = no } } subtype[pop_spawned] = { is_pop_spawned = yes } subtype[has_species] = { ## cardinality = 0..0 has_species = no } localisation = { ## required Name = "$" ## required Desc = "$_desc" } images = { ## primary icon = "#icon" # } } } ``` -------------------------------- ### Applying Subtype-Specific Rules in Paradox Language Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Demonstrates how to apply additional validation rules or properties that are specific to a particular subtype within a main type definition. Only rules for the matching subtype (e.g., `starbase`) will be active. ```PDX Language ship_size = { class = shipclass_starbase section_slots = { subtype[starbase] = { } subtype[ship] = { "bow" = { locator = scalar } "mid" = { locator = scalar } "stern" = { locator = scalar } } subtype[platform] = { "west" = { locator = scalar } "east" = { locator = scalar } } } subtype[starbase] = { flip_control_on_disable = bool } subtype[ship] = { combat_disengage_chance = float } } ``` -------------------------------- ### CWTools .cwt Simple Data Type Rules Reference Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md This section provides a comprehensive reference for simple data types and rules supported in .cwt configuration files, used by cwtools for validation and auto-completion. It details various types like `bool`, `int`, `float`, `scalar`, `localisation`, `filepath`, and special types such as ``, `enum`, and `scope`, explaining their syntax and usage constraints. ```APIDOC Simple Rules: bool: Matches 'yes' or 'no'. Example: is_triggered_only = bool int: Matches any integer. Can specify range: int[-5..100] or int[-inf..inf]. Example: count = int float: Matches any float. Can specify range: float[-5.0..100.0] or float[-inf..inf]. Example: acceleration = float scalar: Matches any string. Example: construction_type = scalar percentage_field: Matches a value ending with '%'. localisation: Matches a localisation key, or a quoted sentence. localisation_synced: Matches a localisation_synced key, or a quoted sentence. localisation_inline: Matches either a localisation key, or a quoted inline localisation string (rejects quoted keys). filepath: Matches a string if the file referenced in the string exists. filepath[prefix]: Matches a string if the file referenced in the string exists, with the given prefix (e.g., filepath[some/path/]). filepath[prefix,ext]: Matches a string if the file referenced in the string exists, with the given prefix and extension (e.g., filepath[some/path/,.ext]). icon[path]: Matches 'path/x.dds' for a given string x (e.g., icon[gfx/interface/ships]). date_field: Matches an EU4 style date field (YYYY.MM.DD). : Matches the names of any type found by the 'type[type_key]' rule (e.g., modifier = ). prefix__suffix: Matches names of 'type_key' with optional prefix/suffix (e.g., modifier = pre__suf). enum[enum_key]: Matches any values defined in the 'enum[enum_key]' rule (e.g., set_fleet_stance = enum[fleet_stance]). scope[scope_key]: Matches any target that has a scope of 'scope_key' (e.g., who = scope[country]). 'event_target[country]' is equivalent. scope_field: Matches any target. Exists to avoid conflict with 'scope = ' in vanilla. variable_field: Matches a number or a reference to a variable. Accepts range: variable_field[min..max]. int_variable_field: Same as 'variable_field', but restricted to integers. value_field: Matches a number or other reference to a value (in Jomini games). Accepts range: value_field[min..max]. int_value_field: Same as 'value_field', but restricted to integers. alias_keys_field[alias_key]: Matches a string that is a key in a rule alias (mainly used for 'switch'). ``` -------------------------------- ### Define Army Type Schema in Paradox Engine Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/Cwt.colorSettings.txt This snippet illustrates the definition of an 'army' type in the Paradox game engine's configuration. It outlines the base path for army definitions, introduces subtypes like 'buildable' (for armies that cannot be built), 'pop_spawned' (for armies generated by pops), and 'has_species' (for armies without a species). It also specifies required localization keys for the army's name and description, and an icon image reference. ```APIDOC types = { ### Army type[army] = { path = "game/common/armies" subtype[buildable] = { potential = { ## cardinality = 0..0 always = no } } subtype[pop_spawned] = { is_pop_spawned = yes } subtype[has_species] = { ## cardinality = 0..0 has_species = no } localisation = { ## required Name = "$" ## required Desc = "$_desc" } images = { ## primary icon = "#icon" # } } } ``` -------------------------------- ### Define Scripted Variables in CWT Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/docs/en/config.md This snippet demonstrates how to define scripted variables in CWT. It covers the basic syntax 'x' or 'x = xxx', where 'x' can be a pattern expression. It also shows how to add inlay hint documentation using '## hint'. ```cwt scripted_variables = { # 'x' or 'x = xxx' # 'x' can also be a pattern expression (template expression, ant expression or regex) ### Some documentation ## hint = §RSome inlay hint text§! x } ``` -------------------------------- ### Basic Concept Usage in Localization Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_CONCEPTS.txt Shows how to embed a concept ID directly into a localization string. The system automatically replaces the square bracketed text with the concept's localization and uses a default description tooltip unless overridden. ```Localization String EXAMPLE_LOC_1: "Example of a ['concept_id'] with a tooltip" ``` -------------------------------- ### Localizing Sequential Names with Ordinal Numerals Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/paradox/99_README_GRAMMAR.txt Demonstrates how to define a sequential name for entities like ships or armies in a localization file, using the '$ORD$' format key to display ordinal numbers (e.g., '1st', '2nd'). This format key refers to definitions in 'name_system_l_english.yml'. ```Game Localization Format AQUATIC1_SEASPRAYBATTALION:0 "$ORD$ Seaspray Battalion" ``` -------------------------------- ### Display Icons in Localization Text Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/src/main/resources/samples/ParadoxLocalisation.colorSettings.txt Explains how to embed game icons (e.g., £unity£, £leader_skill|3£) directly into localization strings. Icons are rendered in-game based on their defined names and optional size/frame. ```Paradox Localization KEY_WITH_ICON:0 "Icon: £unity£ and £leader_skill|3£" ``` -------------------------------- ### Using a Single-Alias in Paradox Language Rules Source: https://github.com/dragonknightofbreeze/paradox-language-support/blob/master/references/cwt/guidance.md Demonstrates how to apply a previously defined `single_alias`, like `any_trigger_clause`, within a rule, showing how it expands to include the encapsulated rules. ```PDX Language ## push_scope = country any_country = single_alias_right[any_trigger_clause] ``` ```PDX Language ## push_scope = country any_country = { ## cardinality = 0..1 count = int alias_name[trigger] = alias_match_left[trigger] } ```