• 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] Loop trigger wont be turned off

Status
Not open for further replies.
Level 6
Joined
Feb 21, 2008
Messages
205
trigger 1:

Furbolg warrior spawning trigger
  • Events
    • Unit - Furbolg obelisk 1 0000 <gen> Finishes research
  • Conditions
    • (Researched tech-type) Equal to Furbolg warriors
  • Actions
    • Set Triggerfurbolgwarrior = (This trigger)
    • For each (Integer A) from 1 to 100000, do (Actions)
      • Loop - Actions
        • Unit - Create 2 Furbolg Warrior for Player 1 (Red) at (Center of Furbolg spawning grounds <gen>) facing (Position of (Triggering unit))
        • Wait 100.00 seconds
trigger 2:
Turn off furbolg warrior
  • Events
    • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to Furbolg obelisk 1 0000 <gen>
    • Actions
      • Trigger - Turn off Triggerfurbolgwarrior
But the units keep on spawning, help!
 
Level 10
Joined
Sep 6, 2007
Messages
440
You must never use waits in a loop. They simply never go. I heard someone saying this in some thread in the past. Make a trigger which will run for every X second. ( periodic timer event ) Then make it create furbolgs. And turn this trigger off. If you want I can make it.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Just what NoNZealot said.
Turning a trigger off will prevent it from firing any more, but will not stop it.
So instead of doing so, do so:
  • Reasearch done
  • Events
  • Unit - Furbolg obelisk 1 0000 <gen> Finishes research
  • Conditions
  • (Researched tech-type) Equal to Furbolg warriors
  • Actions
  • Trigger - Turn on Spawn Furbolg
  • Spawn Furbolg
    • Events
      • Time - Every 100.00 seconds of game time
    • Conditions
    • Actions
  • Unit - Create 2 Furbolg Warrior for Player 1 (Red) at (Center of Furbolg spawning grounds <gen>) facing (Position of (Furbolg obelisk 1 0000 <gen>))
I would suggest using default building facing instead of postition of ...
  • Obelisk Dies
  • Events
  • Unit - A unit Dies
  • Conditions
  • (Dying unit) Equal to Furbolg obelisk 1 0000 <gen>
  • Actions
  • Trigger - Turn off Spawn Furlbog
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
No waits in loops are fine by me, they leak no more than normal waits :D
But there is something interesting about a little wait in a loop being more accurate than one big wait (like 10 * 0.3 being more accurate than 3.00).
I may be mistaken about that, but I know it to be true for PolledWait(game time wait).
And waits screw something the event response functions. Like attacked unit, casting unit, triggering unit.
 
Level 6
Joined
Feb 21, 2008
Messages
205
It works, all my triggers are working now. But, I had to create a another trigger spiwn:

Event:
events - Map initilitazion <---- (stupid word)
actions - Turn off trigger furbolg spawn.

I had to put every spawn trigger in this trigger, or else I would keep spawning units without doing the upgrade. (Just saying this if any1 wants to copy the trigger.)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
No, you don't :)
Just need to uncheck the Initially on check box that is above the actual trigger.
 
Status
Not open for further replies.
Top