Difference between revisions of "Conditions (M2-Scripting)"
m |
m |
||
Line 841: | Line 841: | ||
|- | |- | ||
|[[PercentageUnitAttribute (M2-Scripting)|PercentageUnitAttribute]]||[[character_record (M2-Scripting)|character_record]]||Unit Attribute||<span style="display:none">10</span>Yes||<span style="display:none">10</span>Yes | |[[PercentageUnitAttribute (M2-Scripting)|PercentageUnitAttribute]]||[[character_record (M2-Scripting)|character_record]]||Unit Attribute||<span style="display:none">10</span>Yes||<span style="display:none">10</span>Yes | ||
+ | |- | ||
+ | |[[CharacterAge (M2-Scripting)|CharacterAge]]||[[character_record (M2-Scripting)|character_record]]||Logic Token, Age||<span style="display:none">15</span>No||<span style="display:none">10</span>Yes | ||
|-class="sortbottom" | |-class="sortbottom" | ||
|Identifier||Trigger Requirements||Parameters||Battle||Strat | |Identifier||Trigger Requirements||Parameters||Battle||Strat |
Revision as of 23:35, 8 July 2009
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, religion, event_type.
Conditions which list more than one trigger requirement need both or all of them, not just one of those listed.
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 |
I_InBattle | None | None | Yes | Yes |
WonBattle | character_record | None | Yes | Yes |
I_WonBattle | None | Faction | Yes | Yes |
Routs | character_record | None | Yes | Yes |
Ally_Routs | character_record | None | Yes | Yes |
GeneralHPLostRatioinBattle | character_record | Logic Token, Test Value | Yes | Yes |
GeneralFoughtInCombat | character_record | None | Yes | Yes |
I_PercentageOfArmyKilled | None | Alliance Index, Army Index, Logic Token, Percentage | Yes | No |
PercentageEnemyKilled | character_record | Logic Token, Test Value | Yes | Yes |
PercentageBodyguardKilled | character_record | Logic Token, Test Value | Yes | Yes |
PercentageRoutedOffField | character_record | Logic Token, Test Value | Yes | Yes |
NumKilledGenerals | character_record | Logic Token, Test Value | Yes | Yes |
PercentageUnitCategory | character_record | Unit Category, Logic Token, Test Value | Yes | Yes |
NumFriendsInBattle | character_record | Logic Token, Test Value | Yes | Yes |
GeneralFoughtFaction | character_record | Faction Type | Yes | Yes |
GeneralNumKillsInBattle | character_record | Logic Token, Test Value | Yes | Yes |
NumEnemiesInBattle | character_record | Logic Token, Test Value | Yes | Yes |
I_ConflictType | None | Conflict Type | Yes | Yes |
IsNightBattle | None | None | Yes | Yes |
BattleSuccess | character_record | Success Type | Yes | Yes |
BattleOdds | character_record | Logic Token, Test Value | Yes | Yes |
WasAttacker | character_record | None | Yes | Yes |
I_BattleAiAttacking | None | None | Yes | No |
I_BattleAiAssaultingCrossing | None | None | Yes | No |
I_BattleAiAttackingSettlement | None | None | Yes | No |
I_BattleAiDefendingSettlement | None | None | Yes | No |
I_BattleAiDefendingHill | None | None | Yes | No |
I_BattleAiDefendingCrossing | None | None | Yes | No |
I_BattleAiScouting | None | None | Yes | No |
I_BattleIsRiverBattle | None | Integer | Yes | No |
I_BattleIsSiegeBattle | None | Integer | Yes | No |
I_BattleIsSallyOutBattle | None | Integer | Yes | No |
I_BattleIsFortBattle | None | Integer | Yes | No |
I_BattleAttackerNumSiegeEngines | None | Siege Engine Class | Yes | No |
I_BattleAttackerNumArtilleryCanPenetrateWalls | None | Logic Token, Number | Yes | No |
I_BattleDefenderNumNonMissileUnitsOnWalls | None | Logic Token, Number | Yes | No |
I_BattleDefenderNumMissileUnitsOnWalls | None | Logic Token, Number | Yes | No |
I_BattleSettlementWallsBreached | None | None | Yes | No |
I_BattleSettlementGateDestroyed | None | None | Yes | No |
I_BattleSettlementTowerDefence | None | Tower Defence Type | Yes | No |
I_BattleSettlementFortificationLevel | None | Wall Level | Yes | No |
BattleBuildingType | None | Building Type | Yes | No |
I_BattleSettlementGateStrength | None | Gate Strength | Yes | No |
I_BattleNumberOfRiverCrossings | None | Integer | Yes | No |
BattlePlayerUnitClass | player_unit | Unit Class | Yes | No |
BattleEnemyUnitClass | enemy_unit | Unit Class | Yes | No |
BattlePlayerUnitCategory | player_unit | Unit Category | Yes | No |
BattleEnemyUnitCategory | enemy_unit | Unit Category | Yes | No |
BattlePlayerUnitSiegeEngineClass | player_unit | Siege Engine Category | Yes | No |
BattleEnemyUnitSiegeEngineClass | enemy_unit | Siege Engine Category | Yes | No |
BattlePlayerUnitOnWalls | player_unit | None | Yes | No |
BattleEnemyUnitOnWalls | enemy_unit | None | Yes | No |
BattlePlayerCurrentFormation | player_unit | Formation | Yes | No |
BattleEnemyCurrentFormation | enemy_unit | Formation | Yes | No |
BattlePlayerUnitCloseFormation | player_unit | None | Yes | No |
BattleEnemyUnitCloseFormation | enemy_unit | None | Yes | No |
BattlePlayerUnitSpecialAbilitySupported | player_unit | Special Ability | Yes | No |
BattleEnemyUnitSpecialAbilitySupported | enemy_unit | Special Ability | Yes | No |
BattlePlayerUnitSpecialAbilityActive | player_unit | None | Yes | No |
BattleEnemyUnitSpecialAbilityActive | enemy_unit | None | Yes | No |
BattleEnemyMountClass | enemy_unit | Mount Class | Yes | No |
BattlePlayerUnitMeleeStrength | player_unit | Logic Token, Test Value | Yes | No |
BattleEnemyUnitMeleeStrength | enemy_unit | Logic Token, Test Value | Yes | No |
BattlePlayerUnitMissileStrength | player_unit | Logic Token, Test Value | Yes | No |
BattleEnemyUnitMissileStrength | enemy_unit | Logic Token, Test Value | Yes | No |
BattlePlayerUnitSpecialFormation | player_unit | Formation | Yes | No |
BattleEnemyUnitSpecialFormation | enemy_unit | Formation | Yes | No |
BattlePlayerUnitEngaged | player_unit | None | Yes | No |
BattleEnemyUnitEngaged | enemy_unit | None | Yes | No |
BattlePlayerActionStatus | player_unit | Action Status | Yes | No |
BattleEnemyActionStatus | enemy_unit | Action Status | Yes | No |
BattlePlayerUnitMovingFast | player_unit | None | Yes | No |
BattleEnemyUnitMovingFast | enemy_unit | None | Yes | No |
BattleRangeOfAttack | player_unit, enemy_unit | Logic Token, Test Value | Yes | No |
BattleDirectionOfAttack | infer_attacking_unit, infer_defending_unit | Logic Token, Attack Direction | Yes | No |
BattleIsMeleeAttack | infer_attacking_unit | None | Yes | No |
I_BattlePlayerArmyPercentageOfUnitClass | None | Unit Class, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageOfUnitClass | None | Unit Class, Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyPercentageOfUnitCategory | None | Unit Category, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageOfUnitCategory | None | Unit Category, Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyPercentageOfMountClass | None | Mount Class, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageOfMountClass | None | Mount Class, Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyPercentageOfClassAndCategory | None | Unit Class, Unit Category, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageOfClassAndCategory | None | Unit Class, Unit Category, Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyPercentageOfSpecialAbility | None | Special Ability, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageOfSpecialAbility | None | Special Ability, Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyPercentageCanHide | None | Hide Type, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageCanHide | None | Hide Type, Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyPercentageCanSwim | None | Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageCanSwim | None | Logic Token, Percentage | Yes | No |
I_BattlePlayerArmyIsAttacker | None | None | Yes | No |
I_BattlePlayerAllianceOddsInFavour | None | Logic Token, Integer | Yes | No |
I_BattlePlayerAllianceOddsAgainst | None | Logic Token, Integer | Yes | No |
TotalSiegeWeapons | character_record | Logic Token, Number | No | Yes |
I_BattleStarted | None | None | Yes | No |
I_IsUnitMoveFastSet | None | Unit Label | Yes | No |
I_IsUnitMoving | None | Unit Label | Yes | No |
I_IsUnitIdle | None | Unit Label | Yes | No |
I_UnitStatus | None | Unit Label, Action Status | Yes | No |
I_IsUnitRouting | None | Unit Label | Yes | No |
I_IsUnitUnderFire | None | Unit Label | Yes | No |
I_IsUnitEngaged | None | Unit Label | Yes | No |
I_IsUnitEngagedWithUnit | None | Unit Label, Other Unit Label | Yes | No |
I_UnitFormation | None | Unit Label, Logic Token, Formation Type | Yes | No |
I_PercentageUnitKilled | None | Unit Label, Logic Token, Percentage | Yes | No |
I_UnitPercentageAmmoLeft | None | Unit Label, Logic Token, Percentage | Yes | No |
I_UnitDistanceFromPosition | None | Unit Label, Position X, Position Y, Logic Token, Distance | Yes | No |
I_UnitOrderedToPosition | None | Unit Label, Position X, Position Y, Logic Token, Distance | Yes | No |
I_UnitDistanceFromLine | None | Unit Label, Location 1, Location 2, Logic Token, Distance | Yes | No |
I_UnitDistanceFromUnit | None | Unit Label 1, Unit Label 2, Logic Token, Distance | Yes | No |
I_UnitInRangeOfUnit | None | Attacker Unit Label, Target Unit Label | Yes | No |
I_UnitDestroyed | None | Unit Label | Yes | No |
I_UnitEnemyUnitInRadius | None | Unit Label, Radius | Yes | No |
I_IsUnitGroupMoving | None | Group Label | Yes | No |
I_IsUnitGroupEngaged | None | Group Label | Yes | No |
I_IsUnitGroupIdle | None | Group Label | Yes | No |
I_IsUnitGroupDestroyed | None | Group Label | Yes | No |
I_PercentageUnitGroupKilled | None | Group Label, Logic Token, Percentage | Yes | No |
I_UnitGroupFormation | None | Group Label, Logic Token, Formation Name | Yes | No |
I_UnitGroupDistanceFromPosition | None | Group Label, Position, Logic Token, Distance | Yes | No |
I_UnitGroupDistanceFromGroup | None | Group Label, Target Group Label, Logic Token, Distance | Yes | No |
I_UnitGroupInRangeOfUnit | None | Group Label, Target Unit Label | Yes | No |
I_UnitInRangeOfUnitGroup | None | Group Label, Target Group Label | Yes | No |
I_UnitGroupInRangeOfUnitGroup | None | Group Label, Target Group Label | Yes | No |
I_PlayerInRangeOfUnitGroup | None | Group Label | Yes | No |
I_PlayerInRangeOfUnit | None | Unit Label | Yes | No |
I_UnitTypeSelected | None | Unit Type | Yes | No |
UnitType | resource_description | Unit Type | Yes | Yes |
I_UnitSelected | None | Unit Label | Yes | No |
I_MultipleUnitsSelected | None | None | Yes | No |
I_SpecificUnitsSelected | None | Unit Label 1, Unit Label 2, Unit Label 3, ... | Yes | No |
I_IsCameraZoomingToUnit | None | Unit Label | Yes | No |
I_BattleEnemyArmyPercentageOfMatchingUnits | None | Unit Match Type, Logic Token, Test Value | Yes | No |
I_BattleEnemyArmyNumberOfMatchingUnits | None | Unit Match Type, Logic Token, Test Value | Yes | No |
I_BattlePlayerArmyPercentageOfMatchingUnits | None | Unit Match Type, Logic Token, Test Value | Yes | No |
I_BattlePlayerArmyNumberOfMatchingUnits | None | Unit Match Type, Logic Token, Test Value | Yes | No |
I_BattlePlayerArmyNumberOfUnitClass | None | Unit Class, Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberOfUnitClass | None | Unit Class, Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberOfUnitCategory | None | Unit Category, Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberOfUnitCategory | None | Unit Category, Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberOfMountClass | None | Mount Class, Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberOfMountClass | None | Mount Class, Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberOfClassAndCategory | None | Unit Class, Unit Category, Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberOfClassAndCategory | None | Unit Class, Unit Category, Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberOfSpecialAbility | None | Special Ability, Integer | Yes | No |
I_BattleEnemyArmyNumberOfSpecialAbility | None | Special Ability, Integer | Yes | No |
I_BattlePlayerArmyNumberCanHide | None | Hide Type, Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberCanHide | None | Hide Type, Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberCanSwim | None | Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberCanSwim | None | Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberOfUnits | None | Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberOfUnits | None | Logic Token, Integer | Yes | No |
I_BattlePlayerArmyNumberOfAttribute | None | Attribute, Logic Token, Integer | Yes | No |
I_BattleEnemyArmyNumberOfAttribute | None | Attribute, Logic Token, Integer | Yes | No |
I_BattlePlayerArmyPercentageOfAttribute | None | Attribute, Logic Token, Percentage | Yes | No |
I_BattleEnemyArmyPercentageOfAttribute | None | Attribute, Logic Token, Percentage | Yes | No |
I_IsBattleSettlementCastle | None | None | Yes | No |
I_BattleSpeed | None | Logic Token, Value(float) | Yes | No |
Trait | character_record | Trait Description, Logic Token, Level | Yes | Yes |
FatherTrait | character_record | Trait Description, Logic Token, Level | Yes | Yes |
FatherAttribute | character_record | Attribute Description, Logic Token, Level | No | Yes |
FactionLeaderTrait | character_record | Trait Description, Logic Token, Level | Yes | Yes |
FactionLeaderAttribute | character_record | Attribute Description, Logic Token, Level | Yes | Yes |
ReligionShift | character_record | Logic Token, Level | No | Yes |
PopulationConverted | character_record | Logic Token, Level | No | Yes |
DistanceCapital | character_record | Logic Token, Level | No | Yes |
Attribute | character_record | Attribute Description, Logic Token, Level | Yes | Yes |
RemainingMPPercentage | character_record | Logic Token, Level | No | Yes |
I_RemainingMPPercentage | None | Logic Token, Level | No | Yes |
I_RemainingArmyMPPercentage | None | Logic Token, Level | No | Yes |
I_CharacterCanMove | None | Logic Token, Level | No | Yes |
NoActionThisTurn | character_record | None | No | Yes |
CharacterNumTurnsIdle | character_record | Logic Token, Level | No | Yes |
AgentType | character_record | Character Type | No | Yes |
TrainedAgentType | character_record | Character Type | No | Yes |
DisasterType | event_type | Event Type | No | Yes |
CultureType | character_record | Culture Type | Yes | Yes |
CharFactionType | character_record | Character Faction Type | Yes | Yes |
OriginalFactionType | character_record | Original Faction Type | Yes | Yes |
OriginalCultureType | character_record | Original Culture Type | Yes | Yes |
IsGeneral | character_record | None | Yes | Yes |
IsAdmiral | character_record | None | Yes | Yes |
EndedInSettlement | character_record | None | Yes | Yes |
IsFactionLeader | character_record | None | Yes | Yes |
IsFactionHeir | character_record | None | Yes | Yes |
IsMarried | character_record | None | Yes | Yes |
AtSea | character_record | None | Yes | Yes |
I_AtSea | None | Character | No | Yes |
InEnemyLands | character_record | None | Yes | Yes |
InBarbarianLands | character_record | None | Yes | Yes |
InUncivilisedLands | character_record | None | Yes | Yes |
IsBesieging | character_record | None | Yes | Yes |
IsUnderSiege | character_record | None | Yes | Yes |
I_WithdrawsBeforeBattle | None | None | Yes | Yes |
EndedInEnemyZOC | character_record | None | Yes | Yes |
AdviseAction | character_action_advice | Logic Token, Action | No | Yes |
I_CharacterTypeNearCharacterType | None | Faction, Character Type, Distance in Squares, Faction, Character Type | No | Yes |
I_CharacterTypeNearTile | None | Faction, Character Type, Distance in Squares, Position X, Position Y | No | Yes |
TradingResource | character_record | None | No | Yes |
OnResource | character_record | None | No | Yes |
TradingMonopoly | character_record | None | No | Yes |
TradingExotic | character_record | None | No | Yes |
HighestAttAdjacentChar | character_record | Attribute Type, Character Type, Logic Token, Level | No | Yes |
HighestAttSharedChar | character_record | Attribute Type, Character Type, Logic Token, Level | No | Yes |
SpouseAttribute | character_record | Attribute Description, Logic Token, Level | No | Yes |
SpouseTrait | character_record | Trait Description, Logic Token, Level | Yes | Yes |
PopulationOwnReligion | character_record | Logic Token, Percentage | No | Yes |
PopulationHeretic | character_record | Logic Token, Percentage | No | Yes |
ProbabilitySuccess | character_record | Logic Token, Level | No | Yes |
IsOnCrusade | character_record | None | No | Yes |
IsOnJihad | character_record | None | No | Yes |
IsTargetOnCrusade | target_character_record | None | No | Yes |
IsTargetOnJihad | target_character_record | None | No | Yes |
I_CrusadingGeneralSelected | None | None | No | Yes |
I_JihadGeneralSelected | None | None | No | Yes |
CharacterReligion | character_record | Religion | Yes | Yes |
TimeInRegion | character_record | Logic Token, Turns | No | Yes |
TimeSinceReligion | character_record | Logic Token, Religion Percentage, Logic Token, Turns | No | Yes |
TimeSinceHeresy | character_record | Logic Token, Heresy Percentage, Logic Token, Turns | No | Yes |
TimeWithArmy | character_record | Logic Token, Turns | No | Yes |
FatherAnc | character_record | Ancillary Name | No | Yes |
GeneralWithAncKilled | character_record | Ancillary Name | Yes | Yes |
HasAncType | character_record | Ancillary Name | No | Yes |
I_CharacterExists | None | Character Name | No | Yes |
RansomType | ransom_type | Ransom Type | No | Yes |
NumCapturedSoldiers | captured_faction_info | Logic Token, Level | No | Yes |
NumCapturedCharacters | captured_faction_info | Logic Token, Level | No | Yes |
RansomAmount | captured_faction_info | Logic Token, Level | No | Yes |
I_FactionLeaderTrait | None | Faction Type, Trait Description, Logic Token, Level | Yes | Yes |
I_FactionLeaderAttribute | None | Faction Type, Attribute Description, Logic Token, Level | Yes | Yes |
FactionType | faction | Faction Type | Yes | Yes |
TargetFactionType | target_faction | Faction Type | Yes | Yes |
FactionReligion | faction | Faction Religion | Yes | Yes |
TargetFactionReligion | target_faction | Faction Religion | Yes | Yes |
FactionCultureType | faction | Culture Type | Yes | Yes |
TargetFactionCultureType | target_faction | Culture Type | Yes | Yes |
TrainedUnitCategory | unit | Unit Category | No | Yes |
TrainedUnitClass | unit | Unit Class | No | Yes |
UnitCategory | unit | Logic Token, Unit Category | No | Yes |
MedianTaxLevel | faction | Logic Token, Tax Level | Yes | Yes |
ModeTaxLevel | faction | Logic Token, Tax Level | Yes | Yes |
I_ModeTaxLevel | None | Faction, Logic Token, Tax Level | Yes | Yes |
MissionSuccessLevel | mission_success_level | Logic Token, Success Level | No | Yes |
MissionSucceeded | None | None | No | Yes |
MissionFactionTargetType | faction | Faction Type | Yes | Yes |
MissionCultureTargetType | faction, character_record | Culture Type | Yes | Yes |
DiplomaticStanceFromCharacter | character_record | Faction Type, Logic Token, Stance | Yes | Yes |
DiplomaticStanceFromFaction | faction | Faction Type, Logic Token, Stance | Yes | Yes |
DiplomaticStanceFactions | faction, target_faction | Logic Token, Stance | Yes | Yes |
DiplomaticStanceWithNewPope | faction, target_faction | Logic Token, Stance | No | Yes |
FactionEqualsTarget | faction, target_faction | None | Yes | Yes |
FactionHasAllies | faction | None | Yes | Yes |
FactionBuildingExists | faction | Logic Token, Level | No | Yes |
FactionScore | faction | Score Type, Logic Token, Faction Type | No | Yes |
FactionHasRank | faction | None | No | Yes |
FactionScorePercent | faction | Score Type, Logic Token, Level | No | Yes |
FactionScoreRank | faction | Score Type, Logic Token, Level | No | Yes |
FactionIncome | faction | Logic Token, Level | No | Yes |
I_LosingMoney | None | None | No | Yes |
SupportCostsPercentage | faction | Logic Token, Percentage | No | Yes |
Treasury | faction | Logic Token, Quantity | No | Yes |
OnAWarFooting | faction | None | No | Yes |
I_FactionBesieging | None | Faction Type | No | Yes |
I_FactionBesieged | None | Faction Type | No | Yes |
I_NumberOfSettlements | None | Faction Type, Logic Token, # of Settlements | No | Yes |
I_NumberOfHeirs | None | Faction Type, Logic Token, # of Heirs | No | Yes |
I_FactionNearTile | None | Faction, Distance in Squares, Position X, Position Y | No | Yes |
SettlementsTaken | faction | Logic Token, Quantity | Yes | Yes |
BattlesFought | faction | Logic Token, Quantity | Yes | Yes |
BattlesWon | faction | Logic Token, Quantity | Yes | Yes |
BattlesLost | faction | Logic Token, Quantity | Yes | Yes |
DefensiveSiegesFought | faction | Logic Token, Quantity | Yes | Yes |
DefensiveSiegesWon | faction | Logic Token, Quantity | Yes | Yes |
OffensiveSiegesFought | faction | Logic Token, Quantity | Yes | Yes |
OffensiveSiegesWon | faction | Logic Token, Quantity | Yes | Yes |
IsFactionAIFrozen | faction | None | No | Yes |
I_IsFactionAIFrozen | None | faction | No | Yes |
MissionID | mission_details | Mission ID | No | Yes |
PaybackID | mission_details | Payback ID | No | Yes |
IsCrusadeTargetFaction | target_faction | None | No | Yes |
IsJihadTargetFaction | target_faction | None | No | Yes |
MissionTimeRemaining | faction | Logic Token, Turns Remaining | No | Yes |
I_PlayerHasMission | None | Mission ID | No | Yes |
I_PlayerHasMissionType | None | Source ID | No | Yes |
I_PlayerHasPreferati | None | None | No | Yes |
I_PlayerCanBuyVotes | None | None | No | Yes |
FactionwideAncillaryExists | character_record | Ancillary Name, Logic Token | No | Yes |
TransgressionName | resource_description | Transgression Name | No | Yes |
ForgivenessName | resource_description | Forgiveness Name | No | Yes |
FactionStanding | faction, target_faction | Logic Token, Quantity | Yes | Yes |
GlobalStanding | faction | Logic Token, Quantity | Yes | Yes |
FactionExcommunicated | faction | None | No | Yes |
TargetFactionExcommunicated | target_faction | None | No | Yes |
FactionUndiscovered | faction | None | No | Yes |
I_IsFactionUndiscovered | None | Faction | No | Yes |
FactionAILabel | faction | Faction Type, AI Label | No | Yes |
I_FactionAILabel | None | Faction Type, AI Label | No | Yes |
NumFactionMarriages | faction, target_faction | Logic Token, # of Marriages | Yes | Yes |
I_UnitExists | None | Faction, Unit Type | No | Yes |
RandomPercent | None | Logic Token, Percentage | Yes | Yes |
TrueCondition | None | None | Yes | Yes |
EventCounterType | event_counter | Event Name | No | Yes |
EventCounter | event_counter | Logic Token, Integer | No | Yes |
I_EventCounter | None | Event Name, Logic Token, Integer | No | Yes |
IsPositionInRect | sm_position | Left Top [Width Height] | No | Yes |
IsRegionOneOf | region_id | Region Label | No | Yes |
IsTargetRegionOneOf | target_region_id | Region Label | No | Yes |
IsCrusade | crusade | None | No | Yes |
IsJihad | crusade | None | No | Yes |
CrusadeOutcome | crusade | Crusade Outcome | No | Yes |
I_CrusadeInProgress | None | None | No | Yes |
I_JihadInProgress | None | None | No | Yes |
I_CrusadeTimeLeft | None | Logic Token, Integer | No | Yes |
I_JihadTimeLeft | None | Logic Token, Integer | No | Yes |
I_TurnsSinceLastCrusade | None | Logic Token, Integer | No | Yes |
I_TurnsSinceLastJihad | None | Logic Token, Integer | No | Yes |
Religion | List | Religion | Yes | Yes |
TargetReligion | target_religion | Religion | Yes | Yes |
I_WorldwideAncillaryExists | character_record | Anicllary Name, Logic Token | No | Yes |
CampaignDifficulty | faction | Logic Token, Difficulty | No | Yes |
BattleDifficulty | faction | Logic Token, Difficulty | No | Yes |
I_CampaignNumTimePlay | None | Logic Token, Integer | Yes | Yes |
I_FirstTimePlay | None | Faction Type | Yes | Yes |
I_AdvisorVerbosityLevel | None | Logic Token, Integer | Yes | Yes |
I_HotseatEnabled | None | None | Yes | Yes |
SettlementName | settlement | Settlement Name | Yes | Yes |
TargetSettlementName | target_settlement | Settlement Name | Yes | Yes |
GovernorBuildingExists | character_record | Logic Token, Building Description | No | Yes |
SettlementBuildingExists | settlement | Logic Token, Building Description | No | Yes |
BuildingFinishedByGovernor | character_record, prior_build | Logic Token, Building Description | No | Yes |
SettlementBuildingFinished | prior_build | Logic Token, Building Description | No | Yes |
NumBuildingsCompleted | prior_build | Building Description, Logic Token, Test Level | No | Yes |
NumBuildingsCompletedFaction | faction, prior_build | Building Description, Logic Token, Test Level | No | Yes |
GovernorPlugInExists | character_record | Logic Token, Plug-In | No | Yes |
GovernorPlugInFinished | character_record, prior_build | Logic Token, Plug-In | No | Yes |
GovernorTaxLevel | character_record | Logic Token, Tax Level | Yes | Yes |
SettlementTaxLevel | settlement | Logic Token, Tax Level | Yes | Yes |
GovernorInResidence | settlement | None | No | Yes |
GovernorLoyaltyLevel | character_record | Logic Token, Value | Yes | Yes |
GovernorAttribute | settlement | Attribute, Logic Token, Level | Yes | Yes |
SettlementLoyaltyLevel | settlement | Logic Token, Level | Yes | Yes |
RiotRisk | settlement | Logic Token, Percentage | Yes | Yes |
BuildingQueueIdleDespiteCash | settlement | None | Yes | Yes |
TrainingQueueIdleDespiteCash | settlement | None | Yes | Yes |
I_SettlementExists | None | Settlement Name | No | Yes |
I_SettlementOwner | None | Settlement Name, Logic Token, Faction Type | No | Yes |
AdviseFinancialBuild | best_finance_option | Build Type | No | Yes |
AdviseBuild | advised_build | Build Type | No | Yes |
AdviseRecruit | None | Unit Type | No | Yes |
BuildingName | resource_description | Building Level Name | No | Yes |
SettlementPopulationMaxedOut | settlement | None | No | Yes |
SettlementPopulationTooLow | settlement | None | No | Yes |
SettlementAutoManaged | settlement | Automanagement Type | No | Yes |
PercentageOfPopulationInGarrison | settlement | None | No | Yes |
GarrisonToPopulationRatio | settlement | None | No | Yes |
HealthPercentage | settlement | None | No | Yes |
SettlementHasPlague | settlement | None | No | Yes |
IsFortGarrisoned | fort | None | No | Yes |
IsSettlementGarrisoned | settlement | None | No | Yes |
IsSettlementRioting | settlement | None | No | Yes |
I_NumberUnitsInSettlement | None | Settlement, Unit Type, Logic Token, Quantity | No | Yes |
NeighbourReligion | settlement | Settlement Religion, Logic Token, Level | No | Yes |
IsCrusadeTarget | settlement | None | No | Yes |
IsJihadTarget | settlement | None | No | Yes |
IsRegionCrusadeTarget | region_id | None | No | Yes |
IsRegionJihadTarget | region_id | None | No | Yes |
SettlementType | settlement | Castle/City | No | Yes |
TargetSettlementType | settlement | Castle/City | No | Yes |
I_SettlementUnderSiege | None | Settlement Name | No | Yes |
I_UnitsToRetrain | None | Settlement Name, Logic Token, Number | No | Yes |
CharacterIsLocal | character_record | None | Yes | Yes |
TargetCharacterIsLocal | target_character_record | None | Yes | Yes |
SettlementIsLocal | settlement | None | Yes | Yes |
TargetSettlementIsLocal | settlement | None | Yes | Yes |
RegionIsLocal | region_id | None | Yes | Yes |
TargetRegionIsLocal | region_id | None | Yes | Yes |
ArmyIsLocal | army | None | Yes | Yes |
TargetArmyIsLocal | army | None | Yes | Yes |
FactionIsLocal | faction | None | Yes | Yes |
I_LocalFaction | None | Faction | Yes | Yes |
TargetFactionIsLocal | target_faction | None | Yes | Yes |
I_TurnNumber | None | Logic Token, Turn Number | Yes | Yes |
I_MapName | None | Map File Name | Yes | Yes |
I_ThreadCount | None | Advice Thread, Logic Token, Value | No | Yes |
I_IsTriggerTrue | None | Trigger Name | No | Yes |
IncomingMessageType | event | Message Identifier | No | Yes |
I_AdvisorVerbosity | None | Logic Token, Advisor Verbosity | Yes | Yes |
I_CharacterSelected | None | Character Name | No | Yes |
I_AgentSelected | None | Character Type | No | Yes |
I_SettlementSelected | None | Settlement Name | No | Yes |
ShortcutTriggered | resource_description | Element ID, Function ID | Yes | Yes |
I_AdvancedStatsScrollIsOpen | None | None | No | Yes |
I_ScrollOpen | None | Scroll ID | No | Yes |
I_MessageNeedsResolving | None | None | No | Yes |
ButtonPressed | resource_description | Button ID | Yes | Yes |
UIElementVisible | resource_description | UI Element ID | No | Yes |
ScrollOpened | resource_description | Scroll ID | Yes | Yes |
ScrollClosed | resource_description | Scroll ID | Yes | Yes |
ScrollAdviceRequested | resource_description | Scroll ID | Yes | Yes |
I_CompareCounter | None | Script Counter, Value | Yes | Yes |
I_TimerElapsed | None | Logic Token, Timer ID, Duration | Yes | Yes |
I_SoundPlaying | None | Sound Event Tag | Yes | Yes |
I_AdvisorSpeechPlaying | None | None | Yes | Yes |
I_AdvisorVisible | None | None | Yes | Yes |
Identifier | Trigger Requirements | Parameters | Battle | Strat |
The following conditions only work for modifications running off the "kingdoms.exe" from the Medieval II: Total War - Kingdoms Expansion.
Identifier | Trigger Requirements | Parameters | Battle | Strat |
---|---|---|---|---|
PercentageUnitAttribute | character_record | Unit Attribute | Yes | Yes |
CharacterAge | character_record | Logic Token, Age | No | 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
Unit Attribute - To Be Amended
See Also
- Scripting Knowledge Compendium (M2-Scripting) - For the index of scripting information
- Events (M2-Scripting) - For information on Events and links to Event pages
- Commands (M2-Scripting) - For information on Commands and links to Command pages
- Modding:Coding