首页所有页面

地图外政权模组制作


Offmap powers 是模仿无地称号的特殊实体,如冒险者或农民起义,但附加了更多功能,包括专用用户界面。 Jade Dragon扩展并不是定义你自己地图外能力的必要条件,尽管拥有扩展包,因此能看到游戏引擎中已经能用的地图外能力,这比从零开始写会更有优势。

An offmap power consists of:

  • “地图外能力”本身,提供用户界面以选择决策,游戏中每个可操控统治者存储的“货币”数量,以及该界面中随机显示的“喜欢”和“不喜欢”(可通过脚本在选择决策中检查)。
  • “持有者”,是一个非互动角色。 持有者不受原版事件影响,但可以获得明确标记为其有效的独特事件(例如,带有“offmap = 允许”或“offmap = only”标志/预触发集的character_event)。 它们也无法被交互锁定,且大多数情况下不会被选择 scopes.
  • “总督”是一个互动角色,在游戏地图上拥有标题或有领地的头衔,是与持有者敌对互动的目的地。 虽然总督可以获得土地,但头衔应在游戏开始时保持无地状态,以确保当所有剩余县份被毁时,头衔不会被毁。

玩家角色永远无法控制地图外的能力,作为“持有者”(文档中没有说明玩家角色成为其中任何一种能力会发生什么,但很可能会让该角色被AI接管,导致你王朝中下一个可玩角色继承或游戏结束)。 地图外的能力不能在游戏中动态生成或摧毁,但可以对玩家隐藏或恢复隐藏。玩家永远不能像任何“地图上”的角色那样同时拥有地图外的身份,而总督可以是任何头衔,无论是封地还是名义上的。总督可以可玩,而且没有奇怪的bug,没有把总督头衔交给AI,什么都没有,只是正常的成功。 注意,地图外的能力几乎完全是“软编码”的,并且 deeply 它集成到许多其他模组功能中——至少在考虑从零开始创造新的地图外能力之前,必须有人对 localisation, minor titles, event modding, titles, scripted triggers, decision modding, and 无论是“random_list”意义上的因素和additive_modifiers,还是“角色修饰词”的意义 event modifiers. 如果这让你困惑,地图外的能力可能要等你积累更多经验再考虑。

许多地图外的强力模组已经以技术形式文档保存在“/Crusader Kings II/common/offmap_powers”文件夹及其子文件夹“政策”和“状态”中。 如果这里没有提供信息,可能在那里可以找到,尽管由于其更技术化的格式,学习曲线会更大。

Structure

offmap_tag = {

	name = <localisation_key>

	window_name = domestic_offmaps_window

	button_name = icon_offmaps_entry

	sound = <sfx>



	#Currency parameters

	currency_name = <localisation_key>

	currency_gain = <modifier_definition>

	currency_below_zero = yes

	currency_reset_on_dynasty_change = yes



	#Minor title for holder, and titular title for governor

	holder_title = <minor_title>

	governor_title = <title>



	#Other parameters

	tier = <tier>

	coa_religion = <religion>

	government = <government_type>

	beginning_of_history = <year>.<month>.<day>

	

	non_aggression_modifier = <event_modifier>



	#Show button adjacent to minimap to interact with the offmap power

	display_trigger = {

		#ROOT = offmap power

		#FROM = player

		always = yes

	}

		

	policies = {

		#list of valid policy modifiers for this offmap power

		#defined in policy modifier files in "Crusader Kings II/common/offmap_powers/policies"

	}

	

	statuses = {

		#list of valid status modifiers for this offmap power

		#defined in status modifier files in "Crusader Kings II/common/offmap_powers/statuses"

	}

	

	buttons = {

		#must match button_name in offmap decision(s) and .gui

		<button_name> = {

			#can be clicked even when inactive, but allows manual condition to highlight when decisions are available

			is_active_trigger = {

				always = yes

			}

			#is the button visible?

			display_trigger = {

				always = yes

			}

		}

		#more buttons...

	}

	

	#Currency gained by each ruler (checked monthly, for all matching keys)

	monthly_currency_gain = {

		<localisation_key> = {

			value = <int>

			always = yes

		}

		#or more

	}



	holder_succession = {

		#When the current offmap power holder dies, generates a new character by rolling for each section in order

		#In the triggers of additive_modifiers:

		#  ROOT is the offmap power

		#  FROM is the former holder (invalid if no previous holder)

		#  new_character is the new holder, who may not be fully generated yet (e.g., as of "culture", only the gender is known)

		

		is_female = {

			value = <weight>

			additive_modifier = {

				value = <weight>

				#triggers...

			}

			#if total weight is >= 100, always female

			#if total weight is <= 0, always male

			#otherwise, total weight represents percent chance

		}

		

		culture = {

			<culture_name> = {

				value = <weight>

				additive_modifier = {

					value = <weight>

					#triggers...

				}

				modifier = {

					factor = <weight>

					#triggers...

				}

				#or more...

			}

			<culture_name> = {

				value = <weight>

				#modifiers...

			}

			#or more...

		}

		

		religion = {

			<religion_name> = {

				value = <weight>

				#modifiers...

			}

			#or more...

		}

		

		dynasty = {

			<dynasty_name> = {

				value = <weight>

				#modifiers...

			}

			#or more...

		}

		

		graphical_culture = {

			<graphical_culture> = {

				value = <weight>

				#modifiers...

			}

			#or more...

		}

		

		likes = {

			<scripted_trigger_name> = {

				value = <weight>

				#modifiers...

			}

			#or more...

		}

		

		dislikes = {

			<scripted_trigger_name> = {

				value = <weight>

				#modifiers...

			}

			#or more...

		}

	}

	

	diplomatic_range = {

		#ROOT is character potentially in range

		#FROM is governor (not holder), which must have at least a capital if landless (otherwise all characters are in range)

	}

	

	icon_triggers = {

		<icon_name> = {

			right = yes/no

			frame = <index> #from window name's .gfx file

			trigger = {

				#FROM is offmap power

				#ROOT is player

			}

			window_name = "example_name"

		}

		#...

	}

	

	temple_names = {

		{

			#List of founder names

		}

		{

			#List of non-founder names

		}

		#or more...

	}

}

Parameters

Flag Type Description
currency_below_zero bool 如果是,每个统治者的指定地图外力量货币可能会变成负数。
currency_reset_on_dynasty_change bool 如果是的话,每次地图外能力持有者都会更换 dynasty (not just the current ruler所有玩家的总赚取货币将重置为零。
non_aggression_modifier event modifier 用来表示与地图外力量“和平协议”的临时修正词名称。仅用于显示用途,除了你在脚本中如何使用它。

Holder title

The holder title is a minor title (i.e., not a landed title or titular title当该力量的持有者/统治者接管时,会自动分配给他们。 这始终是一个特殊的小标题(定义在“/common/minor_titles”文件夹中),基本格式如下:

<minor_title_name> = {

	is_offmap_holder = yes

	offmap_power = <offmap_tag>

	

	dignity = 1000



	#other optional properties

	show_as_title = yes

	

	#optional character modifiers...

}

如前所述,地图外能力不可操作,角色不能直接获得小称号,也不能将小头衔转给他人。

The dignity 地图外力量的小称号必须始终高于零。 通常应当是较高的数值,否则持有者可能无法成功获得地图外能力(例如,如果地图内能力被授予称号,他们可能会更喜欢更高尊严的其他头衔,从而阻止他们成为地图外能力的持有者)。

Governor title

The governor title is a landed title or titular title (不是“次要头衔”,即尊称)。它可以是从郡级到帝国级的任何头衔,总督也可以是可玩的。

Adding Interface Button

To add an interface button, change the button_name field to some other name (e.g. offmap_name_icon_offmaps_entry), and add a new .gui file in your_mod/interface/ with the following:

guiTypes = {

	windowType = {

		name = "offmap_name_icon_offmaps_entry"

		backGround =""

		position = { x = 0 y = 0 }

		size = { x = 50 y = 50 }

		moveable = 0

		dontRender = ""

		horizontalBorder = "0"

		verticalBorder = ""

		fullScreen = no

		Orientation = "UPPER_LEFT"

		

		guiButtonType =	{

			name = "icon_offmaps"

			position = { x=0 y=0 }

			quadTextureSprite ="GFX_china_screen_button"	

			clicksound = click_default_china

		}

	}

}

You may also want to change the quadTextureSprite and clicksound 换成其他价值观。如果你不同时更改这两个,你的模组将需要资源Jade Dragon。

Likes and dislikes

每个对地图外能力的“喜欢”或“不喜欢”都是 scripted_trigger 该定义定义了一个或多个触发器,以及一个可选的 context 决定了该喜爱或不喜欢是否符合 offmap_has_like 触发。 (dis)like也是本地化键。 这通常被局部化为简单的描述性名词(例如“日耳曼文化”对原版来说 likes_germanics 脚本触发词),而不是脚本触发器(如“是日耳曼文化的成员”)的本地化,因为通常在默认用户界面中,“喜欢:”或“不喜欢:”之后显示。

Context

地图外能力的上下文决定了它们对 offmap_has_like and offmap_has_dislike 触发器,在特定上下文下调用时。 如果脚本触发返回为真,且持有者的类对符符合指定条件,上下文为真 context 这与脚本触发中包含的上下文相符。 同样,如果脚本触发返回为真且持有者的点赞没有上下文,则该触发器为真。 然而,如果持有者的当前 like has a context, but the offmap_has_like is not called with the correct context, it will always return false.

Example

00_scripted_triggers.txt:

likes_eunuchs = {

	context = eunuch

	trait = eunuch

}

Here, the like 是名为“likes_eunuchs”的脚本触发器(本地化简称为“阉人”)。 scripted_trigger会检查朝臣是否与“太监”相符 trait. Perhaps confusingly, it also defines a context 参数名称相同,名为“太监”(用于 offmap_has_like and offmap_has_dislike triggers). In any case, when a decision checks the liked_by_offmap and disliked_by_offmap 调用角色的触发条件,并与地图外能力对比,它会运行匹配的脚本触发器,以判断该角色是否喜欢或不喜欢该角色。

例如,如果中国皇帝和皇帝有“likes_arabs” like 当前设定,阿拉伯玩家角色选择一个带有地图外能力scripted_trigger likes_arabs的决策,当事件呼叫 liked_by_offmap 触发。 因为likes_arabs触发会检查玩家角色是否是阿拉伯人(在本例中确实如此),触发结果会为真,因此地图外决策的效果可以给予优先处理。

See also

References

相关页面 (63)

Decision moddingEU4转档器模组制作Event moddingLocalisationMinor title moddingModifiersScopesScripted triggerScriptingSteam创意工坊Title moddingTrait modding事件模组制作作用域修正内阁成员模组制作决议模组制作剧本模组制作单位模组制作历史模组制作另类开局模组制作图形模组制作地图模组制作头衔模组制作奇观模组制作宗教模组制作定义宝物模组制作宣战理由模组制作家族模组制作小地图模组制作建筑模组制作指令控制台指令政体模组制作故障排除文化模组制作朝贡国类型模组制作本地化条件模组制作死亡模组制作法律模组制作游戏规则模组制作特质模组制作界面模组制作疾病模组制作目标模组制作盾徽模组制作省份模组制作社团模组制作科技模组制作称号模组制作继承模组制作编辑游戏存档肖像模组制作脚本荣誉头衔模组制作血脉模组制作角色模组制作