Difference between revisions of "Events (M2-Scripting)"
m (Protected "Events (M2-Scripting)": Protected until template is complete [edit=sysop:move=sysop]) |
m (m2 logo) |
||
(14 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | This | + | {{M2TW Modding Logo}} |
+ | __TOC__ | ||
+ | |||
+ | '''Events''' are the parameters in scripting used to determine the interval at which the script is checked for in order to fire. They are used to fire a script at a proper time during the game process, such as at the end of a battle, the start of a turn, or the death of a general. The event is what enables most scripts to work, by finding the proper time to trigger the script. In determining which event to use, you should consider which Conditions you want to use, and insure the event exports the triggers that those conditions require, or the script won't work as intended. | ||
+ | |||
+ | '''These trigger exports are:''' character_record, nc_character_record, player_unit, enemy_unit, infer_defending_unit, infer_attacking_unit, resource_description, character_action_advice, target_character_record, ransom_type, captured_faction_info, faction, target_faction, unit, mission_success_level, mission_details, event_counter, sm_position, region_id, target_region_id, crusade, target_religion, settlement, target_settlement, prior_build, best_finance_option, advised_build, fort, army, event, religion, event_type. | ||
+ | |||
+ | ''Events usually export more than one trigger, the most common triggers required from an event are listed here: [[Required Triggers (M2-Scripting)]]'' | ||
+ | |||
+ | == Events Table == | ||
+ | |||
+ | ''This table is a Work in Progress - Current Progress: 10/214'' | ||
+ | |||
+ | Sortable table, click header to sort column: | ||
+ | |||
+ | {|class="wikitable sortable" border="1" cellpadding="4" cellspacing="0" | ||
+ | |+ style="background:#bfc0f7;" |'''Medieval II DocuDemons - Events''' | ||
+ | ! style="background:#bfc0f7;" |Identifier!!style="background:#bfc0f7;" |character_record!!style="background:#bfc0f7;" |faction!!style="background:#bfc0f7;" |settlement!!style="background:#bfc0f7;" |enemy_unit!!style="background:#bfc0f7;" |player_unit!!style="background:#bfc0f7;" |target_faction!!style="background:#bfc0f7;" |resource_description!!style="background:#bfc0f7;" |region_id!!style="background:#bfc0f7;" |Other | ||
+ | |- | ||
+ | |[[PreBattle (M2-Scripting)|PreBattle]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||[[nc_character_record (M2-Scripting)|nc_character_record]], [[character_type (M2-Scripting)|character_type]] | ||
+ | |- | ||
+ | |[[PreBattleWithdrawal (M2-Scripting)|PreBattleWithdrawal]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||[[nc_character_record (M2-Scripting)|nc_character_record]], [[character_type (M2-Scripting)|character_type]] | ||
+ | |- | ||
+ | |[[BattleAiCommenced (M2-Scripting)|BattleAiCommenced]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleDelayPhaseCommenced (M2-Scripting)|BattleDelayPhaseCommenced]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleDeploymentPhaseCommenced (M2-Scripting)|BattleDeploymentPhaseCommenced]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleConflictPhaseCommenced (M2-Scripting)|BattleConflictPhaseCommenced]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattlePlayerUnitAttacksEnemyUnit (M2-Scripting)|BattlePlayerUnitAttacksEnemyUnit]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[infer_attacking_unit (M2-Scripting)|infer_attacking_unit]], [[infer_defending_unit (M2-Scripting)|infer_defending_unit]] | ||
+ | |- | ||
+ | |[[BattleEnemyUnitAttacksPlayerUnit (M2-Scripting)|BattleEnemyUnitAttacksPlayerUnit]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[infer_attacking_unit (M2-Scripting)|infer_attacking_unit]], [[infer_defending_unit (M2-Scripting)|infer_defending_unit]] | ||
+ | |- | ||
+ | |[[BattlePlayerAttacksSettlementBuilding (M2-Scripting)|BattlePlayerAttacksSettlementBuilding]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[infer_attacking_unit (M2-Scripting)|infer_attacking_unit]], [[building_battle (M2-Scripting)|building_battle]] | ||
+ | |- | ||
+ | |[[BattleEnemyAttacksSettlementBuilding (M2-Scripting)|BattleEnemyAttacksSettlementBuilding]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[infer_attacking_unit (M2-Scripting)|infer_attacking_unit]], [[building_battle (M2-Scripting)|building_battle]] | ||
+ | |- | ||
+ | |[[BattleUnitGoesBerserk (M2-Scripting)|BattleUnitGoesBerserk]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[unit (M2-Scripting)|unit]] | ||
+ | |- | ||
+ | |[[BattlePlayerUnitGoesBerserk (M2-Scripting)|BattlePlayerUnitGoesBerserk]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleEnemyUnitGoesBerserk (M2-Scripting)|BattleEnemyUnitGoesBerserk]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleUnitRouts (M2-Scripting)|BattleUnitRouts]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[unit (M2-Scripting)|unit]] | ||
+ | |- | ||
+ | |[[BattlePlayerUnitRouts (M2-Scripting)|BattlePlayerUnitRouts]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleEnemyUnitRouts (M2-Scripting)|BattleEnemyUnitRouts]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattlePlayerSiegeEngineDestroyed (M2-Scripting)|BattlePlayerSiegeEngineDestroyed]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[BattleEnemySiegeEngineDestroyed (M2-Scripting)|BattleEnemySiegeEngineDestroyed]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||None | ||
+ | |- | ||
+ | |[[PostBattle (M2-Scripting)|PostBattle]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||[[nc_character_record (M2-Scripting)|nc_character_record]], [[character_type (M2-Scripting)|character_type]] | ||
+ | |- | ||
+ | |[[PostBattle (M2-Scripting)|PostBattle]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[army (M2-Scripting)|army]] | ||
+ | |-class="sortbottom" | ||
+ | |Identifier||character_record||faction||settlement||enemy_unit||player_unit||target_faction||resource_description||region_id||Other | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | '''Template:''' |[[Identifier (M2-Scripting)|Identifier]]||<span title="character_record" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||<span title="settlement" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="enemy_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="player_unit" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="target_faction" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="resource_description" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>No</span>||<span title="region_id" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>Yes</span>||[[Other (M2-Scripting)|Other]]]] | ||
+ | |||
+ | == See Also == | ||
+ | *[[Conditions (M2-Scripting)]] - For information on Conditions and links to Condition pages | ||
+ | *[[Modding:Coding]] | ||
+ | |||
+ | == External Links == | ||
+ | *[https://www.twcenter.net/forums/showthread.php?118578-M2TW-Ultimate-Docudemons-4-0 Ultimate DocuDemons 4.0] | ||
+ | *[https://www.twcenter.net/forums/downloads.php?do=file&id=1681 Kingdoms Docudemons (list of commands etc.)] | ||
+ | *[https://www.twcenter.net/forums/forumdisplay.php?f=743 J@mes TWC-U Scripting Class] | ||
+ | *[http://forums.totalwar.org/vb/showthread.php?t=82855 alpaca's Script-o-Rama] | ||
+ | *[https://www.twcenter.net/forums/showthread.php?t=176050 GrnEyedDvl's Scripts n' Stuff] | ||
+ | *[http://forums.totalwar.org/vb/showthread.php?t=77177 alpaca's Beginner Scripting Tutorial] | ||
+ | |||
+ | |||
+ | [[Category:M2TW Scripting]] |
Latest revision as of 23:47, 25 May 2020
Contents
Events are the parameters in scripting used to determine the interval at which the script is checked for in order to fire. They are used to fire a script at a proper time during the game process, such as at the end of a battle, the start of a turn, or the death of a general. The event is what enables most scripts to work, by finding the proper time to trigger the script. In determining which event to use, you should consider which Conditions you want to use, and insure the event exports the triggers that those conditions require, or the script won't work as intended.
These trigger exports are: character_record, nc_character_record, player_unit, enemy_unit, infer_defending_unit, infer_attacking_unit, resource_description, character_action_advice, target_character_record, ransom_type, captured_faction_info, faction, target_faction, unit, mission_success_level, mission_details, event_counter, sm_position, region_id, target_region_id, crusade, target_religion, settlement, target_settlement, prior_build, best_finance_option, advised_build, fort, army, event, religion, event_type.
Events usually export more than one trigger, the most common triggers required from an event are listed here: Required Triggers (M2-Scripting)
Events Table
This table is a Work in Progress - Current Progress: 10/214
Sortable table, click header to sort column:
Identifier | character_record | faction | settlement | enemy_unit | player_unit | target_faction | resource_description | region_id | Other |
---|---|---|---|---|---|---|---|---|---|
PreBattle | Yes | Yes | No | No | No | No | No | Yes | nc_character_record, character_type |
PreBattleWithdrawal | Yes | Yes | No | No | No | No | No | Yes | nc_character_record, character_type |
BattleAiCommenced | No | Yes | No | No | No | No | No | No | None |
BattleDelayPhaseCommenced | No | Yes | No | No | No | No | No | No | None |
BattleDeploymentPhaseCommenced | No | Yes | No | No | No | No | No | No | None |
BattleConflictPhaseCommenced | No | Yes | No | No | No | No | No | No | None |
BattlePlayerUnitAttacksEnemyUnit | No | No | No | Yes | Yes | No | No | No | infer_attacking_unit, infer_defending_unit |
BattleEnemyUnitAttacksPlayerUnit | No | No | No | Yes | Yes | No | No | No | infer_attacking_unit, infer_defending_unit |
BattlePlayerAttacksSettlementBuilding | No | No | No | No | Yes | No | No | No | infer_attacking_unit, building_battle |
BattleEnemyAttacksSettlementBuilding | No | No | No | Yes | No | No | No | No | infer_attacking_unit, building_battle |
BattleUnitGoesBerserk | No | No | No | No | No | No | No | No | unit |
BattlePlayerUnitGoesBerserk | No | No | No | No | Yes | No | No | No | None |
BattleEnemyUnitGoesBerserk | No | No | No | Yes | No | No | No | No | None |
BattleUnitRouts | No | No | No | No | No | No | No | No | unit |
BattlePlayerUnitRouts | No | No | No | No | Yes | No | No | No | None |
BattleEnemyUnitRouts | No | No | No | Yes | No | No | No | No | None |
BattlePlayerSiegeEngineDestroyed | No | No | No | No | Yes | No | No | No | None |
BattleEnemySiegeEngineDestroyed | No | No | No | Yes | No | No | No | No | None |
PostBattle | Yes | Yes | No | No | No | No | No | Yes | nc_character_record, character_type |
PostBattle | No | No | No | No | No | No | No | No | army |
Identifier | character_record | faction | settlement | enemy_unit | player_unit | target_faction | resource_description | region_id | Other |
Template: |Identifier||Yes||Yes||No||No||No||No||No||Yes||Other]]
See Also
- Conditions (M2-Scripting) - For information on Conditions and links to Condition pages
- Modding:Coding