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

[Trigger] Wait function

Status
Not open for further replies.
Level 2
Joined
Dec 27, 2010
Messages
15
Wait function - Multiple players

Hey I've got this issue.

In my map there's this building which all the players can construct. It goes invulnerable for 10 seconds after construction, and then gets destroyed. However my trigger doesn't kill it after 10 seconds. Here's the trigger.

  • TempleOfFaith Finish
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to TOF
    • Actions
      • Game - Display to (All players) the text: A |cffffcc00Temple ...
      • Unit - Make (Constructed structure) Invulnerable
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Items\StaffOfSanctuary\Staff_Sanctuary_Target.mdl
      • Set TempleOfFaith[((Player number of (Owner of (Constructed structure))) - 1)] = (Last created unit)
      • Set tempGroup = (Units in (Region centered at (Position of (Constructed structure)) with size (512.00, 512.00)) matching ((Unit-type of (Matching unit)) Equal to Worker (Blood Elf)))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup(udg_tempGroup)
      • Wait 10.00 seconds
      • Unit - Kill TempleOfFaith[((Player number of (Owner of (Constructed structure))) - 1)]
So the "Constructed structure" can't be called after the wait function? Can anyone suggest how this could be fixed? :eekani:

Cheerz
 
Last edited:
Level 20
Joined
Jul 6, 2009
Messages
1,885
  • TempleOfFaith Finish
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to TOF
    • Actions
      • Game - Display to (All players) the text: A |cffffcc00Temple ...
      • Unit - Make (Triggering unit) Invulnerable
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Items\StaffOfSanctuary\Staff_Sanctuary_Target.mdl
      • Set SFX[Player number of owner of Triggering unit] = Last created special effect
      • Set tempPoint = Position of (Triggering unit)
      • Set tempGroup = (Units in 512.0 range from tempPoint matching ((Unit-type of (Matching unit)) Equal to Worker (Blood Elf)))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Set tempPoint2 = Position of (Picked unit)
          • Unit - Remove (Picked unit) from the game
          • Special Effect - Create a special effect at tempPoint using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_tempPoint2)
      • Custom script: call DestroyGroup(udg_tempGroup)
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Wait 10.00 seconds
      • Special effect - Destroy SFX[player number of owner of Triggering unit]
      • Unit - Kill (Triggering Unit)
Use this.
 
Status
Not open for further replies.
Top