General Trigger Question

Pigger

New Member
Reaction score
13
As the title says I have a general question about triggers.

When running a trigger, I realize that in the events it goes in the order that they are placed in the trigger such as:
Code:
Actions
    Selection - Clear selection for Player 1 (Red)
    Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    Selection - Select (Last created unit) for Player 1 (Red)

It will do Selection clear, create the unit, and then select it. But my question (which came from me working on a trigger) is this. Say I have two loops:
Code:
Actions
    For each (Integer A) from 1 to 10, do (Actions)
        Loop - Actions
    For each (Integer B) from 1 to 10, do (Actions)
        Loop - Actions
And they both do something such as create a unit at a point. Do they both run at the same time? Or will the second loop have to wait until the first is completely finished?
 

Pigger

New Member
Reaction score
13
Darn! I was hoping that wasn't true. While you're here mind helping me out on a circle question? Else I'll make a new thread...
 

Pigger

New Member
Reaction score
13
Ok, thanks. I found a tutorial earlier on how to make circles, which I can handle. But I'm trying to make it so that the circle will "form" growing two ways. As in I have this as my current loop to make it (which works fine but only goes one way.)

Code:
For each (Integer A) from 1 to 36, do (Actions)
    Loop - Actions
        Wait 0.01 seconds
        Unit - Create 1 FireDummy for (Owner of Caster) at (CircleCenter offset by (Distance between CastPoint and CircleCenter) towards ((Facing of Caster) + ((360.00 / 36.00) x (Real((Integer A))))) degrees) facing Default building facing degrees

The wait is just to give the illusion of the units being created are being created in a circular motion. But I am trying to make it so that it starts and one point, and moves both ways around the circle, so that the two ends of the growing circle connect behind where the caster was facing/cast the spell.

(And I'm really sorry if there is something talking about this I just got back from class and wanted to figure it ASAP and forgot about searching :S)
 

Pender

New Member
Reaction score
32
Do something like this:

Code:
For each (Integer A) from 1 to 18, do (Actions)
    Loop - Actions
        Wait 0.01 seconds
        Unit - Create 1 FireDummy for (Owner of Caster) at (CircleCenter offset by (Distance between CastPoint and CircleCenter) towards ((Facing of Caster) + ((360.00 / 36.00) x (Real((Integer A))))) degrees) facing Default building facing degrees
        Unit - Create 1 FireDummy for (Owner of Caster) at (CircleCenter offset by (Distance between CastPoint and CircleCenter) towards ((Facing of Caster) - ((360.00 / 36.00) x (Real((Integer A))))) degrees) facing Default building facing degrees

Note that in the second Create Unit action, it's a minus sign. Also note that we only loop from 1 to 18 -- instead of 1 to 36 -- since we're creating two units with each iteration instead of one. I believe that'll do it.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
>And they both do something such as create a unit at a point. Do they both run at the same time? Or will the second loop have to wait until the first is completely finished?

To have them run at the same time, I think you can have 2 seperate triggers, with the same event, and actions run at the same time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top