Jump to content


Photo

Multiple TriggeredBy Lines


  • Please log in to reply
1 reply to this topic

#1 Prolong

Prolong
  • Members
  • 133 posts

Posted 15 July 2010 - 02:00 PM

Question on how TriggeredBy lines work.

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
End
Could 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
End
When 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

Edited by Prolong, 15 July 2010 - 02:10 PM.


#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 20 July 2010 - 12:05 PM

If you have multiple triggers... you need to do RequiresAllTriggers = Yes :p
Ridder Geel




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users