Event can be used to diplay description, trigger, trigger condition and options of an event in a compact infobox.
Parameter
Parameter | Description | Default | Status |
---|---|---|---|
version | To specify the major patch for which the event was written or updated. | empty | required |
event_id | Event identification code as it appears in the file to serve as an anchor | empty | optional |
event_name | Title of the event. | empty | required |
cond_event_text | Set to "yes" if the event has multiple descriptions available for use. | empty | optional |
event_text | In-game description text of the event. If multiple descriptions exist then use only the default or the first one. | empty | optional, but desired |
fire_only_once | As in the script code - set to "yes" if the event happens only once during a campaign. | empty | optional |
mtth | For the base weight and its modifiers of MTTH-events. | empty | One of theses two is required. |
triggered only | To specify the trigger of 'triggered only'-events. | empty | |
trigger | Trigger conditions of the event. |
|
optional |
immediate | The immediate effects of the event. | empty | optional |
option conditions | If set to 『yes』 the section heading 'Option conditions' for events with conditional options is displayed. | empty | optional |
options | The possible effects of the event. Please use {{option}} .
|
empty | required |
after | Effects that happen after selecting any option. | empty | optional |
collapse | Whether to collapse the event. If set to 『yes』 the content will be collapsed. (Please use collapsed content on country pages.) |
empty | optional |
Usage
{{Event |version = |event_id = |event_name = |event_text = <!-- optional, but desired --> |trigger = |mtth = <!-- for Mtth events --> |triggered only = <!-- for triggered only events --> |immediate = <!-- optional for immediate effects --> |options = <!-- options use {{option}} template --> }}
Note: Please use either 「mtth」-parameter or 「triggered only」-parameter.
Examples
MTTH event
The following code
{{Event | version = 1.0 | event_id = news.67 | event_name = The Games of the XII Olympiad | event_text = The twelfth Olympic Games were recently held in Tokyo, Japan. In light of rising international tensions, many feared the Games would be canceled, but this has proven not to be the case. <br/><br/>Tokyo is the first non-Western city to host the Olympics, and a special purpose-built Me 261 long-range aircraft carried the Olympic Flame there from Germany without refueling.<br/><br/>Japanese athletes did well, and their 14 gold medals earned them a third place in the medal count, after Germany and the United States. | trigger = * Date is after 1940.10.5 * Global flag ''olympics_1936'' is set * Global flag ''olympics_fin_1940'' is not set * Global flag ''olympics_jap_1940'' is not set * The following nations exist ''and'' at peace: ** {{flag|Germany}} ** {{flag|Japan}} ** {{flag|United States}} * {{flag|France}} at peace * {{flag|United Kingdom}} at peace | mtth = * 2 days | immediate = * Set global flag ''olympics_jap_1940'' | options = {{Option | option_text = The Games are concluded. }} | collapse = no }}
will display:
The Games of the XII Olympiad
這條信息可能已不適合當前版本,最後更新於1.0。 |
The twelfth Olympic Games were recently held in Tokyo, Japan. In light of rising international tensions, many feared the Games would be canceled, but this has proven not to be the case.
Tokyo is the first non-Western city to host the Olympics, and a special purpose-built Me 261 long-range aircraft carried the Olympic Flame there from Germany without refueling.
Japanese athletes did well, and their 14 gold medals earned them a third place in the medal count, after Germany and the United States.
Trigger conditions | Mean time to happen
|
Immediate effects
| |
The Games are concluded.
|
Triggered only event
The following code
{{Event | version = 1.3 | event_id = bulgaria.1 | event_name = Treaty of Craiova - Romania Agrees | event_text = The Romanian government has accepted German Arbitration in our dispute. Southern Dobrudja has been reunited with Bulgaria! | triggered only = * Romanian event [[Romanian events#romania.5|''"Treaty of Craiova"'']] | options = {{Option | option_text = At last! | effect = * {{flag|Bulgaria}} gains ownership of the state Dobrudja (77) * Trigger news event [[News events 1#news.21|''"Treaty of Craiova"'']] in 1 days }} }}
will display:
Treaty of Craiova - Romania Agrees
這條信息可能已不適合當前版本,最後更新於1.3。 |
The Romanian government has accepted German Arbitration in our dispute. Southern Dobrudja has been reunited with Bulgaria!
Trigger conditions
|
Is triggered only by
|
At last!
|
Event with conditional options
The following code
{{Event | version = 1.0 | event_id = news.61 | event_name = The Fate of Czechoslovakia | cond_event_text = * Global flag ''end_of_czechoslovakia'' is set | event_text = German troops crossed into Bohemia and Moravia recently, ostensibly to restore order to the regions in the wake of the collapsing Czechoslovakian government. <br/><br/>In Prague, the occupying forces announced the creation of an 'autonomous protectorate' within [GER.GetNameDef]. Hungarian forces, operating with the consent of Germany, have marched into Slovakia and annexed it into Hungary. <br/><br/>The nation of Czechoslovakia is no more. | triggered only = * German event [[German events#germany.56|''"The Partition of Czechoslovakia"'']] | option conditions = yes | options = {{Option | option_text = So much for peace. | trigger = * Is ''not'': ** {{flag|France}} ** {{flag|Germany}} ** {{flag|Hungary}} ** {{flag|United Kingdom}} }} {{Option | option_text = The Czechs must be protected from themselves. | trigger = Is {{flag|Germany}} }} {{Option | option_text = This isn't what we agreed on! | trigger = Is {{flag|France}} ''or'' {{flag|United Kingdom}} }} {{Option | option_text = Hungary will be restored to its former glory! | trigger = Is {{flag|Hungary}} | end }} | collapse = no }}
The Fate of Czechoslovakia
這條信息可能已不適合當前版本,最後更新於1.0。 |
German troops crossed into Bohemia and Moravia recently, ostensibly to restore order to the regions in the wake of the collapsing Czechoslovakian government.
In Prague, the occupying forces announced the creation of an 'autonomous protectorate' within [GER.GetNameDef]. Hungarian forces, operating with the consent of Germany, have marched into Slovakia and annexed it into Hungary.
The nation of Czechoslovakia is no more.
Trigger conditions
|
Is triggered only by
|
Option conditions
Enabled if:
So much for peace.
Enabled if:
Is 請檢查模板名和國家代碼: The Czechs must be protected from themselves.
Enabled if:
Is 請檢查模板名和國家代碼: This isn't what we agreed on!
Enabled if:
Is 請檢查模板名和國家代碼: Hungary will be restored to its former glory!
|