Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Events (M2-Scripting)"

From TWC Wiki
Jump to navigationJump to search
m
m
Line 35: Line 35:
 
|[[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]]
 
|[[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]]
+
|[[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|no}}}|no||style="border-bottom:1px dotted"}}>No</span>||[[infer_attacking_unit (M2-Scripting)|infer_attacking_unit]], [[building_battle (M2-Scripting)|building_battle]]
 
|-class="sortbottom"
 
|-class="sortbottom"
 
|Identifier||character_record||faction||settlement||enemy_unit||player_unit||target_faction||resource_description||region_id||Other
 
|Identifier||character_record||faction||settlement||enemy_unit||player_unit||target_faction||resource_description||region_id||Other

Revision as of 07:15, 15 December 2008

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, if you would like to help out, please PM Augustus Lucifer. Help is encouraged, but in order to make sure a event isn't added twice or skipped, help needs to be coordinated. Thank you.

Current Progress: 10/214

Medieval II DocuDemons - Events
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
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

External Links