Template:Script effects/doc

这是Template:Script effects的模板文档
当直接浏览时,使用变量可能会失效,请不要使用硬编码来代替页面名或地址。


Script effects creates tables of effects from the game's script_docs.

Parameters

Parameter Description Required Default
category Selects a table category, valid options are:
  • all
  • regular (excludes iterator and special)
  • scope (must use scope parameter)
  • target (must use scope parameter)
  • iterator
  • flow
  • log
  • variable
  • special (flow, log, variable)
optional regular
scope Limits effects to ones relevant to the scope
Valid scopes are most game objects, such as pop or character
optional all scopes
noCollapse If set to anything, prevents table from starting collapsed optional none

Examples

{{Script effects|scope=treaty}} results in

List of treaty effects
Effect Description Example Scopes Targets
withdraw Withdraws a country from a treaty
scope:treaty = {
 withdraw = {
  country = <country scope> # must be valid and must be bound by the treaty
 }
}
treaty

{{Script effects|category=log}} results in

List of log effects
Effect Description Example
debug_log Log a string to the debug log when this effect executes
debug_log = message
 the message can be a localization string with ROOT, SCOPE and PREV available
debug_log_scopes Log the current scope to the debug log when this effect executes
debug_log_scopes = yes # log full scope info
debug_log_scopes = no  # log only current scope
error_log Log a string to the error log when this effect executes
error_log = message
 the message can be a localization string with ROOT, SCOPE and PREV available
random_log_scopes Log the current scope to the random log when this effect executes.
Only use temporarily for debugging purposes as it can introduce localized strings into the random log.
random_log_scopes = yes # log full scope info
random_log_scopes = no  # log only current scope