• 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.

Event: group of monsters appears

Level 5
Joined
Mar 7, 2024
Messages
80
I need help: please help me create an event that repeats every 60 seconds, a group of 5 tauren monsters appear on the map and after 30 seconds they disappear.
 

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,246
  • Events
    • Time - Every 60.00 seconds of game time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 5, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Tauren for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
        • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
That trigger creates an event that repeats every 60 seconds. When the event fires, it will create 1 tauren at the center of the map and add 30 second expiration timer to them, this will happen 5 times in quick succession so you will end up with 5 tauren that will die within 30 seconds . If you don't want to see their death animation, you can immediately remove them upon death with this trigger.
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Tauren
  • Actions
    • Unit - Remove (Triggering unit) from the game
If you could be more specific with what you are trying to do, that would be helpful.
If this is indeed the result you are trying to achieve, I will recommend to use your own integer variable instead of Integer A and store the location into a variable first then destroy it to prevent memory leak.

The trigger will look something like this:
  • Events
    • Time - Every 60.00 seconds of game time
  • Conditions
  • Actions
    • For each (Integer TempInteger) from 1 to 5, do (Actions)
      • Loop - Actions
        • Set TempLoc = (Center of (Playable map area))
        • Unit - Create 1 Tauren for Neutral Hostile at TempLoc facing Default building facing degrees
        • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
        • Custom script: call RemoveLocation(udg_TempLoc)
whereas TempInteger is an integer variable and TempLoc is a location/point variable. "call RemoveLocation(udg_TempLoc)" is used to prevent memory leak.
 
Top