Help with movement trigger

jnZ

I
Reaction score
64
hey ppl i need help with this trigger: i just cant see the problem here

JASS:
Creep Movement
    Events
        Time - Every 0.30 seconds of game time
    Conditions
    Actions
        For each (Integer Loop[44]) from 1 to 4, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (UnitCreep[Loop[44]] is alive) Equal to True
                    Then - Actions
                        Set PointTemporaryCreepMovementA = (Position of UnitCreep[Loop[44]])
                        Set PointTemporaryCreepMovementB = (PointTemporaryCreepMovementA offset by (70.00, 0.00))
                        Set RectTemporaryCreepMovement = (Region centered at PointTemporaryCreepMovementB with size (5.00, 5.00))
                        Set UnitGroupCreepMovement = (Units in RectTemporaryCreepMovement matching (((Matching unit) is An Ancient) Equal to True))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (UnitGroupCreepMovement is empty) Equal to True
                            Then - Actions
                                Unit - Order UnitCreep[Loop[44]] to Move To PointTemporaryCreepMovementB
                            Else - Actions
                                Game - Display to (All players) the text: XXX
                                Custom script:   call RemoveLocation( udg_PointTemporaryCreepMovementB )
                                Custom script:   call RemoveRect( udg_RectTemporaryCreepMovement )
                                Custom script:   call DestroyGroup( udg_UnitGroupCreepMovement )
                                Set PointTemporaryCreepMovementB = (PointTemporaryCreepMovementA offset by (-70.00, 0.00))
                                Set RectTemporaryCreepMovement = (Region centered at PointTemporaryCreepMovementB with size (5.00, 5.00))
                                Set UnitGroupCreepMovement = (Units in RectTemporaryCreepMovement matching (((Matching unit) is An Ancient) Equal to True))
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (UnitGroupCreepMovement is empty) Equal to True
                                    Then - Actions
                                        Unit - Order UnitCreep[Loop[44]] to Move To PointTemporaryCreepMovementB
                                    Else - Actions
                                        Custom script:   call RemoveLocation( udg_PointTemporaryCreepMovementB )
                                        Custom script:   call RemoveRect( udg_RectTemporaryCreepMovement )
                                        Custom script:   call DestroyGroup( udg_UnitGroupCreepMovement )
                                        Set PointTemporaryCreepMovementB = (PointTemporaryCreepMovementA offset by (0.00, 70.00))
                                        Set RectTemporaryCreepMovement = (Region centered at PointTemporaryCreepMovementB with size (5.00, 5.00))
                                        Set UnitGroupCreepMovement = (Units in RectTemporaryCreepMovement matching (((Matching unit) is An Ancient) Equal to True))
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (UnitGroupCreepMovement is empty) Equal to True
                                            Then - Actions
                                                Unit - Order UnitCreep[Loop[44]] to Move To PointTemporaryCreepMovementB
                                            Else - Actions
                                                Custom script:   call RemoveLocation( udg_PointTemporaryCreepMovementB )
                                                Custom script:   call RemoveRect( udg_RectTemporaryCreepMovement )
                                                Custom script:   call DestroyGroup( udg_UnitGroupCreepMovement )
                                                Set PointTemporaryCreepMovementB = (PointTemporaryCreepMovementA offset by (0.00, -70.00))
                                                Set RectTemporaryCreepMovement = (Region centered at PointTemporaryCreepMovementB with size (5.00, 5.00))
                                                Set UnitGroupCreepMovement = (Units in RectTemporaryCreepMovement matching (((Matching unit) is An Ancient) Equal to True))
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (UnitGroupCreepMovement is empty) Equal to True
                                                    Then - Actions
                                                        Unit - Order UnitCreep[Loop[44]] to Move To PointTemporaryCreepMovementB
                                                    Else - Actions
                        Custom script:   call RemoveLocation( udg_PointTemporaryCreepMovementB )
                        Custom script:   call RemoveLocation( udg_PointTemporaryCreepMovementA )
                        Custom script:   call RemoveRect( udg_RectTemporaryCreepMovement )
                        Custom script:   call DestroyGroup( udg_UnitGroupCreepMovement )
                    Else - Actions


the trigger is supposed to order the creep to move to the next Square, Nort, East, West or South.
The unit group checks for Blocks (In my map categroized as ancients) in its paths but somehow the unitgroup is empty everytime so that the else function never triggers (i entered the Game - Text message to test this)
someone sees the problem? thx
 

thewrongvine

The Evolved Panda Commandant
Reaction score
506
Huh?

Unit - Issue order targeting a Point?

I don't get what you're trying to do.
 

Iwan_Krissov

New Member
Reaction score
18
I think your region 5x5 is to small...
I dont know if a unit has to be completely in a region to match the condition "unit in region" but that would be my guess...
 

jnZ

I
Reaction score
64
Huh?

Unit - Issue order targeting a Point?

I don't get what you're trying to do.

what do you mean? i try to move the creeps ofcourse.

I think your region 5x5 is to small...
I dont know if a unit has to be completely in a region to match the condition "unit in region" but that would be my guess...

i already tried it with 128x128 but its also always empty
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Hmm instead of doing unit group is empty do a count of the units in the group that are alive and make it need to be equal to 0, even if the creeps die, they are still in the unit group.
 

jnZ

I
Reaction score
64
Hmm instead of doing unit group is empty do a count of the units in the group that are alive and make it need to be equal to 0, even if the creeps die, they are still in the unit group.

but i destroy the unitgroup everytime so this shouldnt be the problem 2 . and the problem in my trigger is that the unitgroup is ALWAYS empty and the tests Game - Text message never appears, so it cant be the problem
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
If there are dead units in that area they will be added to your unit group as well, when you do select all units in area, it don't care if they are alive or dead, are you sure you had no dead anchents in the area?

Edit try removeing the set unit creep group varible, just move it to a temp trigger and see if your else triggers. Sence you arn't setting the group it should trigger, if it dosen't it means you are setting it with another trigger and not destroying it. If it does work then set unit group to all units in area matching condition matching unit is alive.
 

jnZ

I
Reaction score
64
blocks - i my case categrozied as ancients are removed via trigger upon dead so they cant be added to the unit group
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Ohh wow I was reading your trigger wrong lol

Umm trying changeing the offset of 5 and 5 to a way bigger number and see if it solves the problim.

To exsplain this a little better, you set it to add units in a region around your unit by 5 and 5, in game if you stand one unit next to another, they are about 150 apart. try setting it to like 600 to 1500

ps. this might help you a bit in the future, in the WE go to the map part and hit g, just once, you will see a lot of yellow boxes, from the line of 1 box to the next is a range of 500.
 

jnZ

I
Reaction score
64
Ohh wow I was reading your trigger wrong lol

Umm trying changeing the offset of 5 and 5 to a way bigger number and see if it solves the problim.

To exsplain this a little better, you set it to add units in a region around your unit by 5 and 5, in game if you stand one unit next to another, they are about 150 apart. try setting it to like 600 to 1500

ps. this might help you a bit in the future, in the WE go to the map part and hit g, just once, you will see a lot of yellow boxes, from the line of 1 box to the next is a range of 500.

thanks i already know the grid -.- i already tried using 128x128 instead of 5x5 but it didnt work 2, 128x128 is the medium square and the pathing of my ancients is 128x128 so it should work but it does not
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
if you set it to 128 the unit would have to be right next to your unit for it to work and I mean right next to it, try setting it to 1500 and then see if it works.
 

jnZ

I
Reaction score
64
it only should trigger if the unit is right next to it :> it is supposed to move into another direction if a unit is right next to it and it is not possible to move there
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
ok then try setting it to 350-450, 128 is to small, it is the size of that region that is causeing the trouble.

if you want to find out exackly what size you want it, make a ranged hero and set the acusition range to some hting like 1000, then set the range to 128, then hit a and click on a NH creep on the map, then keep adding to the range till it is at the range you want the unit to move away and use that in your varible.

Edit: to put this bluntly, there is no way this trigger will work with it set to anything lower then 250 by 250.
 

jnZ

I
Reaction score
64
thats my arena:

XXXXXXX
XTTTTTX
XTXTXTX
XTTTTTX
XTXTXTX
XTTTTTX
XXXXXXX


X's are not pathable
T's are pathable
every X and T is a 128x128 square
so if I would use a larger region than 128x128 the unit would move nowhere because everywhere is a X (ancient) in the region

iam pretty shure that the size is not the problem
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Take my work for it or not, but the size is the problim here. Unless you change it it wont work, try setting it to 250 by 250, what is the worse that could happen, you waist 2 minutes trying it? It is easy enought to set back.
 

jnZ

I
Reaction score
64
you were right dude, changing it to 250x250 worked, but it somehow a real suprise for me because i made other triggers which created 128x128 regions that worked 2. thanks again +rep
 
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