英語版のCKwikiのページ、[[Reading and understanding CK events>http://crusaderkings.kerak.com/wiki/index.php?title=Reading_and_understanding_CK_events]]より転載・翻訳中

#contents

----
もし他のパラドックスのゲーム、EU2とかHoIとかVictoriaとかに親しんでいたのであれば、CKのイベントシステムがそれらといささか異なっているとすぐに気付くでしょう。相違点は多いですが、主要な物は以下の通りです。

-史実イベントがCKにはありません。代わりに、イベントは状況によってトリガーされて発生します。どのぐらいの頻度で発生するかは、各種の条件(condition)によって修正を受けます。
-決まり切った進路で進むのでなく、何がどうなるのかはダイナミックに変化する
-イベントのタイプが異なる

それでは、基本的なイベントの構造から始めるとしましょうか...


** イベントのタイプ [#h39510ed]
CKには3つのイベントタイプがあります:キャラクターイベント(Character events)、プロヴィンスイベント(province events)そしてプロヴィンス間イベント(province_x_province events)です。

キャラクターイベントは、人物に関するイベントです。普通は、プレイ中の領主(ruler)に関するイベントか、もしくはその領主の宮廷内の人物に関するものです。それから、AIによってトリガーされたイベントを受けることもあるでしょう。例えば封臣(vassals)に関するものなどです。

プロヴィンスイベントはプロヴィンスに関するイベントです。これはプロヴィンスの所有者(owner)に対してのみ起きます。プレイヤーの場合、直轄領(demesne)のプロヴィンスで起きることになります。イベントのトリガーと(発生頻度の)修正は、プロヴィンスとその直接の領主によって左右されます。

プロヴィンス間イベントは「拡散イベント(spread events)」とも呼ばれます。これらのイベントは、ある一つのプロヴィンス(from province)から、そこに隣接するすべてのプロヴィンス(to province)へと、トリガーが成立すれば広がります。もし成立すれば、何かが対象のプロヴィンス(to province)で起きます。例えば、疫病が広まったり、技術が伝播したり、あるいは文化とか宗教が転向したりします。


** イベントの構造 [#bed858ea]
CKのイベントの構造は単純で、大きく5つの部分からなります。

 province_event = {
     id = 31993
 
     picture = "event_agriculture" 
 
     trigger = { condition = { type = province value = 290 } } # Uppland
 
     mean_time_to_happen = { months = 6 }
 
     action_a = {
         effect = { type = prosperity value = -1 }
     }
 }
最初がIDで、二番目にイベントの画像、三番目にトリガー、四番目にMTTH、最後が影響(action)です。それでは、これらを順を追って見ていきましょう。



** Event ID/イベントID [#xb1b0b09]
これはゲームでイベントを識別・同定するために使われている数字です。各イベントについて固有のものであり、それからParadoxの常で、10000より大きなIDは自由に使えるように空けられています。

** Event picture/イベント画像 [#dc25795c]
そのイベントで使われる画像を指定する部分です:
     picture = "event_agriculture" 
これはリンクの一種で、ゲームに対して、.\gfx\interface\events\フォルダに入ってるどの画像を使うかを伝えます。*.bmpファイルの名前を入れてやります。例えば上記の例では、''event_agriculture.bmp''ファイルが参照されます。
このファイルは320*165ピクセルで、24ビットの標準的なウィンドウズBMPフォーマットです。

** Triggers/イベントのトリガー [#fe7c3b44]
ここには、MTTHを計算し始める前に必要なトリガーとなる状態(condition)を入れます。
 trigger = { condition = { type = province value = 290 } } # Uppland
上記の場合、このイベントはUppland(日本語版ではウップランド)でのみMTTHを数え始めます。なお、#の後ろに書いたものは、ゲーム上は無視されます。ここでは将来の修正に備えてコメントを入れるのに使っています。


** MTTH and dynamic polling/MTTHと動的な変化 [#m7e15ce4]
CKでは、イベントは定められた日とか期間になっただけで発生するようなイベントは存在しません。日付はトリガーの一部にはなりますが、だからといってそれはイベントがその日に起きることを保証する物ではありません。代わりに、トリガーとなる条件を決め、MTTHこと''mean time to happend''と、それを修正するファクターを指定します。

So, what exactly ''is'' this MTTH? The concept of ''mean time to happend'' comes from the field of statistics, and is often used in reliability and maintainability analyses of materials and components in the form of MTTF (mean time to failure). In short, it gives a statistic probability for an event to happend over a period of time, providing you have a large sample of events.  Related to CK events, it defines the probability of a certain event to happend. When an event is polled, the modified MTTH value is plugged into a formula that determines the odds of an event firing and then compared to the result of a RNG to see if it fires in the particular instance. This means that compared to the EU2/HoI/Victoria system, events are not tracked to see how many times it has been tested for someone (or some province) and thus puts far less strain on CPU and memory resources. Instead, as a rule of thumb (athough not strictly an accurate one), one can assume that during any given year of game play each character and each province will be tested about 3 or 4 times for every event. 

Any event you make must have a MTTH value defined, in days, months or years. It is recommended that you avoid using very large or very small numbers since in testing it has been observed some "clipping" due to processor rounding. Also, due to some code optimising, the MTTH values are slightly skewed, and you should use values about 25% lower than intended.

*** MTTH modifiers/MTTHの修正値 [#x53cabf0]
In most cases, one would want the events to happend sooner in some situations than in others. It would e.g. make more sense for a child to die in infancy if it was sick compared to a healthy child. Consider the event:
 character_event = {
     id = 999
 
     picture = "event_plague"
 
     trigger = {
         condition = {
             type = not
             value = { type = age value = 2 }
         }
     }
 
     mean_time_to_happen = {
         months = 120
 
         '''modifier = {'''
             '''condition = { type = trait value = illness }'''
             '''factor = 0.2'''
         '''}'''
     }
 
     immidiate = {
         effect = { type = death }
     }
 }
In this event, the MTTH to a health infant (< 2 years) is 120 months, while any child with the ''illness'' trait has an MTTH of 120*0.2 = 24 months.

This way, we can define a set of modifiers that will decrease (if < 1) or increase (if > 1) the MTTH of an event.

**Effects/イベントの効果 [#j46aa539]
イベントはいろいろな効果(effect)を引き起こします。イベントの効果を記述するには、二つの異なる方法があります。

-To have one or more choices made avaliable to the recipient of the event, each with different effects
-To have the event take effect with no interaction with its recipient. 


***Multiple Options [#j5aa90ad]
This method makes one or more option avaliable to the recipient of an event. In the event code these options are refferd to as ''actions'', beginnig at ''action_a'', and progressing down the alphabet, with each letter marking a new action.
     action_a = {
         effect = { type = prosperity value = -1 }
     }
This action will cause the prosperity of the province affected to fall by 1. Some events will have more than one action, however, such as this one from a character event by Cat Lord:
 action_a = {
 	effect = { type = loyalty value = -0.5 }
 }
 
 action_b = {
 	effect = { 
 		type = random 
 		chance = 25
 		effect = {
 				type = add_trait
 				value = forgiving
 		}
 	}
 }
Here the recipient would have two choices:
-To have his or her loyalty to his (or her) liege reduced by 50%, or... [#ge3ae909]
-To have a 25% chance of gaining the ''forgiving'' trait [#ae66c1b5]
Actions can also each have multiple effects, as in this (character event) example from event 1194 in Claims_Events.txt:
 action_a = 
 	effect = { type = add_title_claim value = random_neighbor }
 	effect = { type = death value = spouse }
 	effect = { type = add_trait value = vengeful }
 }
This action has the effect of giving the recipient a claim on one of his (or her) neighbors, while also causing the death of his (or her) wife (or husband), and giving him (or her) the ''vengeful'' trait.

****AI Modifiers/AIの修正 [#k970e4ef]
Events with multiple options can include modifiers within the options to influence the chance of an AI - that is computer-controlled - recipient choosing that particluar action, as can be seen in the complete version of the above example from event 1194 in Claims_Events.txt:
 action_a = 
        ai_chance = 50
 	effect = { type = add_title_claim value = random_neighbor }
 	effect = { type = death value = spouse }
 	effect = { type = add_trait value = vengeful }
 }
An AI recipient would have a 50% chance of choosing this action. Multiple actions can have various probabilities, as seen in this action group by Cat Lord:
 action_a = {
 	ai_chance = 36
 	effect = { type = prestige value = 10 }
 }
 action_b = {
 	ai_chance = 50
 	effect = { type = piety value = 10 }
 }
 action_c = {
 	ai_chance = 32
 	effect = { type = piety value = 5 }
 	effect = { type = prestige value = 5 }
 }
For this event the AI would have a 36% chance of choosing action a, a 50% chance of choosing action b, and a 32% chance of choosing action c. however, these likelihoods can be further modified, like so:
 action_a = {
 	ai_chance = 36
 		#start AI modifier block
 		modifier = {
 			condition = { type = not value = { type = diplomacy value = 2 } }
 			factor = 1.5
 		}
 		modifier = {
 			condition = { type = not value = { type = diplomacy value = 4 } }
 			factor = 1.5
 		}
 		#end AI modifier block
 	effect = { type = prestige value = 10 }
 }
 action_b = {
 	ai_chance = 50
 		#start AI modifier block
 		modifier = {
 			condition = { type = not value = { type = diplomacy value = 4 } }
 			factor = 0.75
 		}
 		modifier = { 
 			condition = { type = diplomacy value = 7 }
 			factor = 0.75
 		}
 		#end AI modifier block
 	effect = { type = piety value = 10 }
 }
 action_c = {
 	ai_chance = 32
 		#start AI modifier block
 		modifier = { 
 			condition = { type = diplomacy value = 7 }
 			factor = 1.5
 		}
 		modifier = { 
 			condition = { type = diplomacy value = 9 }
 			factor = 1.5
 		}
 		#end AI modifier block
 	effect = { type = piety value = 5 }
 	effect = { type = prestige value = 5 }
 }
In this action group the likelihood of the AI to choose various actions is influenced by the AI character's diplomacy attribute. To take the modifiers on action as a case study, the likelihood of the AI to choose action a would be multiplied by 1.5 if the AI character had a diplomacy attribute of less than 2, and would be multiplied by a further 1.5 if the AI character had a diplomacy value of less than 4. 
Thus, the new AI chances of choosing a particular option are shown on this table:
|''Diplo value''|''Chance of choosing action_a''|''Chance of choosing action_b''|''Chance of choosing action_c''|
|<2|72%|37.5%|32|
|2-3|48%|37.5%|32%|
|4-6|32%|50%|32%|
|7-8|32%|37.5%|48%|
|9+|32%|37.5%|72%|

***Immediate Effects/直接の効果 [#d2431d4a]
'''''Note:''''' ''This information may be incorrect. Could someone who is sure either correct this, or delete this note?''<br/>
<br/>
Some events can have an effect without being seen in game. The syntax for this type of effect can be seen in this event by Cat Lord:
 ######################
 # Insult your vassal #
 ######################
 
 character_event = {
 	id = 10000
 	
 	picture = "event_intrigue"
 	
 	trigger = {
 		condition = { type = trait value = arbitrary }
 		condition = { type = has_vassal }
 	}
 
 	mean_time_to_happen = {
 		months = 900
 
 		# Personal trait modifiers:
 
 		modifier = {
 			condition = { type = trait value = energetic }
 			factor = 0.8
 		}
 
 		modifier = {
 			condition = { type = trait value = lazy }
 			factor = 1.2
 		}
 	}
 
 	'''''immidiate = {#You're a scum !'''''
 		'''''effect = { type = trigger for = random_vassal value = 10001 }'''''
 		'''''}'''''
 }
In this event the triggering of event 10001 is done automatically, without the event popping up in the game screen (assuming the event occurs to a human player).

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS