Ordering units to move to a region without leaks

smiley1337

New Member
Reaction score
1
the problem is that i want my creeps move from one region to other region and from there to another region:D without leaks
just a simple code where it picks every unit in region 1 owned by player 12 and then orders them to move to region 2 and if they enter region 2 order them to move to region 3

please make a simple code^^
 

Flow

New Member
Reaction score
4
Event
Whatever your initial event would be
Condition

Action
Unit Group - Pick every unit in (Units in (Region 000 <gen>) owned by Player 12 (Brown)) and do (Unit - Order (Picked unit) to Move To (Center of Region 001 <gen>))

And then, a second trigger:

Event
Unit - A unit enters Region 001 <gen>

Condition

Action
Unit - Order (Triggering unit) to Move To (Center of Region 002 <gen>)


Not sure if you want random point in region or the actual centre... and also, this method has a flaw: if the region is very big, I think they'll still go to the next one as soon as they enter it (i.e. they won't go to its centre) but this you can fix by just making a smaller region at the spot to which you want them to go first.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
I have already given you a trigger that will work for this in your last thread

http://www.thehelper.net/forums/showthread.php?t=94403


Code:
Unit send attack
    Events
        Unit - A unit enters T1 Start 1 <gen>
        Unit - A unit enters T1 Start 2 <gen>
        Unit - A unit enters T1 Middle 1 <gen>
        Unit - A unit enters T1 Middle 2 <gen>
        Unit - A unit enters T2 Start 1 <gen>
        Unit - A unit enters T2 Start 2 <gen>
        Unit - A unit enters T2 Middle 1 <gen>
        Unit - A unit enters T2 Middle 2 <gen>
    Conditions
        ((Triggering unit) is A Hero) Not equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (T1 Start 1 <gen> contains (Triggering unit)) Equal to True
                (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
            Then - Actions
                Set Temp_Region = (Random point in T1 Middle 1 <gen>)
                Unit - Order (Triggering unit) to Attack-Move To Temp_Region
                Custom script:   call RemoveLocation (udg_Temp_Region)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (T1 Start 2 <gen> contains (Triggering unit)) Equal to True
                        (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
                    Then - Actions
                        Set Temp_Region = (Random point in T1 Middle 2 <gen>)
                        Unit - Order (Triggering unit) to Attack-Move To Temp_Region
                        Custom script:   call RemoveLocation (udg_Temp_Region)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (T2 Start 1 <gen> contains (Triggering unit)) Equal to True
                                (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                            Then - Actions
                                Set Temp_Region = (Random point in T2 Middle 1 <gen>)
                                Unit - Order (Triggering unit) to Attack-Move To Temp_Region
                                Custom script:   call RemoveLocation (udg_Temp_Region)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (T2 Start 2 <gen> contains (Triggering unit)) Equal to True
                                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                                    Then - Actions
                                        Set Temp_Region = (Random point in T2 Middle 2 <gen>)
                                        Unit - Order (Triggering unit) to Attack-Move To Temp_Region
                                        Custom script:   call RemoveLocation (udg_Temp_Region)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
                                                Or - Any (Conditions) are true
                                                    Conditions
                                                        (T2 Middle 1 <gen> contains (Triggering unit)) Equal to True
                                                        (T2 Middle 2 <gen> contains (Triggering unit)) Equal to True
                                            Then - Actions
                                                Set Temp_Region = (Center of T2 End <gen>)
                                                Unit - Order (Triggering unit) to Attack-Move To Temp_Region
                                                Custom script:   call RemoveLocation (udg_Temp_Region)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                                                        Or - Any (Conditions) are true
                                                            Conditions
                                                                (T1 Middle 1 <gen> contains (Triggering unit)) Equal to True
                                                                (T1 Middle 2 <gen> contains (Triggering unit)) Equal to True
                                                    Then - Actions
                                                        Set Temp_Region = (Center of T1 End <gen>)
                                                        Unit - Order (Triggering unit) to Attack-Move To Temp_Region
                                                        Custom script:   call RemoveLocation (udg_Temp_Region)
                                                    Else - Actions


All you need to do with this trigger is make the first if then else, then copy the if then else, paste it and change the info. It should take no more then 5 minutes to make

If you arn't able to under stand this trigger or able to make it, post the names of your 10 or 8 regions and I will make it in a blank map and upload, but it will be best if you can do it your self, that way you don't need help for the same type of trigger in the future.
 

Flow

New Member
Reaction score
4
Um, if you are indeed replicating a movement system that is already on the map, why don't you just copy that and change the region and whatever other details have to be changed? :p
 

smiley1337

New Member
Reaction score
1
yes dameon u did give me that code but it's too complicated for me,i basically understarnd it but not all and i dont like so many if the else's....i just want to make different triggers for all movements between regions(like trigger1=movement from spawn to region1,trigger2=movement from region1 to region2) that would be a lot more easier for me. i already tryed to make a code from your posted code dameon but that didn't work:/ so could u just cut me out that part i need for moving creeps from spawn to region 1 and from region 1 to region 2. tnx...
Omg that isn't a JASS code right? rofl i tryed to use it as a jass code,thats why it didn't work

WONT THIS WORK?:

Code:
Events
Unit - A unit enters Creep Start Top <gen>
Conditions
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Unit Group - Pick every unit in (Units in Creep Start Top <gen>) and do (Unit - Order (Triggering unit) to Move To (Center of Move Top Middle <gen>))
Custom script:   call RemoveLocation (udg_Move_Top_Middle)
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
If you want to make 1 trigger for each movement.

this is free hand

event
Unit enters region (your 1st region)

Condition

Onwer of triggering unit equal to player 12 (brown)

Actions

set varible, temp_region to center of (your 2nd region)
unit issue order targeting point move to attack temp_region
Custom script: call RemoveLocation (udg_Temp_Region)

event
Unit enters region (your 2nd region)

Condition

Onwer of triggering unit equal to player 12 (brown)

Actions

set varible, temp_region to center of (your 3rd region)
unit issue order targeting point move to attack temp_region
Custom script: call RemoveLocation (udg_Temp_Region)


Edit: all the trigger I post are in GUI.

to make your temp region go into your varibles and name one temp_region then under the tab chose region
 

Dan

The New Helper.Net gives me great Anxiety... o.O;;
Reaction score
159
no that wasn't jass. just a mess of nested if/else commands. But if you put your mind to it for a few minutes it will become clear to you. You just have to trace it. Takes practice.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
no that wasn't jass. just a mess of nested if/else commands. But if you put your mind to it for a few minutes it will become clear to you. You just have to trace it. Takes practice.

He is right, just a bunch of nested if then elses, they dont even need to be put like that, you can make each one seperate and it will still work, I just do it that way to save prossesing time.
Your trigger can be made to work, but it will still leak, and there is no need to use unit group, it just adds more prossesing time, say you send 10 units, each unit will cause all the units in the region to get the order, so that ends up in 100 orders amoungst those 10 units. But with simply ordering triggering unit instead of the entire group in the region you only give 10 orders to those 10 creeps.

Edit: just reread the posts lol, as for JASS. I dont know any JASS and I am not the best speller so I am not going to try to learn lol :)
 

smiley1337

New Member
Reaction score
1
Code:
Startup Movement Top
    Events
        Unit - A unit enters Creep Start Top <gen>
    Conditions
        (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
 Set TempRegion = Move Top Middle <gen>
Unit Group - Pick every unit in (Units in Creep Start Topleft <gen>) and do (Unit - Order (Triggering unit) to Move To (Center of TempRegion))
Custom script:   call RemoveLocation (udg_TempRegion)

doesn't work !
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Dont use unit group, use order unit.

Ps you have it set to even a creep enters Creep Start Top

But in your unit group you use Creep Start Topleft

edit: unit issue order targeting point

Unit - Order (Triggering unit) to Attack-Move To Temp_Region
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
did you spell it exacly how your varible is spelled? Can you copy the trigger and post it.

Ps. wait a sec and I will show you some thing cool
 

smiley1337

New Member
Reaction score
1
Code:
Startup Movement Top
    Events
        Unit - A unit enters Creep Start Top <gen>
    Conditions
        (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
 Set TempRegion = Move Top Middle <gen>
Unit Group - Pick every unit in (Units in Creep Start Topleft <gen>) and do (Unit - Order (Triggering unit) to Move To (Center of TempRegion))
Custom script:   call RemoveLocation (udg_TempRegion)


waiting for the cool thing:D
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
1) Don't double post; use the Edit button.
2) Daemon, please use code tags.

JASS:
call RemoveLocation (udg_TempRegion)

Should be:
JASS:
call RemoveLocation(udg_TempRegion)


Code:
Startup Movement Top
    Events
        Unit - A unit enters [B]Creep Start Top[/B] <gen>
    Conditions
        (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
 Set TempRegion = Move Top Middle <gen>
Unit Group - Pick every unit in (Units in [B]Creep Start Topleft[/B] <gen>) and do (Unit - Order (Triggering unit) to Move To (Center of TempRegion))
Custom script:   call RemoveLocation (udg_TempRegion)
Don't use a unit group. Use Unit Order Targeting Point.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
use this instead
call RemoveRect(udg_Your_Variable)

PS. I am haveing some trouble here, this should work but it isn't and I dont see why not, At first I did it with no leaks, but then I just did the basic to get it to work but no luck.
 

smiley1337

New Member
Reaction score
1
sry for doublepost,i wanted to bump the topic.
still error....

picture:
 

Attachments

  • error.PNG
    error.PNG
    39.3 KB · Views: 68

Nexor

...
Reaction score
74
Code:
Unit Group - Pick every unit in (Units in Creep Start Topleft <gen>) and do (Unit - Order (Triggering unit) to Move To (Center of TempRegion))

It won't work because of Triggering unit
use Picked unit instead

Code:
Unit Group - Pick every unit in (Units in Creep Start Topleft <gen>) and do (Unit - Order (Picked unit) to Move To (Center of TempRegion))
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
sry for doublepost,i wanted to bump the topic.
Read the rules. Not knowing them is no excuse for disobeying them.

You're using the wrong function. You need RemoveRect (or DestroyRect, I forget) to remove a rect; you need RemoveLocation to remove a location.
 
General chit-chat
Help Users
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs
  • Monovertex Monovertex:
    @The Helper I'm really not seeing the "Signature" link in the sidebar on that page. Here's a screenshot:
  • The Helper The Helper:
    I have reported it - I was wondering why nobody I have given sigs to over the last few years have used them
  • The Helper The Helper:
    Ghan has said he has fixed this. Monovertex please confirm this fix. This was only a problem with people that had signatures in the upper levels like not the special members but the respected members.
  • The Helper The Helper:
    Here is a better place to manage this stuff https://www.thehelper.net/account/account-details which I think should be way more visible
  • The Helper The Helper:
    I am hoping that online user count drop is finally that TikTok bot banned

      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