Skip to content

Modding Effects

Alexedishi edited this page Aug 28, 2026 · 2 revisions

General Effect Script Docs

The following effects are provided as quality of life features:

Effects

Details

Effect com_save_journal_to_local_variable

Saves scope:journal_entry to a local variable. Meant for use in a journal's immediate block.

Parameters

  • name the name of the variable.

Effect com_save_journal_to_global_variable

Saves scope:journal_entry to a global variable. Meant for use in a journal's immediate block.

Parameters

  • name the name of the variable.

Effect com_save_journal_to_variable

Saves scope:journal_entry to a country variable. Meant for use in a journal's immediate block. Will fail when used with contextless journal entries. Use com_save_journal_to_global_variable instead.

Parameters

  • name the name of the variable.

Effect com_change_global_variable

Sets a global variable. During execution, checks for that variable to exist and adds its value to the operation.

Parameters

  • name name of the variable
  • value the value to be added to the variable. This will be the total value if the variable was not previously set.

Effect com_change_local_variable

Sets a local variable. During execution, checks for that variable to exist and adds its value to the operation.

Parameters

  • name name of the variable
  • value the value to be added to the variable. This will be the total value if the variable was not previously set.

Effect com_change_variable

Sets a variable in the current scope. During execution, checks for that variable to exist and adds its value to the operation.

Parameters

  • name name of the variable
  • value the value to be added to the variable. This will be the total value if the variable was not previously set.

Effect com_change_and_clamp_global_variable

Sets a global variable. During execution, checks for that variable to exist and adds its value to the operation. Provides parameters for maximum and minimum value limits.

Parameters

  • name name of the variable
  • value the value to be added to the variable. This will be the total value if the variable was not previously set.
  • max the maximum limit of the value. Can be a script value.
  • min the minimum limit of the value. Can be a script value.

Effect com_change_and_clamp_local_variable

Sets a local variable. During execution, checks for that variable to exist and adds its value to the operation. Provides parameters for maximum and minimum value limits.

Parameters

  • name name of the variable
  • value the value to be added to the variable. This will be the total value if the variable was not previously set.
  • max the maximum limit of the value. Can be a script value.
  • min the minimum limit of the value. Can be a script value.

Effect com_change_and_clamp_variable

Sets a variable in the current scope. During execution, checks for that variable to exist and adds its value to the operation. Provides parameters for maximum and minimum value limits.

Parameters

  • name name of the variable
  • value the value to be added to the variable. This will be the total value if the variable was not previously set.
  • max the maximum limit of the value. Can be a script value.
  • min the minimum limit of the value. Can be a script value.

Effect: com_update_value_in_global_variable_map

Checks for the presence of a key in a global variable map, and removes it before re-adding the key-value pair. Currently, add_to_global_variable_map will fail if the key is already present in the global variable map.

Parameters:

  • name
  • key
  • value

Effect: com_update_value_in_local_variable_map

Checks for the presence of a key in a local variable map, and removes it before re-adding the key-value pair. Currently, add_to_local_variable_map will fail if the key is already present in the local variable map.

Parameters:

  • name
  • key
  • value

Effect: com_update_value_in_variable_map

Checks for the presence of a key in a variable map, and removes it before re-adding the key-value pair. Currently, add_to_variable_map will fail if the key is already present in the variable map.

Parameters:

  • name
  • key
  • value

Effect: fix_variable_error

Suppresses errors printed from unset or unused variables and flags

Parameters:

  • variable the name of the variable or flag

Clone this wiki locally