I know that if you have multiple upgrades on one TriggeredBy line, any single one of those upgrades can work as a trigger, the power will be unpaused if Upgrade X OR Upgrade Y is present. Adding the RequiresAllTriggers line makes this an AND statement, the power will be unpaused only if Upgrade X AND Upgrade Y are present.
Unless I'm mistaken, you can use multiple TriggeredBy lines as well, and the requirements of all TriggeredBy lines must be met for the power to be unpaused (or attributemodifier activated). For example, if I have two TriggeredBy lines, one for Upgrade X and one for Upgrade Y, this would work the same as a single line for both upgrades with RequiresAllTriggers. Can anybody confirm this is correct?
Next big question - this would theoretically allow very flexible conditionals for when powers are active, right? Eg. I can have one TriggeredBy line with a single upgrade, so it must be present for the power to be active, and another line with multiple upgrades, so just one of those upgrades must be present?
Here's an example of a simple CaH power that is usable by multiple classes (adding the class to the TriggeredBy prevents the power from being glitched onto other classes - important to stop non-Elves from using Tornado, etc.):
//-------------------------------------------------------------------------- // INVULNERABILITY SPECIAL POWERS //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- ;;.;;Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroInvulnerabilityEnabler_Level1 ;;.;; SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 ;;.;; TriggeredBy = Upgrade_CreateAHeroInvulnerability_Level1 ;;.;;End Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroInvulnerabilityEnabler_Level1_HotW;;.;; SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 TriggeredBy = Upgrade_CreateAHeroInvulnerability_Level1 Upgrade_CreateAHero_ClassHeroOfTheWest RequiresAllTriggers = Yes End Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroInvulnerabilityEnabler_Level1_Dwarf;;.;; SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 TriggeredBy = Upgrade_CreateAHeroInvulnerability_Level1 Upgrade_CreateAHero_ClassDwarf RequiresAllTriggers = Yes End Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroInvulnerabilityEnabler_Level1_OlogHai;;.;; SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 TriggeredBy = Upgrade_CreateAHeroInvulnerability_Level1 Upgrade_CreateAHero_ClassOlogHai RequiresAllTriggers = Yes End Behavior = SpecialPowerModule ModuleTag_CreateAHeroInvulnerabilityStarter_Level1 SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 UpdateModuleStartsAttack = No StartsPaused = Yes AttributeModifier = CreateAHeroInvulnerabilityBonus_Level1 ;;,;; AttributeModifierRange = 1 AttributeModifierAffectsSelf = Yes ;;,;; AttributeModifierAffects = ANY +CAVALRY +INFANTRY AttributeModifierFX = FX_CreateAHeroInvulnerability_Start EndCould this be simplified to:
//-------------------------------------------------------------------------- // INVULNERABILITY SPECIAL POWERS //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- ;;.;;Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroInvulnerabilityEnabler_Level1 ;;.;; SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 ;;.;; TriggeredBy = Upgrade_CreateAHeroInvulnerability_Level1 ;;.;;End Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroInvulnerabilityEnabler_Level1_HotW;;,;; SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 TriggeredBy = Upgrade_CreateAHeroInvulnerability_Level1 TriggeredBy = Upgrade_CreateAHero_ClassHeroOfTheWest Upgrade_CreateAHero_ClassDwarf Upgrade_CreateAHero_ClassOlogHai End Behavior = SpecialPowerModule ModuleTag_CreateAHeroInvulnerabilityStarter_Level1 SpecialPowerTemplate = SpecialAbilityCreateAHeroInvulnerability_Level1 UpdateModuleStartsAttack = No StartsPaused = Yes AttributeModifier = CreateAHeroInvulnerabilityBonus_Level1 ;;,;; AttributeModifierRange = 1 AttributeModifierAffectsSelf = Yes ;;,;; AttributeModifierAffects = ANY +CAVALRY +INFANTRY AttributeModifierFX = FX_CreateAHeroInvulnerability_Start EndWhen we get into attributemodifiers, this could significantly simplify code if it does indeed work like that. Preventing stuff like this mess:
CODE
************
// CREATE A HERO Special Powers
//********************************************************************************
************
;;.;;Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip
;;.;; StartsActive = No // If no, requires upgrade to turn on.
;;.;; BonusName = GenericHeroLeadership
;;.;; TriggeredBy = Upgrade_CreateAHeroLeadership
;;.;; RefreshDelay = 2000
;;.;; Range = 200
;;.;; AntiCategory = BUFF
;;.;; ObjectFilter = ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
;;.;;End
Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip_HotW ;;.;;
StartsActive = No // If no, requires upgrade to turn on.
BonusName = GenericHeroLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership Upgrade_CreateAHero_ClassHeroOfTheWest
RequiresAllTriggers = Yes
RefreshDelay = 2000
Range = 200
;;,;; AntiCategory = BUFF
ObjectFilter = GENERIC_BUFF_RECIPIENT_OBJECT_FILTER ;;,;; ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
End
Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip_Wizard ;;.;;
StartsActive = No // If no, requires upgrade to turn on.
BonusName = GenericHeroLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership Upgrade_CreateAHero_ClassIstariWizard
RequiresAllTriggers = Yes
RefreshDelay = 2000
Range = 200
;;,;; AntiCategory = BUFF
ObjectFilter = GENERIC_BUFF_RECIPIENT_OBJECT_FILTER ;;,;; ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
End
Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip_SoS ;;.;;
StartsActive = No // If no, requires upgrade to turn on.
BonusName = GenericHeroLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership Upgrade_CreateAHero_ClassServantsOfSauron
RequiresAllTriggers = Yes
RefreshDelay = 2000
Range = 200
;;,;; AntiCategory = BUFF
ObjectFilter = GENERIC_BUFF_RECIPIENT_OBJECT_FILTER ;;,;; ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
End
Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip_Archer ;;.;;
StartsActive = No // If no, requires upgrade to turn on.
BonusName = GenericHeroLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership Upgrade_CreateAHero_ClassArcher
RequiresAllTriggers = Yes
RefreshDelay = 2000
Range = 200
;;,;; AntiCategory = BUFF
ObjectFilter = GENERIC_BUFF_RECIPIENT_OBJECT_FILTER ;;,;; ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
End
Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip_Corrupted ;;.;;
StartsActive = No // If no, requires upgrade to turn on.
BonusName = GenericHeroLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership Upgrade_CreateAHero_ClassCorruptedMan
RequiresAllTriggers = Yes
RefreshDelay = 2000
Range = 200
;;,;; AntiCategory = BUFF
ObjectFilter = GENERIC_BUFF_RECIPIENT_OBJECT_FILTER ;;,;; ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
End
Behavior = AttributeModifierAuraUpdate ModuleTag_CreateAHeroLeaderShip_Dwarf ;;.;;
StartsActive = No // If no, requires upgrade to turn on.
BonusName = GenericHeroLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership Upgrade_CreateAHero_ClassDwarf
RequiresAllTriggers = Yes
RefreshDelay = 2000
Range = 200
;;,;; AntiCategory = BUFF
ObjectFilter = GENERIC_BUFF_RECIPIENT_OBJECT_FILTER ;;,;; ANY +INFANTRY +CAVALRY -STRUCTURE -BASE_FOUNDATION -HERO -DOZER -HORDE -DwarvenZerker -NoldorWarrior -GondorKnightsofDol -WildBabyDrake -MordorBlackRider -IsengardFanatic
End
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroLeaderShip_Enabler
SpecialPowerTemplate = SpecialAbilityFakeLeadership
TriggeredBy = Upgrade_CreateAHeroLeadership
End
Behavior = SpecialPowerModule ModuleTag_CreateAHeroLeadershipUpdate
SpecialPowerTemplate = SpecialAbilityFakeLeadership
UpdateModuleStartsAttack = No
StartsPaused = Yes
End