宝物模组制作:修订间差异

本页面所适用的版本可能已经过时,最后更新于2.7
无编辑摘要
(16:50, 22 August 2020‎ Gandalf The Black)
 
(未显示另一用户的1个中间版本)
第28行: 第28行:
* An artifact with an active trigger but without owner will never be considered active
* An artifact with an active trigger but without owner will never be considered active
* An artifact without an active trigger will always be considered active, even if not owned.
* An artifact without an active trigger will always be considered active, even if not owned.
* ROOT is the owner and FROM is the artifact
|<pre>
|<pre>
active = {
active = {
第80行: 第81行:


Pictures:
Pictures:
* The pictures are set in gfx/interface/inventory/artifacts
* The pictures are set in C:\Users\Your user name\Documents\Paradox Interactive\Crusader Kings II\gfx\interface\inventory\artifacts
Example for mods:
C:\Users\Your user name\Documents\Paradox Interactive\Crusader Kings II\mod\A Game of Thrones\gfx\interface\inventory\artifacts
* The link between the GFX code and the picture is in Vanilla file interface/domestic_treasury.gfx
* The link between the GFX code and the picture is in Vanilla file interface/domestic_treasury.gfx
* You can use artifact backgrounds (arti_bg.dds, arti_bg_glow.dds, arti_bg_small.dds, and arti_bg_glow_small.dds) in gfx/interface/inventory/artifacts to make artifacts that follow the style of the vanilla artifacts
* You can use artifact backgrounds (arti_bg.dds, arti_bg_glow.dds, arti_bg_small.dds, and arti_bg_glow_small.dds) in gfx/interface/inventory/artifacts to make artifacts that follow the style of the vanilla artifacts
第215行: 第218行:
<references/>
<references/>


[[Category:Modding]]
[[Category: 模组制作]]
{{ModdingNavbox}}
{{ModdingNavbox}}
[[en:Artifact modding]]

2020年12月25日 (五) 20:20的最新版本


Artifacts are part of free patch 2.7 and don't actually require Monks and Mystics expansion (though most vanilla artifacts are part of the expansion).

They allow classical-RPG concepts of treasury (stash) and equipable slots (inventory).

Artifacts

Variable Type Description Example
quality int quality = 2
flags List<string> Flags that can be checked with has_artifact_flag condition. flags = { chest hermetics very_rare }
active Character conditions Conditions for the artifact to be usable by a character. See is_artifact_active condition.
  • An artifact with an active trigger but without owner will never be considered active
  • An artifact without an active trigger will always be considered active, even if not owned.
  • ROOT is the owner and FROM is the artifact
active = {
  is_adult = yes
}
allowed_gift Character conditions Conditions for the trigger artifact_can_be_gifted_to.
stacking bool If no, can only have a single copy of this artifact in one's possession. Defaults to "yes". stacking = no
indestructible bool Whether destroy_artifact has any affect. Defaults to "no". indestructible = yes
picture gfx Defines the gfx name, typically GFX_<artifact_name>

2 images are needed:

  • 118x118px for GFX_<artifact_name>
  • 59x59px for GFX_<artifact_name>_small
picture = "GFX_strange_chest"
<modifier> Character modifiers Modifiers given by the artifact when it is equipped.
martial = 2
monthly_character_piety = -2
tech_growth_modifier = 0.05
combat_rating = 2
slot string Associated slot to equip the artifact. New slots can be added dynamically. slot = crown

Localization:

  • <artifact_name>: name of the artifact
  • <artifact_name>_desc: description of the arftifact
  • <slot>: name of the equipment slot

Pictures:

  • The pictures are set in C:\Users\Your user name\Documents\Paradox Interactive\Crusader Kings II\gfx\interface\inventory\artifacts

Example for mods: C:\Users\Your user name\Documents\Paradox Interactive\Crusader Kings II\mod\A Game of Thrones\gfx\interface\inventory\artifacts

  • The link between the GFX code and the picture is in Vanilla file interface/domestic_treasury.gfx
  • You can use artifact backgrounds (arti_bg.dds, arti_bg_glow.dds, arti_bg_small.dds, and arti_bg_glow_small.dds) in gfx/interface/inventory/artifacts to make artifacts that follow the style of the vanilla artifacts

Slots

Artifacts can be equipped or unequipped. Number of equipped artifacts are limited by dynamic "slots":

slots = {
	weapon = 1
	ceremonial_weapon = 1
	scepter = 1
	crown = 1
	wrist = 1
	neck = 1
	torso = 1
	library = 4
}

Artifact spawns

Determines the generation of artifacts at the begining of a game.

Variable Type Description Example
max_amount int How many artifacts do we hand out? Default is 4,294,967,295 max_amount = 1
spawn_date date What date should it claim to have been created? Note that this could be in the future; the spawn chance should be handled in spawn_chance. If a date at or before 1.1.1 is used, it'll state "Unknown Date". spawn_date = -1.1.1
spawn_chance MTTH Decides whether an artifact spawn should execute or not. Range is 0-100. Default behaviour is to always spawn.
# 50% chance to execute an artifact spawn
spawn_chance = {
	value = 50
}
weight MTTH Character scope, evaluates a potential artifact holder score, which is then used for randomizing who gets an artifact. Default behavior is for everyone to have the same chance.
# Only christians have a chance of getting an artifact
weight = {
	value = 0
	additive_modifier = {
		value = 100
		religion_group = christian
	}
}
artifacts clause List of keys and MTTH for which artifact is spawned.
# 50% chance that the person will get a golden_platypus
artifacts ={
	golden_platypus = {
		value = 1
	}
	crystal_platypus = {
		value = 1
	}
}

Migrate from traits

Here is the equivalence to replace traits into artifacts:

Behavior Trait Artifact
Possession has_trait = xxx has_artifact = xxx
Creation add_trait = xxx add_artifact = xxx
Destruction remove_trait = xxx destroy_artifact = xxx
Transfer
FROM = {
	remove_trait = xxx
}
ROOT = {
	add_trait = xxx
}
random_artifact = {	
	artifact_type = xxx
	transfer_artifact = {
		from = FROM
		to = ROOT
	}
}
Uniqueness xxx = { cached = yes } trait, and xxx = { always = yes } ?

References