Conditions (M2-Scripting)
Conditions are the parameters in scripting used to test for the existence of certain situations, in order to execute the script. They are used to narrow the firing of a script down to a required set of triggers which must come back true in order for the script to be fired. A knowledge of the conditions available allows a scripter to tailor their scripts to very precise situations. Some conditions requires certain triggers in order to be executed, which the event they are using has to export, or the condition can not apply to it.
These trigger requirements 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.
Conditions Table
Identifier | Trigger Requirements | Parameters | Battle | Strat |
---|---|---|---|---|
PercentageOfArmyKilled | character_record | Logic Token, Test Value | Yes | Yes |
BattlePlayerMountClass | player_unit | Mount Class | Yes | Yes |
LosingMoney | None | None | No | Yes |
GeneralFoughtCulture | character_record | Culture Type | Yes | Yes |
Identifier | Trigger Requirements | Parameters | Battle | Strat |
Template: |Identifier||Trigger Requirements||Parameters||Battle||Strat
Parameters
This section is incomplete
Descriptions for how each parameter is determined and input will be added, and some similar may be combined. The current order is the order taken from the CA DocuDemons, they will be more properly organized by category/usage later on.
None - To Be Amended
Logic Token - To Be Amended
Test Value - To Be Amended
Percentage - To Be Amended
Army Index - To Be Amended
Alliance Index - To Be Amended
Unit Category - To Be Amended
Faction Type - To Be Amended
Culture Type - To Be Amended
Conflict Type - To Be Amended
Success Type - To Be Amended
Siege Engine Class - To Be Amended
Tower Defence Type - To Be Amended
Wall Level - To Be Amended
Building Type - To Be Amended
Gate Strength - To Be Amended
Unit Class - To Be Amended
Siege Engine Category - To Be Amended
Formation - To Be Amended
Special Ability - To Be Amended
Mount Class - To Be Amended
Action Status - To Be Amended
Attack Direction - To Be Amended
Hide Type - To Be Amended
Unit Label - To Be Amended
Other Unit Label - To Be Amended
Position X - To Be Amended
Position Y - To Be Amended
Distance - To Be Amended
Location 1 - To Be Amended
Location 2 - To Be Amended
Attacker Unit Label - To Be Amended
Target Unit Label - To Be Amended
Radius - To Be Amended
Group Label - To Be Amended
Target Group Label - To Be Amended
Unit Match Type - To Be Amended
Attribute - To Be Amended
Value(float) - To Be Amended
Trait Description - To Be Amended
Level - To Be Amended
Character Type - To Be Amended
Event Type - To Be Amended
Character Faction Type - To Be Amended
Original Faction Type - To Be Amended
Original Culture Type - To Be Amended
Character - To Be Amended
Action - To Be Amended
Distance In Squares - To Be Amended
Religion - To Be Amended
Turns - To Be Amended
Religion Percentage - To Be Amended
Heresy Percentage - To Be Amended
Ancillary Name/Type - To Be Amended
Ransom Type - To Be Amended
Age - To Be Amended
Tax Level - To Be Amended
Success Level - To Be Amended
Stance - To Be Amended
Score Type - To Be Amended
Quantity - To Be Amended
Mission ID - To Be Amended
Turns Remaining - To Be Amended
Source ID - To Be Amended
Transgression Name - To Be Amended
Forgiveness Name - To Be Amended
AI Label - To Be Amended
Event Name - To Be Amended
PositionInRect - To Be Amended
Crusade Outcome - To Be Amended
Difficulty - To Be Amended
Settlement Name - To Be Amended
Building Description - To Be Amended
Plug-In - To Be Amended
Loyalty Value - To Be Amended
Build Type - To Be Amended
Auto-management Type - To Be Amended
Castle/City - To Be Amended
Advice Thread - To Be Amended
Trigger Name - To Be Amended
Message Identifier - To Be Amended
Element ID - To Be Amended
Function ID - To Be Amended
Scroll ID - To Be Amended
Button ID - To Be Amended
UI Element ID - To Be Amended
Script Counter - To Be Amended
Timer ID - To Be Amended
Duration - To Be Amended
Sound Event Tag - To Be Amended