Big trigger help +rep for help

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Code:
FormationMove
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Triggering unit) Equal to Captain 0030 <gen>
    Actions
        Set temp_integer = 0
        Set SquadInteger = 0
        Set Temp_Point2 = (Target point of issued order)
        Set Temp_Point = (Temp_Point2 offset by 400.00 towards 140.00 degrees)
        Unit - Order testdummy2 to Move To Temp_Point
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in SquadGroup[(Custom value of Captain 0030 <gen>)] and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                temp_integer Less than or equal to 250
                                SquadInteger Equal to 0
                            Then - Actions
                                Unit - Order (Picked unit) to Attack-Move To (Temp_Point offset by (Real(temp_integer)) towards 0.00 degrees)
                                Unit Group - Add (Picked unit) to SquadGroup2
                                Unit Group - Remove (Picked unit) from SquadGroup[(Custom value of (Triggering unit))]
                                Set temp_integer = (temp_integer + 50)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        SquadInteger Equal to 1
                                    Then - Actions
                                        Unit - Order (Picked unit) to Attack-Move To ((Position of testdummy) offset by 50.00 towards 270.00 degrees)
                                        Set testdummy = (Picked unit)
                                        Set Temp_Point = (Position of testdummy)
                                        Unit - Order (Picked unit) to Move To (Temp_Point offset by (Real(temp_integer)) towards 0.00 degrees)
                                        Unit Group - Add (Picked unit) to SquadGroup2
                                        Unit Group - Remove (Picked unit) from SquadGroup[(Custom value of (Triggering unit))]
                                        Set temp_integer = (temp_integer + 50)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                SquadInteger Equal to 2
                                            Then - Actions
                                                Unit - Order (Picked unit) to Attack-Move To ((Position of testdummy) offset by 50.00 towards 270.00 degrees)
                                                Set Temp_Point = ((Position of testdummy) offset by 50.00 towards 270.00 degrees)
                                                Set testdummy = (Picked unit)
                                                Unit - Order (Picked unit) to Move To (Temp_Point offset by (Real(temp_integer)) towards 0.00 degrees)
                                                Unit Group - Add (Picked unit) to SquadGroup2
                                                Unit Group - Remove (Picked unit) from SquadGroup[(Custom value of (Triggering unit))]
                                                Set temp_integer = (temp_integer + 50)
                                            Else - Actions
                Set SquadInteger = (SquadInteger + 1)
                Set temp_integer = 0
        Unit Group - Add (Picked unit) to SquadGroup2
        Unit Group - Add all units of SquadGroup2 to SquadGroup[(Custom value of (Triggering unit))]

Yes it's probably really unneccesary. It's supposed to move units in a group and make them stand in 3 rows with units with 6 units in each.
Code:
------------------
------------------
------------------
^Like that. What it does is this:
Code:
------------------
              ------------------
                         -----------------
The 2 lower rows seems to go more and more to the right every time I move the captain and the upper row seems to follow the captain as they should.
 

Exide

I am amazingly focused right now!
Reaction score
448
Your trigger is a mess, and it leaks. :p
I'm guessing that what you do is:

Create 1 unit at X with offset of X + Y
set Y = (Y + 50)
-Repeat.

Which means that you won't create the first unit on each row on the same vertical align.

Try adding a If / Then / Else:

If temp_integer greater than or equal to 250* then do
set temp_integer = 0
else do nothing

*depending on how many units you want to create.
I'm sure you get the picture.
 

Accname

2D-Graphics enthusiast
Reaction score
1,465
i think you are looking for something like this:
Code:
Untitled Trigger 002
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set TempPoint = ((Center of (Playable map area)) offset by ((128.00 x (Real((Integer B)))), (128.00 x (Real((Integer A))))))
                        Unit - Create 1 Soldat for Player 1 (Red) at TempPoint facing Default building facing (270.0) degrees
                        Custom script: call RemoveLocation (udg_TempPoint)
128 is like about 32 collision size in the object editor
 

jeffandsnoop

New Member
Reaction score
8
I see that the trigger is suppose to order a single unit while the other non-player controllable units will "follow" and line up a formation?

Just like EotA

I think by having different triggers and seperated events to reduce the lag meeting the conditions in one big mess trigger is better.

Code:
FormationMove
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Ordering unit) Equal to Captain 0030 <gen>
    Actions
        Turn off this Trigger
        Unit Group - Pick every unit in Range Matching Conditions and do Multiple Actions
Pick Every Units within 800 (Night Visibility) of Captain Matching Condition:
2x Conditions
Player Comparison (Owner of Matching Unit) equals to (Owner of Ordering Unit)
Or (So it will pick up both the captain and units allied to him)
Boolean comparison ((Matching Unit) belongs to an ally of (Owner of Ordered Unit)) equals to True

Now the action: (Do not use the Unit - Issue Order, but the Unit Group one)
Unit Group - Issue Order Targeting a Point

Issue (Move to) targeting (Target Point of Issued Order)
Turn on this Trigger
If you wish to have them attack-move instead, change the condition to attack-move and all that,

It's really hard to type them all out since its all in mess...
maybe I'll just make an example map?
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I explained myself badly. It's not supposed to create units, it's supposed to order the units in a group to stand in 3 rows.


Your trigger is a mess, and it leaks. :p
I'm guessing that what you do is:

Create 1 unit at X with offset of X + Y
set Y = (Y + 50)
-Repeat.

Which means that you won't create the first unit on each row on the same vertical align.

Try adding a If / Then / Else:

If temp_integer greater than or equal to 250* then do
set temp_integer = 0
else do nothing

*depending on how many units you want to create.
I'm sure you get the picture.
I know it's a mess and that it leaks. I usally fix leaks when i'm done with a trigger. It's a mess because I dont know how to do.
i think you are looking for something like this:
Code:
Untitled Trigger 002
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set TempPoint = ((Center of (Playable map area)) offset by ((128.00 x (Real((Integer B)))), (128.00 x (Real((Integer A))))))
                        Unit - Create 1 Soldat for Player 1 (Red) at TempPoint facing Default building facing (270.0) degrees
                        Custom script: call RemoveLocation (udg_TempPoint)
128 is like about 32 collision size in the object editor
Same thing here, it's creating not moving.
I see that the trigger is suppose to order a single unit while the other non-player controllable units will "follow" and line up a formation?

Just like EotA

I think by having different triggers and seperated events to reduce the lag meeting the conditions in one big mess trigger is better.

Code:
FormationMove
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Ordering unit) Equal to Captain 0030 <gen>
    Actions
        Turn off this Trigger
        Unit Group - Pick every unit in Range Matching Conditions and do Multiple Actions
Pick Every Units within 800 (Night Visibility) of Captain Matching Condition:
2x Conditions
Player Comparison (Owner of Matching Unit) equals to (Owner of Ordering Unit)
Or (So it will pick up both the captain and units allied to him)
Boolean comparison ((Matching Unit) belongs to an ally of (Owner of Ordered Unit)) equals to True

Now the action: (Do not use the Unit - Issue Order, but the Unit Group one)
Unit Group - Issue Order Targeting a Point

Issue (Move to) targeting (Target Point of Issued Order)
Turn on this Trigger
If you wish to have them attack-move instead, change the condition to attack-move and all that,

It's really hard to type them all out since its all in mess...
maybe I'll just make an example map?

Same problem here.
 

Accname

2D-Graphics enthusiast
Reaction score
1,465
to make them move in formation you have got to set them to a unit group and then use "unit group - order units in group to move to (target point of issued order)"
but remember to not put more then 12 units within the group or the formation will mess up.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
There's 2 problems with that. First, I want to be able to store more than 12 units in it. Also if I use the unit group move they'll move to the same point, wont they
 

jeffandsnoop

New Member
Reaction score
8
if I use the unit group move they'll move to the same point, wont they

Incorrect, that's only if you use the single "Unit - Order ----------"

If you use the "Unit Group - Order units --------" they will form a formation

And I think maybe JASS can solve the problem with the maximum units it can have in a unit group

If not then only 12 can be ordered around.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top