• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to turn on huge amounts of triggers

Status
Not open for further replies.
Level 45
Joined
Feb 27, 2007
Messages
5,578
My first thought is that you could and should consolidate or simplify your triggers so there aren’t so many of them. Surely that is possible.

The real question is why do they need to be off? Give them condition that checks that the value of some Boolean variable is true. When you want those triggers not to run, set that variable to false.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,867
You can store the triggers in a Trigger array variable and then use a For Loop to enumerate over them.

That being said, it sounds like you're lacking a proper system for storing these cards/their effects. Then again, I don't know the specifics of your map.

I'm going to make some assumptions and give you an example of how you could handle this type of game based on those assumptions.

Assuming your card effects (triggers) ALWAYS Create a unit or units, you could create a system that stores the information that these cards all share:
1: Unit-type
2: Unit count
3: Additional effects trigger

This information could be tracked inside of a Hashtable using the card's ID (whatever that may be) as the Parent key and the Children keys would contain the above 3 sets of data.

Then whenever a card is played, you simply get that card's ID, plug it into the Hashtable, and retrieve all of the necessary information. A SINGLE trigger could manage all of this. This helps keep things organized especially in cases where a card doesn't need an additional effects trigger.

Basically, try to eliminate any repetition by creating a system that will handle that part for you. For unique effects, you'll still need your unique triggers since some cards may do things that no other card does. If you have reoccurring abilities like Taunt, Rush, Divine Shield, etc. you could probably incorporate them into the system as well so they're handled automatically. Ideally, you'd be able to create a new card without even needing to create a new trigger, simply assign a few variables and voila, the rest is handled automatically.
  • Set Variable CardCategory = Minion
  • Set Variable CardUnitType = Grunt
  • Set Variable CardSpawnCount = 3
  • Set Variable CardEffect = NONE
  • Trigger - Run Add Card To Hashtable (ignoring conditions)
 
Last edited:
Status
Not open for further replies.
Top